<https://kgdev.net/specifications/sparql11-federated-query/service/>
        a       <https://www.w3.org/ns/ldt/document-hierarchy#Item> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1>
                <https://kgdev.net/specifications/sparql11-federated-query/service/#this> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2>
                <https://kgdev.net/specifications/sparql11-federated-query/service/#simpleService> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3>
                <https://kgdev.net/specifications/sparql11-federated-query/service/#optionalTwoServices> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4>
                <https://kgdev.net/specifications/sparql11-federated-query/service/#serviceFailure> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#_5>
                <https://kgdev.net/specifications/sparql11-federated-query/service/#values> ;
        <http://purl.org/dc/terms/modified>
                "2023-07-10T16:30:17.871Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        <http://purl.org/dc/terms/title>
                "SPARQL 1.1 Federated Query Extension" ;
        <http://rdfs.org/sioc/ns#has_container>
                <https://kgdev.net/specifications/sparql11-federated-query/> ;
        <http://www.w3.org/ns/prov#wasDerivedFrom>
                <https://www.w3.org/TR/sparql11-federated-query/#service> ;
        <http://xmlns.com/foaf/0.1/primaryTopic>
                <https://kgdev.net/specifications/sparql11-federated-query/service/#this> .

<https://kgdev.net/specifications/sparql11-federated-query/service/#serviceFailure>
        a                          <https://w3id.org/atomgraph/linkeddatahub#Content> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#value>
                "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h3 id=\"serviceFailure\">Service Execution Failure</h3>\n\n<p>The execution of a <code>SERVICE</code> pattern may fail due to several reasons: the remote service may be down, the service IRI may not be dereferenceable, or the endpoint may return an error to the query. Normally, under such circumstances the invoked query containing a <code>SERVICE</code> pattern fails as a whole. Queries may explicitly allow failed <code>SERVICE</code> requests with the use of the <code>SILENT</code> keyword. The <code>SILENT</code> keyword indicates that errors encountered while accessing a remote SPARQL endpoint should be ignored while processing the query. The failed <code>SERVICE</code> clause is treated as if it had a result of a single solution with no bindings.</p>\n<p>In the following query the <code>SILENT</code> keyword is present. If the remote SPARQL endpoint is not available because the SPARQL endpoint does not exist, it is down or it is not accessible the query will return a solution sequence of one empty solution mapping. If the <code>SILENT</code> keyword is not present, the query will stop and return the error.</p>\n<p>Data in <code>&lt;http://people.example.org/sparql&gt;</code> endpoint:</p>\n<pre xml:space=\"preserve\"><code>  &lt;http://example.org/people15&gt;  &lt;http://xmlns.com/foaf/0.1/name&gt;     \"Charles\" .\n</code></pre>\n<p>Query:</p>\n<pre xml:space=\"preserve\"><code>PREFIX foaf:   &lt;http://xmlns.com/foaf/0.1/&gt;\nSELECT ?name\nWHERE\n{\n  SERVICE SILENT &lt;http://people.example.org/sparql&gt; { \n    &lt;http://example.org/people15&gt; foaf:name ?name . }\n}\n</code></pre>\n<p>Query result if an error occurs while querying the remote SPARQL endpoint:</p>\n<table class=\"resultTable table table-striped\">\n   <tr>\n      <th colspan=\"1\" rowspan=\"1\">name</th>\n   </tr>\n   <tr>\n      <td colspan=\"1\" rowspan=\"1\"> </td>\n   </tr>\n</table></div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> ;
        <http://www.w3.org/ns/prov#wasDerivedFrom>
                <https://www.w3.org/TR/sparql11-federated-query/#serviceFailure> ;
        <https://schema.org/name>  "Service Execution Failure" .

<https://kgdev.net/specifications/sparql11-federated-query/service/#simpleService>
        a                          <https://w3id.org/atomgraph/linkeddatahub#Content> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#value>
                "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h3 id=\"simpleService\">Simple query to a remote SPARQL endpoint</h3>\n\n<p>This example shows how to query a remote SPARQL endpoint and join the returned data with the data from the local RDF Dataset. Consider a query to find the names of the people we know. Data about the names of various people is available at the <code>http://people.example.org/sparql</code> endpoint:</p>\n<pre xml:space=\"preserve\"><code>  @prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n  @prefix : &lt;http://example.org/&gt; .\n\n  :people15  foaf:name     \"Alice\" .\n  :people16  foaf:name     \"Bob\" .\n  :people17  foaf:name     \"Charles\" .\n  :people18  foaf:name     \"Daisy\" .\n</code></pre>\n<p>and one wants to combine with a local FOAF file </p>\n<p><code>http://example.org/myfoaf.rdf</code> that contains the single triple: </p>\n<pre xml:space=\"preserve\"><code>&lt;http://example.org/myfoaf/I&gt; &lt;http://xmlns.com/foaf/0.1/knows&gt;  &lt;http://example.org/people15&gt; . \n</code></pre>\n<p>Query:</p>\n<pre xml:space=\"preserve\"><code>PREFIX foaf:   &lt;http://xmlns.com/foaf/0.1/&gt;\nSELECT ?name\nFROM &lt;http://example.org/myfoaf.rdf&gt;\nWHERE\n{\n  &lt;http://example.org/myfoaf/I&gt; foaf:knows ?person .\n  SERVICE &lt;http://people.example.org/sparql&gt; { \n    ?person foaf:name ?name . } \n}\n</code></pre>\n<p>This query, on the data above, has one solution:</p>\n<p>Query Result:</p>\n<table class=\"resultTable table table-striped\">\n   <tr>\n      <th colspan=\"1\" rowspan=\"1\">name</th>\n   </tr>\n   <tr>\n      <td colspan=\"1\" rowspan=\"1\">\"Alice\"</td>\n   </tr>\n</table></div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> ;
        <http://www.w3.org/ns/prov#wasDerivedFrom>
                <https://www.w3.org/TR/sparql11-federated-query/#simpleService> ;
        <https://schema.org/name>  "Simple query to a remote SPARQL endpoint" .

<https://kgdev.net/specifications/sparql11-federated-query/service/#optionalTwoServices>
        a                          <https://w3id.org/atomgraph/linkeddatahub#Content> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#value>
                "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h3 id=\"optionalTwoServices\">SPARQL query with OPTIONAL to two remote SPARQL endpoints</h3>\n\n<p>Imagine we want to query people and optionally obtain their interests and the names of people they know. Imagine for instance, two endpoints containing data about people:</p>\n<p>Data in the default graph at remote SPARQL endpoint: <code>http://people.example.org/sparql</code></p>\n<pre xml:space=\"preserve\"><code>\n  @prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n  @prefix : &lt;http://example.org/&gt; .\n\n  :people15  foaf:name     \"Alice\" .\n  :people16  foaf:name     \"Bob\" .\n  :people17  foaf:name     \"Charles\" .\n  :people17  foaf:interest     &lt;http://www.w3.org/2001/sw/rdb2rdf/&gt; .\n\n</code></pre>\n<p>and data in the default graph the remote SPARQL endpoint: <code>http://people2.example.org/sparql</code></p>\n<pre xml:space=\"preserve\"><code>\n  @prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n  @prefix : &lt;http://example.org/&gt; .\n\n  :people15  foaf:knows    :people18 . \n  :people18  foaf:name     \"Mike\" .\n  :people17  foaf:knows    :people19 . \n  :people19  foaf:name     \"Daisy\" .\n\n</code></pre>\n<p>Query:</p>\n<pre xml:space=\"preserve\"><code>PREFIX foaf:   &lt;http://xmlns.com/foaf/0.1/&gt;\nSELECT ?person ?interest ?known\nWHERE\n{\n  SERVICE &lt;http://people.example.org/sparql&gt; { \n    ?person foaf:name ?name .  \n    OPTIONAL { \n      ?person foaf:interest ?interest .\n      SERVICE &lt;http://people2.example.org/sparql&gt; { \n        ?person foaf:knows ?known . } }\n  }    \n}\n</code></pre>\n<p>This query, on the data above, has three solutions:</p>\n<p>Query Result:</p>\n<table class=\"resultTable table table-striped\">\n   <tr>\n      <th colspan=\"1\" rowspan=\"1\">person</th>\n      <th colspan=\"1\" rowspan=\"1\">interest</th>\n      <th colspan=\"1\" rowspan=\"1\">known</th>\n   </tr>\n   <tr>\n      <td colspan=\"1\" rowspan=\"1\">\"Alice\"</td>\n      <td colspan=\"1\" rowspan=\"1\"></td>\n      <td colspan=\"1\" rowspan=\"1\"></td>\n   </tr>\n   <tr>\n      <td colspan=\"1\" rowspan=\"1\">\"Bob\"</td>\n      <td colspan=\"1\" rowspan=\"1\"></td>\n      <td colspan=\"1\" rowspan=\"1\"></td>\n   </tr>\n   <tr>\n      <td colspan=\"1\" rowspan=\"1\">\"Charles\"</td>\n      <td colspan=\"1\" rowspan=\"1\">&lt;http://www.w3.org/2001/sw/rdb2rdf/&gt;</td>\n      <td colspan=\"1\" rowspan=\"1\">&lt;http://example.org/people19&gt;</td>\n   </tr>\n</table>\n\n<p>Notice that in the query above there is a nested <code>SERVICE</code> in the <code>OPTIONAL</code> clause. This query requires the SPARQL query service at <code>http://people.example.org/sparql</code> to support basic federated query.</p></div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> ;
        <http://www.w3.org/ns/prov#wasDerivedFrom>
                <https://www.w3.org/TR/sparql11-federated-query/#optionalTwoServices> ;
        <https://schema.org/name>  "SPARQL query with OPTIONAL to two remote SPARQL endpoints" .

<https://kgdev.net/specifications/sparql11-federated-query/service/#this>
        a                          <https://kgdev.net/ns#Definition> , <https://w3id.org/atomgraph/linkeddatahub#Content> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#value>
                "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2 id=\"this\">SPARQL 1.1 Federated Query Extension</h2>\n\n<p>The <code>SERVICE</code> keyword instructs a federated query processor to invoke a portion of a SPARQL query against a remote SPARQL endpoint. This section presents examples of how to use the <code>SERVICE</code> keyword. The following sections define the syntax and semantics of this extension.</p></div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> ;
        <http://www.w3.org/ns/prov#wasDerivedFrom>
                <https://www.w3.org/TR/sparql11-federated-query/#service> ;
        <https://schema.org/name>  "SPARQL 1.1 Federated Query Extension" .

<https://kgdev.net/specifications/sparql11-federated-query/service/#values>
        a                          <https://w3id.org/atomgraph/linkeddatahub#Content> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#value>
                "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h3 id=\"values\">Interplay of SERVICE and VALUES (Informative)</h3>\n\n<p>SPARQL 1.1 Query includes the <code>VALUES</code> clause (<a href=\"../../sparql11-query/assignment/inline-data/#this\" shape=\"rect\">VALUES</a>), which can be used to provide an unordered solution sequence that is joined with the results of the query evaluation. Implementers of SPARQL 1.1 Federated Query may use the <code>VALUES</code> clause to constrain the results received from a remote endpoint based on solution bindings from evaluating other parts of the query.</p>\n<p>The following example shows how <code>SERVICE</code> and <code>VALUES</code> can work together. Suppose a query that asks for all instances of foaf:Person in the default graph and also their known people in the remote endpoint <code>http://example.org/sparql</code>:</p>\n<p>Data in the default graph:</p>\n<pre xml:space=\"preserve\"><code>\n  @prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n  @prefix : &lt;http://example.org/&gt; .\n\n  :a a foaf:Person  ;\n     foaf:name     \"Alan\" ;\n     foaf:mbox;     \"alan@example.org\" .\n  :b a foaf:Person  ;\n     foaf:name     \"Bob\" ;\n     foaf:mbox     \"bob@example.org\" .\n\n</code></pre>\n<p>and data in the default graph the remote SPARQL endpoint <code>http://example.org/sparql</code>:</p>\n<pre xml:space=\"preserve\"><code>\n  @prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n  @prefix : &lt;http://example.org/&gt; .\n\n  :a  foaf:knows     :b . \n  :b  foaf:knows     :c .\n  :c  foaf:knows     :a .\n  :a  foaf:interest  \"SPARQL 1.1 Basic Federated Query\" . \n  :b  foaf:interest  \"SPARQL 1.1 Query\" .\n  :c  foaf:interest  \"RDB2RDF Direct mapping\" .\n\n</code></pre>\n<p>Query:</p>\n<pre xml:space=\"preserve\"><code>PREFIX foaf:   &lt;http://xmlns.com/foaf/0.1/&gt;\nSELECT ?s\n{\n  ?s a foaf:Person .\n  SERVICE &lt;http://example.org/sparql&gt; {?s foaf:knows ?o }\n}\n</code></pre>\n<p>When the original query is executed naively, with an unconstrained service call the endpoint may return more results than necessary. It may also happen that the SPARQL endpoint will not return all of them. Many existing SPARQL endpoints have restrictions in the number of results they return and may miss the ones matching subjects <code>?s</code> from the local default graph. Thus, an implementation of a query planner for federated queries may decide to decompose the query into two queries instead, where first the bindings from the local default graph are evaluated:</p>\n<p>Query:</p>\n<pre xml:space=\"preserve\"><code>PREFIX : &lt;http://example.org/&gt;\nPREFIX foaf:   &lt;http://xmlns.com/foaf/0.1/&gt;\nSELECT ?s\n{\n  ?s a foaf:Person\n} \n</code></pre>\n<p>This query, on the data above, has two solutions:</p>\n<p>Query Result:</p>\n<table class=\"resultTable table table-striped\">\n   <tr>\n      <th colspan=\"1\" rowspan=\"1\">s</th>\n   </tr>\n   <tr>\n      <td colspan=\"1\" rowspan=\"1\">&lt;http://example.org/a&gt;</td>\n   </tr>\n   <tr>\n      <td colspan=\"1\" rowspan=\"1\">&lt;http://example.org/b&gt;</td>\n   </tr>\n</table>\n\n<p>Next, dispatch to the remote endpoint &lt;http://example.org/sparql&gt; a constrained query with the solutions for <code>?s</code>:</p>\n<pre xml:space=\"preserve\"><code>PREFIX foaf:   &lt;http://xmlns.com/foaf/0.1/&gt;\nPREFIX : &lt;http://example.org/&gt;\nSELECT * {?s foaf:knows ?o } VALUES (?s) { (:a) (:b) }\n</code></pre>\n<p>The query process involving <code>SERVICE</code> limits the data returned to the data it needs for the overall query:</p>\n<p>Query:</p>\n<pre xml:space=\"preserve\"><code>PREFIX foaf:   &lt;http://xmlns.com/foaf/0.1/&gt;\nSELECT ?s ?o\n{\n  ?s a foaf:Person\n  SERVICE &lt;http://example.org/sparql&gt; {?s foaf:knows ?o }\n} \n</code></pre>\n<p>This query, on the data above using <code>VALUES</code>, has the expected two solutions to the overall query:</p>\n<p>Query Result:</p>\n<table class=\"resultTable table table-striped\">\n   <tr>\n      <th colspan=\"1\" rowspan=\"1\">s</th>\n      <th colspan=\"1\" rowspan=\"1\">o</th>\n   </tr>\n   <tr>\n      <td colspan=\"1\" rowspan=\"1\">&lt;http://example.org/a&gt;</td>\n      <td colspan=\"1\" rowspan=\"1\">&lt;http://example.org/b&gt;</td>\n   </tr>\n   <tr>\n      <td colspan=\"1\" rowspan=\"1\">&lt;http://example.org/b&gt;</td>\n      <td colspan=\"1\" rowspan=\"1\">&lt;http://example.org/c&gt;</td>\n   </tr>\n</table></div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> ;
        <http://www.w3.org/2000/01/rdf-schema#seeAlso>
                <https://kgdev.net/specifications/sparql11-query/assignment/inline-data/#this> ;
        <http://www.w3.org/ns/prov#wasDerivedFrom>
                <https://www.w3.org/TR/sparql11-federated-query/#values> ;
        <https://schema.org/name>  "Interplay of SERVICE and VALUES (Informative)" .
