-
Notifications
You must be signed in to change notification settings - Fork 0
Cookbook of SPARQL
Junjun Cao edited this page Sep 11, 2024
·
7 revisions
A reference book for SPARQL can be:"Learning SPARQL" released by O'REILLY.
- How to examine whether a class is in an rdf:List? For example:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX example: <http://example.org/ontology/>
?ClassUnion rdf:type owl:Class ;
owl:unionOf ?UnionList .
?UnionList rdf:rest*/rdf:first example:SomeClass .# This is to to traverse RDF lists and check if "example:SomeClass" is included in the list, regardless of its position.
- The basic principle of using 'UNION':
{} UNION {}--make sure the two parts joined byUNIONbe "braced". Even ChatGPT easily omits it.