SPARQLSelect
SPARQLSelect[pattern]
is a query operator that can be applied to an RDFStore, which returns a list of associations of variables to corresponding values in subgraphs that match pattern.
SPARQLSelect[patternvars]
returns values only for the variables vars.
更多信息和选项
- SPARQLSelect can be used in SPARQLExecute to query a SPARQL endpoint.
- The result of executing SPARQLSelect[pattern] is a list of associations {<"var1"val1,1,… >,…} where each "vari" is the name of a SPARQLVariable appearing in pattern and each vali,j is the value appearing in the corresponding position of a matching subgraph.
- In SPARQLSelect[pattern], pattern can be any of the following forms:
-
RDFTriple[s,p,o] triple pattern {RDFTriple[…],RDFTriple[…],…} basic graph pattern {patt1,patt2,…} group graph pattern SPARQLFilter[expr] filter solutions of surrounding patterns by expr patt/;expr filter solutions by expr SPARQLOptional[patt] optional pattern patt1patt2 ... union pattern Except[patt] eliminate solutions which are compatible with patt SPARQLPropertyPath[…] property path pattern "var"expr bind expression expr to a variable with name "var" SPARQLValues[vars, values] specify values for variables SPARQLSelect[patt] subquery SPARQLGraph[g,patt] match patt agains the graph with name g SPARQLService[url,patt] federate matching patt to the SPARQL endpoint located at url - In a triple pattern RDFTriple[s,p,o] a SPARQLVariable stands for any expression.
- The following options can be given:
-
"Distinct" False whether duplicate solutions are deleted "Limit" Infinity maximum numer of solutions to return "Offset" 0 number of solutions to skip "OrderBy" None expression by which solutions are ordered "Reduced" False whether duplicate solutions can be deleted
范例
打开所有单元关闭所有单元基本范例 (2)
Scope (9)
Triple Pattern (1)
Basic Graph Pattern (1)
A basic graph pattern is a list of triple patterns. Retrieve "title" and "created" of all articles:
Variables and literals can appear in any position. Find authors of articles created in 2018:
Different triple patterns in a basic graph pattern are not required to match different triples in a graph. The following contains solutions binding "art1" and "art2" to the same article:
To find authors that have published more than one article filter the solution by requiring "art1" and "art2" to be different:
Optional (1)
Find the name and optionally the e-mail address of all people:
When the SPARQLOptional wrapper is omitted the solution for "Bob" is missing:
Union (1)
Negation (1)
Assignment (1)
Neat Examples (1)
Make a Graph of parent taxons (P171) of the Whale (Q42196) using Wikidata:
文本
Wolfram Research (2019),SPARQLSelect,Wolfram 语言函数,https://reference.wolfram.com/language/GraphStore/ref/SPARQLSelect.html.
CMS
Wolfram 语言. 2019. "SPARQLSelect." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/GraphStore/ref/SPARQLSelect.html.
APA
Wolfram 语言. (2019). SPARQLSelect. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/GraphStore/ref/SPARQLSelect.html 年