Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[bioontology-support] subclass query

manuelso manuelso at stanford.edu
Mon May 21 12:05:31 PDT 2012


Hi Helena,

Those "has_role" relationships that you are trying to find are hidden in the form of OWL restrictions. OWL restrictions serialize into complex RDF objects that use blank nodes and it is sometimes difficult to extract information from these.

The SPARQL query you need is ...

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?sub ?label
FROM <http://bioportal.bioontology.org/ontologies/CHEBI>
WHERE { 
?s <http://www.w3.org/2002/07/owl#someValuesFrom> <http://purl.obolibrary.org/obo/CHEBI_22586> .
?s <http://www.w3.org/2002/07/owl#onProperty> <http://purl.obolibrary.org/obo/download#has_role> .
?sub rdfs:subClassOf ?s .
?sub rdfs:label ?label .
}

that returns ..

<http://purl.obolibrary.org/obo/CHEBI_3918>	"crocetin"^^<http://www.w3.org/2001/XMLSchema#string>
<http://purl.obolibrary.org/obo/CHEBI_46245>	"coenzyme Q10"^^<http://www.w3.org/2001/XMLSchema#string>
<http://purl.obolibrary.org/obo/CHEBI_27547>	"zeaxanthin"^^<http://www.w3.org/2001/XMLSchema#string>
<http://purl.obolibrary.org/obo/CHEBI_15040>	"retinyl palmitate"^^<http://www.w3.org/2001/XMLSchema#string>
(...)

Unfortunately I do not think that SPARQL queries like the one above can be easily generalized and you might need to come up with some smart component that finds the pieces of information from how OWL serializes into RDF. If you want look further into this issue this reference might help:

http://www.w3.org/TR/owl2-mapping-to-rdf/

Best,

Manuel

On May 19, 2012, at 9:47 AM, Helena Deus wrote:

> Hi, 
> 
> I am trying to replicate with a sparql query what I see through the bioportal interface. When I navigate to http://bioportal.bioontology.org/ontologies/1007?p=terms&conceptid=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FCHEBI_22586 and click "visualize", there is a lot of concepts that connect to this one via a "hasRole" relationship. 
> 
> But when I try to find these concepts using a reverse SPARQL query:
> 
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> SELECT *
> FROM <http://bioportal.bioontology.org/ontologies/CHEBI>
> WHERE { 
> ?s ?p <http://purl.obolibrary.org/obo/CHEBI_22586> .
> }
> 
>  The "hasRole" is nowehre to be seen... Any ideas on how I can capture the list of things with that role using the SPARQL endpoint?
> 
> Thanks!
> 
> 
> -- 
> Helena F. Deus
> Post-Doctoral Researcher at DERI/NUIG
> http://lenadeus.info/
> 
> _______________________________________________
> bioontology-support mailing list
> bioontology-support at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/bioontology-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/bioontology-support/attachments/20120521/fffb0e35/attachment.html>


More information about the bioontology-support mailing list