({{, SPARQLExecute[url, query] 
executes query on the SPARQL endpoint located at url.}})

OpenersNotesSection(Spacer1)Details

In SPARQLExecute[url,query], query can be a symbolic SPARQL query or update request or a string.

Possible symbolic query forms include (PackageLink[SPARQLSelect, paclet:GraphStore/ref/SPARQLSelect, GraphStore Package Symbol]), (PackageLink[SPARQLAsk, paclet:GraphStore/ref/SPARQLAsk, GraphStore Package Symbol]) and (PackageLink[SPARQLConstruct, paclet:GraphStore/ref/SPARQLConstruct, GraphStore Package Symbol]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Needs["GraphStore`"]

Count the triples in Wikidata:

SPARQLExecute[
"https://query.wikidata.org/sparql",
SPARQLSelect[RDFTriple[SPARQLVariable["x"],SPARQLVariable["y"],SPARQLVariable["z"]]]/*SPARQLAggregate["count"->SPARQLEvaluation["count"][]]
]

The same query using a query string:

SPARQLExecute[
"https://query.wikidata.org/sparql",
"select (count(*) as ?count) where {?x ?y ?z}"
]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(PackageLink[SPARQLQuery, paclet:GraphStore/ref/SPARQLQuery, GraphStore Package Symbol])  ▪  (PackageLink[SPARQLUpdate, paclet:GraphStore/ref/SPARQLUpdate, GraphStore Package Symbol])  ▪  (PackageLink[SPARQLSelect, paclet:GraphStore/ref/SPARQLSelect, GraphStore Package Symbol])  ▪  (PackageLink[SPARQLConstruct, paclet:GraphStore/ref/SPARQLConstruct, GraphStore Package Symbol])  ▪  (PackageLink[SPARQLAsk, paclet:GraphStore/ref/SPARQLAsk, GraphStore Package Symbol])  ▪  (PackageLink[RDFTriple, paclet:GraphStore/ref/RDFTriple, GraphStore Package Symbol])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Querying RDF Stores Using SPARQL, paclet:GraphStore/guide/SPARQLQuery])}, {▪(RefLinkPlain[Writing To RDF Stores Using SPARQL, paclet:GraphStore/guide/SPARQLUpdate])}, {▪(RefLinkPlain[Graph Store Overview, paclet:GraphStore/guide/GraphStoreOverview])}})}})