You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
match
$j isa journal, has name "Acta Materialia";
not { $p isa publication, has paper-id "1234"; };
insert
$p isa publication, has paper-id "1234";
(journal: $j, publication: $p) isa publishing;
Example 2:
match
{ $j isa journal, has name "Acta Materialia"; } or { $j isa journal, has name "Acta Mater."; };
insert
$p isa publication, has paper-id "1234";
(journal: $j, publication: $p) isa publishing;
This is because the negation and disjunction blocks are currently illegal in match clauses without at least one binding from within the block also bound outside of the block.
Current Workaround
In some cases, the query can be modified without much impact to readability and still produce identical results, for instance:
Example 2:
match
$j isa journal;
{ $j has name "Acta Materialia"; } or { $j has name "Acta Mater."; };
insert
$p isa publication, has paper-id "1234";
(journal: $j, publication: $p) isa publishing;
But in others, the simplest approaches that produces identical results under all circumstances is far less readable, and very unintuitive to construct for non-expert users:
Example 1:
match
$j isa journal, has name "Acta Materialia";
$p-type type publication;
not { $p isa $p-type, has paper-id "1234"; };
insert
$p isa publication, has paper-id "1234";
(journal: $j, publication: $p) isa publishing;
It should be possible to find a workaround in any case, so this does not affect language expressivity.
Proposed Solution
Allow negation and disjunction blocks without any bindings within the block also bound outside. Some cases of this are not logically sound queries, but they should be possible to distinguish when the query is parsed and throw an exception, as opposed to the current behaviour which is to reject all such queries indiscriminately.
The text was updated successfully, but these errors were encountered:
Problem to Solve
Currently, the following queries are illegal:
Example 1:
Example 2:
This is because the negation and disjunction blocks are currently illegal in match clauses without at least one binding from within the block also bound outside of the block.
Current Workaround
In some cases, the query can be modified without much impact to readability and still produce identical results, for instance:
Example 2:
But in others, the simplest approaches that produces identical results under all circumstances is far less readable, and very unintuitive to construct for non-expert users:
Example 1:
It should be possible to find a workaround in any case, so this does not affect language expressivity.
Proposed Solution
Allow negation and disjunction blocks without any bindings within the block also bound outside. Some cases of this are not logically sound queries, but they should be possible to distinguish when the query is parsed and throw an exception, as opposed to the current behaviour which is to reject all such queries indiscriminately.
The text was updated successfully, but these errors were encountered: