views:

14

answers:

1

I am searching for the method/tool/syntax to query annotations in an RDF/OWL ontology. The query engines I have found search classes, properties, indivituals but I have not found one that will search based on the value for example DC:Description

Can someone enlighten me, thank you

A: 

With SPARQL, you should be able to query annotations via the properties you're interested in, for example:

PREFIX dc: <http://purl.org/dc/elements/1.1/&gt;
SELECT ?x ?desc {
  ?x dc:description ?desc .
}

This method could also be used to retrieve all instances with a particular annotation value, such as:

PREFIX dc: <http://purl.org/dc/elements/1.1/&gt;
SELECT ?x {
  ?x dc:description "some description string" .
}

Or, you could even try to match based on some REGEX:

PREFIX dc: <http://purl.org/dc/elements/1.1/&gt;
SELECT ?x {
  ?x dc:description ?desc .
  FILTER REGEX(STR(?desc), "^Some regex") .
}
sharky