jopa icon indicating copy to clipboard operation
jopa copied to clipboard

Support SERVICE in SOQL/Criteria API

Open luxbe opened this issue 1 year ago • 2 comments

Federation is a big Use Case for SPARQL, so JOPA should support the SPARQL SERVICE keyword within SOQL/Criteria API.

Similar to #218, this is a completely new query feature and its syntax need to be carefully considered. Ideally, both the SERVICE and the OPTIONAL keyword follow the same Syntax.

luxbe avatar Nov 22 '24 11:11 luxbe

One proposal for a common Syntax could be the following:

SELECT p FROM Person p WHERE SERVICE :service ( p.username = :uname )

And for OPTIONAL:

SELECT p FROM Person p WHERE OPTIONAL ( p.username = :uname )

Where braces wrap one or multiple Axioms, similar to the resulting SPARQL. Braces would be required for the SERVICE and OPTIONAL keywords to avoid disambiguate statements where it isn't clear which statements are affected by the keywords.

The SERVICE keyword would also require another parameter before the statements wrapped in brackets (e.g. :service) to actually set the URL of the Service to talk to

luxbe avatar Nov 22 '24 11:11 luxbe

Besides SERVICE, GRAPH is another SPARQL keyword with virtually the same syntax and similar functionality. Even though a graph can be specified by a Descriptor passed to the query, it is applied only to loading result entities, it does not influence the query execution.

ledsoft avatar Aug 04 '25 11:08 ledsoft