Reputation:
My current query looks like this:
SELECT DISTINCT ?pred WHERE {
?pred a rdf:Property
}
ORDER BY ?pred
which returns predicates like http://dbpedia.org/ontology/birthYear and http://dbpedia.org/property/abandoned . How may I modify my query in order to get results with the prefix "http://dbpedia.org/ontology/" only?
Upvotes: 0
Views: 252
Reputation: 9434
@AKSW provided one possible solution in comments, which may indeed get you what you want --
SELECT ?pred
WHERE
{ VALUES ?type {owl:ObjectProperty owl:DatatypeProperty }
?pred a ?type
}
ORDER BY ?pred
That said, your question was specific in a way not answered by the above, so possibly this might be what you want --
SELECT ?pred
WHERE
{
?pred a rdf:Property
FILTER ( REGEX ( STR (?pred), "http://dbpedia.org/ontology/", "i" ) )
}
ORDER BY ?pred
Upvotes: 2