Hey,

I want to do federation between to endpoints, both of which contain
named graphs. I'm trying a query of this shape:

PREFIX  foaf: <http://xmlns.com/foaf/0.1/>
PREFIX  acl:  <http://www.w3.org/ns/auth/acl#>

SELECT  *
WHERE
  { GRAPH 
<http://localhost:8080/graphity-platform/persons/Martynas%20Jusevi%C4%8Dius#this>
      { SERVICE <http://localhost:8080/graphity/platform/sparql>
          {   { <http://localhost:8080/graphity-platform/login>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?class }
            UNION
              { GRAPH ?g
                  { <http://localhost:8080/graphity-platform/login>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?class }
              }
          }
      }
  }

However if I remove the outer GRAPH validate the resulting query with sparql.org

PREFIX  foaf: <http://xmlns.com/foaf/0.1/>
PREFIX  acl:  <http://www.w3.org/ns/auth/acl#>

SELECT  *
WHERE
  { SERVICE <http://localhost:8080/graphity/platform/sparql>
      {   { <http://localhost:8080/graphity-platform/login>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?class }
        UNION
          { GRAPH ?g
              { <http://localhost:8080/graphity-platform/login>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?class }
          }
      }
  }

I seem to get the exact same algebra:

(base <http://example/base/>
  (prefix ((foaf: <http://xmlns.com/foaf/0.1/>)
           (acl: <http://www.w3.org/ns/auth/acl#>))
    (service <http://localhost:8080/graphity/platform/sparql>
      (union
        (bgp (triple <http://localhost:8080/graphity-platform/login>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?class))
        (graph ?g
          (bgp (triple <http://localhost:8080/graphity-platform/login>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?class)))))))

Which would mean the queries are equivalent? In this case there's
something I don't understand... I need to use named graphs on both
sides.

What are the semantics of of SERVICE within GRAPH? I checked the 1.1
Federated Query document but there were no examples with named graphs.

Martynas
graphityhq.com

Reply via email to