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
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: <> 
PREFIX skos: <>
SELECT * WHERE { GRAPH <> { <> 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,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the bioontology-support mailing list