Example SPARQL queries in Wolfram Language: Difference between revisions

From Synthesis Infrastructures
(Created page with "SPARQL")
 
No edit summary
Line 1: Line 1:
SPARQL
<syntaxhighlight lang="mathematica">
ImportString[
"SELECT?subject?predicate?object
WHERE {?subject ?predicate ?object .}",
"SPARQLQuery"]
</syntaxhighlight><syntaxhighlight lang="mathematica">
query = SPARQLQuery[
  SPARQLSelect[{RDFTriple[SPARQLVariable["subject"],
      SPARQLVariable["predicate"], SPARQLVariable["object"]]}]/*
  SPARQLProject[{"subject", "predicate", "object"}]]
</syntaxhighlight><syntaxhighlight lang="mathematica">
SPARQLExecute[semiWiki, query]
</syntaxhighlight>

Revision as of 16:21, 13 November 2022

ImportString[
 "SELECT?subject?predicate?object
WHERE {?subject ?predicate ?object .}",
 "SPARQLQuery"]
query = SPARQLQuery[
  SPARQLSelect[{RDFTriple[SPARQLVariable["subject"], 
      SPARQLVariable["predicate"], SPARQLVariable["object"]]}]/*
   SPARQLProject[{"subject", "predicate", "object"}]]
SPARQLExecute[semiWiki, query]