Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Federated queries via string matching #605

Open
CFGrote opened this issue Jun 19, 2024 · 1 comment
Open

Federated queries via string matching #605

CFGrote opened this issue Jun 19, 2024 · 1 comment

Comments

@CFGrote
Copy link

CFGrote commented Jun 19, 2024

If I understand correctly, setting up a federated query requires that the subject node of the config-core:sparqlService annotated property exists both in the local graph and in the remote (federated) graph. E.g. in the documented example, the node Museum_Wikidata exists in the local graph and in Wikidata.

In my case, local and remote graphs only share common Literals, not URIs.

For example, my local graph has

local:mynode local:crossref_id "abc123" .

and the remote graph has

remote:somenode remote:id "abc123" .

and a query to cross link these two would hence read

select * where {
   ?l_node local:crossref_id ?local_id .

   service <http://remote.net/sparql> {
     ?r_node a remote:someClass;
                    remote:id ?remote_id .
    }
    values ?local_id {?remote_id} .

or something similar.

My question is if (and how) such a query could be configured in Sparnatural. I hope my example is clear enough. Thanks for any hint.

@tfrancart
Copy link
Contributor

If I understand correctly, setting up a federated query requires that the subject node of the config-core:sparqlService annotated property exists both in the local graph and in the remote (federated) graph.

I think it could work using inverse property paths. There is a subtlety, let me rephrase : it requires that the node in the subject position (in terms of query writing) of the config-core:sparqlService annotated property exists both in the local graph and in the remote (federated) graph.

I think it could work if you use an inverse property path on the sparqueSrevice-annotated property:

ex:myPropertyShape
  sh:path [ sh:inversePath remote:id ] ;  

the SPARQL query will then be something like:

select ?l_node ?r_node where {
   ?l_node local:crossref_id ?theId .

   service <http://remote.net/sparql> {
    ?theId ^remote:id  ?r_node;
    }

could you try this and let me know ?

Also let me know if you have a publicly available deployment !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants