Skip to content

Allow multiple type constraints where permitted by the schema #268

Open
@james-whiteside

Description

@james-whiteside

Problem to Solve

Currently, queries do not permit the following syntax:

$v isa vehicle;
$v isa $vehicle-type;
$v has license-plate "VATICLE";

This syntax allows for the types of the vehicle to be retrieved.

Current Workaround

The following syntax works instead:

$v isa $vehicle-type;
$vehicle-type sub vehicle;
$v has license-plate "VATICLE";

Proposed Solution

The problem with the currently illegal syntax is that $v can have multiple conflicting types, however both types can be satisfied by checking if $vehicle-type is a subtype of vehicle against the schema and returning an error only if not. While not necessary, improving the expressivity of the language in this way (and others) would be a nice feature and might be more intuitive for users.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions