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] SPARQL EndPOINT root path extraction

Nikolina Koleva nikkol at coli.uni-saarland.de
Fri Apr 5 03:57:11 PDT 2013


Dear Manuel,

I extract the root path for a class found in a BioPortal ontology by making use of the SPARQL endpoint. For this I send a query that iteratively collects the path. 
An example query looks like this: 

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT * WHERE { GRAPH <http://bioportal.bioontology.org/ontologies/FMA> { <http://sig.uw.edu/fma#Brain> rdfs:subClassOf ?parent.
OPTIONAL {?parent rdfs:label ?label}.
OPTIONAL {?parent skos:prefLabel ?prefLabel}.}} LIMIT 100

By getting the response for now I just select the last parent retrieved and set it to the child slot and do so until no parent is retrieved.

Tough there may be more than one paths from the root to a class and so I investigate the question how would I extract all.
One can collect them in the same manner as explained above. However, this doesn't seem to be very efficient.

The REST services allow to get all root paths. However, we want to stick to the SPARQL endpoint.
We were wondering how this is done there. 

We experimented with the SPARQL 1.1 Proprty Paths for getting the root path and it is possible to use the "+" operator that gives all ancestors.
For example using stardog:

./stardog query -c snarl://localhost:5820/temp -q "CONSTRUCT { ?s rdfs:subClassOf ?o } WHERE { ?s rdfs:subClassOf ?o. obo:OGMS_0000071 rdfs:subClassOf+ ?o }"

The query above delivers the paths that we need. Unfortunately the "+" operator is not yet allowed by the BioPortal SPARQL endpoint.

Are you going to update to the SPARQL 1.1 version? 
Do you have any idea how this could be solved?

Thank you very much in advance!

Best regards,
Nikolina

http://www.ifomis.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/bioontology-support/attachments/20130405/218f18ce/attachment-0001.html>


More information about the bioontology-support mailing list