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
Using type/role objects in many concept API methods for instantiating types or interfaces is very inconvenient. Significant extra code is required, and several unnecessary round trips have to be made to create the objects. Consider the following query fragment, which creates a new book review entity.
match
$user ...
$book ...
?score ...
insert
$review isa review, has score ?score;
(executor: $user, action: $review) isa action-execution;
(review: $review, rated: $book) isa rating;
To perform the equivalent operation using the concept API, we must do the following:
Here, several server calls have to be made to retrieve type/role objects solely to use them once within the scope as function arguments.
Proposed Solution
Allow all concept API methods that take type/role objects as arguments to also take label strings as arguments. In this case, the above example might look something like the following.
As attribute insertions are idempotent, we could even allow set_has to take a label and value directly, though an attribute object would still be permissable.
Problem to Solve
Using type/role objects in many concept API methods for instantiating types or interfaces is very inconvenient. Significant extra code is required, and several unnecessary round trips have to be made to create the objects. Consider the following query fragment, which creates a new book review entity.
To perform the equivalent operation using the concept API, we must do the following:
Here, several server calls have to be made to retrieve type/role objects solely to use them once within the scope as function arguments.
Proposed Solution
Allow all concept API methods that take type/role objects as arguments to also take label strings as arguments. In this case, the above example might look something like the following.
As attribute insertions are idempotent, we could even allow
set_has
to take a label and value directly, though an attribute object would still be permissable.This change to
set_has
would also be more in keeping with the revised approach of attributes as second-class citizens.The text was updated successfully, but these errors were encountered: