86
edits
KyleMacLaury (talk | contribs) (Created page with "SPARQL") |
KyleMacLaury (talk | contribs) No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
SPARQL | This code transforms the string SPARQL query into a Wolfram Language SPARQLQuery.<syntaxhighlight lang="mathematica"> | ||
ImportString[ | |||
"SELECT?subject?predicate?object | |||
WHERE {?subject ?predicate ?object .}", | |||
"SPARQLQuery"] | |||
</syntaxhighlight>The query below is the Wolfram Language representation of the query above,<syntaxhighlight lang="mathematica"> | |||
query = SPARQLQuery[ | |||
SPARQLSelect[{RDFTriple[SPARQLVariable["subject"], | |||
SPARQLVariable["predicate"], SPARQLVariable["object"]]}]/* | |||
SPARQLProject[{"subject", "predicate", "object"}]] | |||
</syntaxhighlight>This code executes the query above agains the semiWiki RDFStore created in [[Import SMW .jsonld as RDFStore in Wolfram Language]]<syntaxhighlight lang="mathematica"> | |||
SPARQLExecute[semiWiki, query] | |||
</syntaxhighlight> |
edits