cts2/bioportal-rdf-service — Issue #6: Getting info about all current ontologies
Author: kevinpeterson
Created: 2012-02-01 23:44:49+00:00
State: open

I'm trying to do a query that gathers info about the 'current' ontologies (or, ontologies with the latest timestampCreation). The query below does do what I want, but I'm getting some pretty long response times. Is this an ok query to run? Or is it too resource intensive for the server?

PREFIX bpMetadata:
PREFIX bpOntologies:
PREFIX omv:
PREFIX owl:

SELECT ?s ?acronym ?ontologyId ?versionId ?id ?description
WHERE {

?s1 a omv:Ontology;
bpMetadata:timestampCreation ?time;
omv:acronym ?acronym1

OPTIONAL {
?s2 a omv:Ontology;
bpMetadata:timestampCreation ?othertime ;
omv:acronym ?acronym2

FILTER( ?acronym1 = ?acronym2 && ?time < ?othertime ) .
} .

?s bpMetadata:timestampCreation ?time ;
omv:acronym ?acronym ;
bpMetadata:id ?versionId ;
omv:description ?description ;
bpMetadata:isVersionOfVirtualOntology ?ontologyId .
?ontologyId bpMetadata:id ?id

FILTER ( !bound(?othertime) ) .
}
LIMIT 50
OFFSET 0