Not logged in : Login

About: VirtTipsAndTricksGuideSPARQLLOADServiceUsage     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : atom:Entry, within Data Space : ods.openlinksw.com associated with source document(s)

AttributesValues
type
Date Created
Date Modified
label
  • VirtTipsAndTricksGuideSPARQLLOADServiceUsage
maker
Title
  • VirtTipsAndTricksGuideSPARQLLOADServiceUsage
isDescribedUsing
has creator
content
  • %META:TOPICPARENT{name="VirtTipsAndTricksGuide"}% ---+Virtuoso SPARQL LOAD Service ---++What? Using SPARQL LOAD service to get remote endpoint's description. ---++Why? Provides additional data that might be useful such as: if a local server knows what syntax extensions are supported by the remote SPARQL endpoint for ex.: http://example.com/sparql then it can improve the compilation of SPARQL queries that contain clauses like: SERVICE {...} . ---++How? To get the description of remote endpoint, one should run the following statement at its local server: SPARQL LOAD SERVICE DATA; The retrieved description will be stored in local RDF storage as a part of " System Metadata" graph , so the user calling this statement should have appropriate write permissions. ---+++Example 1 Suppose the following query: INSERT INTO { ?s owl:sameAs ?o. } WHERE { GRAPH { ?s rdf:type skos:Concept.} SERVICE { SELECT ?o WHERE { ?s ?o . FILTER REGEX(str(?o), "^http://dbpedia.org") . } LIMIT 10 } } 1 Next we will bound the ?s in the graph part and the ?s in the scope of the service part: For every concept ?s in the graph <http://voc.wkd.de> we want to retrieve the owl:sameAs elements in the service <http://de.dbpedia.org/sparql> , so for ex: * Locally there is the following triple: { dbpedia:A a skos:Concept } * In dbpedia there are the following triples: { dbpedia:B owl:sameAs dbpedia:C. dbpedia:A owl:sameAs dbpedia:D. } * The expected result we want to be: { dbpedia:A owl:sameAs dbpedia D. } 1 The simplest way to make ?s interrelated is to alter the select statement and to add ?s into its result set: INSERT INTO { ?s owl:sameAs ?o. } WHERE { GRAPH { ?s rdf:type skos:Concept.} SERVICE { SELECT ?s ?o WHERE { ?s ?o . FILTER REGEX(str(?o), "^http://dbpedia.org") . } LIMIT 10 } } 1 The change will affect to the following: 1 ?s from service and ?s from graph <> {} will both appear at the same scope and the equality between them will be required by the semantics. 1 The optimizer will understand that it's better to pass the ?s as parameter to the service instead of selecting all pairs of ?s and ?o and filter them at the main query server. 1 The code generator will try to write a code for sending a query to http://de.dbpedia.org/sparql but it may fail if it are not known the capabilities of SPARQL compiler at http://de.dbpedia.org/sparql , so before the first compilation, one should execute the following statement: SPARQL LOAD SERVICE DATA; * The effect of executing the SPARQL LOAD SERVICE statement will be: 1 Recognize what syntax extensions are supported by the compiler inside http://de.dbpedia.org/sparql service endpoint. E.g., whether that endpoint can deal with external parameters. 1 Will write small description of the endpoint to local metadata but will not try to copy any data stored remotely to the local storage. 1 Important Note: that if the graph <http://voc.wkd.de> { ?s rdf:type skos:Concept.} will produce many values for ?s, there will be many requests to dbpedia, and the sum of round-trip latencies will be high. In some cases it may be faster to get one big list of ?s ?o pairs from dbpedia and then search in local graph. To change the order of execution to "remote first" variant, the order of clauses should be changed to: INSERT INTO { ?s owl:sameAs ?o. } WHERE { SERVICE { SELECT ?s ?o WHERE { ?s ?o . FILTER REGEX(str(?o), "^http://dbpedia.org") . } LIMIT 10 } GRAPH { ?s rdf:type skos:Concept.} } ---++Related * [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]] * [[http://docs.openlinksw.com/virtuoso/rdfsparql.html][Virtuoso Documentation]]
id
  • 7e993b38b037d69f3c5ac536ac70b3d7
link
has container
http://rdfs.org/si...ices#has_services
atom:title
  • VirtTipsAndTricksGuideSPARQLLOADServiceUsage
links to
atom:source
atom:author
atom:published
  • 2017-06-13T05:36:13Z
atom:updated
  • 2017-06-13T05:36:13Z
topic
is made of
is container of of
is link of
is http://rdfs.org/si...vices#services_of of
is links to of
is creator of of
is atom:entry of
is atom:contains of
Faceted Search & Find service v1.17_git150 as of Jan 20 2025


Alternative Linked Data Documents: iSPARQL | ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.03.3332 as of Sep 11 2024, on Linux (x86_64-generic-linux-glibc25), Single-Server Edition (15 GB total memory, 854 MB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2025 OpenLink Software