简体   繁体   中英

SPARQL-Query for all objects with a specific prefix?

I created an ontology with different prefixes (rdf, rdfs, owl, example, car, bike, ...). I use them to demarcate different domains and examples.

How can I query for all objects with the profix ie "car"?

Thank you in advance!

For the future, providing a minimal sample of the data will help in providing a working query on the data. With no further detailsand assuming that you mean by "objects" the objects of triples (and indeed untested) :

PREFIX car: <TODO_ADD_URI_OF_NAMESPACE_HERE>
SELECT * {
 ?s ?p ?o .
 FILTER(isUri(?o) && STRSTARTS(STR(?o), STR(car:)))
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM