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] NCBO Bioportal Bio2RDF service - bug report

manuelso manuelso at stanford.edu
Fri Jan 13 11:02:17 PST 2012


Hi Michael,

http://alphasparql.bioontology.org/  contains ontology content for only the latest version and metadata for more than one version.

To get the latest ontology version you can run (this is only metadata):

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX def: <http://bioportal.bioontology.org/metadata/def/>
SELECT DISTINCT ?version ?date WHERE {
    <http://bioportal.bioontology.org/ontologies/1084> def:hasVersion ?version .
    ?version def:timestampCreation ?date .
} ORDER BY DESC(xsd:datetime(?date)) LIMIT 1

Where <http://bioportal.bioontology.org/ontologies/1084> is BioPortal's URI for NIFSTD. That query returns <http://bioportal.bioontology.org/ontologies/46505>  as the latest version. If you want to get the metadata for that version you can run:

DESCRIBE <http://bioportal.bioontology.org/ontologies/46505>

This would return all the metadata triples for that ontology version. If you want to retrieve the actual content of the ontology you have to direct your queries to the graph holding the data. This graph is named with the BioPortal's Virtual ID URI (<http://bioportal.bioontology.org/ontologies/1084>). The query would look like:

SELECT *
 FROM <http://bioportal.bioontology.org/ontologies/1084>
WHERE {
    // triple patterns in here //
}

As you can see, the FROM clause points to the Virtual Ontology ID (1084) and NOT to the version id (46505). The ontology content is always in the virtual id graph. To get the list of graphs that contain ontologies' content you need to run:

PREFIX def: <http://bioportal.bioontology.org/metadata/def/>
SELECT DISTINCT ?virtualID WHERE {
    ?virtualID def:hasVersion ?version .
}

To retrieve all ontologies' data you would have to loop over the results of this query. 


Manuel

On Jan 13, 2012, at 6:47 AM, Michel Dumontier wrote:

> Cool.  Can you help me formulate a SPARQL query to get the most current version of each ontology?
> 
> m.
> 
> On Tue, Jan 10, 2012 at 10:47 PM, manuelso <manuelso at stanford.edu> wrote:
> Hi Michel.
> 
> Alternatively to the dump_n3 service you can use 
> 
> http://alphasparql.bioontology.org/
> 
> You could run a query like ...
> 
> PREFIX owl:  <http://www.w3.org/2002/07/owl#>
> PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> 
> SELECT DISTINCT ?termURI ?prefLabel ?subClassOf ?description
>  FROM <http://bioportal.bioontology.org/ontologies/1411>
>  FROM <http://bioportal.bioontology.org/ontologies/globals> 
> WHERE {
>       ?termURI a owl:Class;
>       skos:prefLabel ?prefLabel .
>       OPTIONAL {
>         ?termURI rdfs:comment ?description .
>       }
>       OPTIONAL {
>         ?termURI rdfs:subClassOf ?subClassOf .
>       }
> }
> 
> We have implemented subPropertyOf reasoning and you do not need to worry about different "label" predicates. They are all mapped into skos:prefLabel. Same happens for comments with rdfs:comment. To use this capability you need to include the graph "globals"  into the query.
> 
> The other graph part of the query, http://bioportal.bioontology.org/ontologies/1411, is the graph where the ontology is stored. In this case the id 1411 is the virtual id of the ontology version that you were using as test (40865)
> 
> It would not be very complicated to transform the result of this query into the RDF /ntriples format that you need. Eventually you could also try to run a CONSTRUCT query that would do that job.
> 
> If you decide to go for this solution I am happy to help with any support you might need.
> 
> More documentation about our triple store alpha release:
> 
> http://www.bioontology.org/wiki/index.php/SPARQL_BioPortal
> http://alphasparql.bioontology.org/examples
> https://github.com/ncbo/sparql-code-examples
> 
> Best,
> 
> Manuel
> 
> 
> On Jan 10, 2012, at 12:15 PM, Michel Dumontier wrote:
> 
>> Hi BioPortal,
>>  We're updating the Bio2RDF scripts package, and I'm now reviewing what has been done at the NCBO to automatically generate the Bio2RDF downloadable services, so we can add this data to the Bio2RDF network.
>> 
>> i used the following to do my assessment:
>> http://rest.bioontology.org/bioportal/ontology/dump_n3/40865
>> 
>> 
>> 1. URI syntax
>> The general form of the Bio2RDF URI syntax is
>> http://bio2rdf.org/namespace:identifier
>>   where namespace is specified in a lower case, and the identifier case is as per the issuer.
>> 
>> so URIs of the form <http://bio2rdf.org/ns#identifier> are not valid.
>> 
>> example: <http://bio2rdf.org/obo#term> 
>> should be <http://bio2rdf.org/obo:term>
>> 
>> example <http://bio2rdf.org/ns/obo_resource:name>
>> should be <http://bio2rdf.org/obo:name>
>> 
>> example: <http://bio2rdf.org/ns/ICF> 
>> should be <http://bio2rdf.org/ns:icf>
>> 
>> 2. Descriptions
>> 
>> We suggest the use of rdf:type, rdfs:label and dc:description (where dc is for dcterms) for all bio2rdf resources, where possible
>> 
>> <http://bio2rdf.org/icf:b> rdf:type <http://bio2rdf.org/obo:term> .
>> <http://bio2rdf.org/icf:b> rdfs:label "b. BODY FUNCTIONS [icf:b]" .
>> <http://bio2rdf.org/icf:b> dc:description "Definitions: Body functions are the physiological functions of body systems (including psychological functions). ... the rest of the description.... ".
>> 
>> 3. triples
>> 
>> looking at the provided example ontology i see
>> 
>> <http://bio2rdf.org/CausalFactorTerm> <http://bio2rdf.org/ns/obo#is_a> <http://bio2rdf.org/ICF:EtiologyTerm> .
>> 
>> so, since CausalFactorTerm is in the ICF namespace, this triple should read
>> <http://bio2rdf.org/icf:CausalFactorTerm> <http://bio2rdf.org/obo:is_a> <http://bio2rdf.org/icf:EtiologyTerm> .
>> 
>> That's it for now, thanks!
>> 
>> m.
>> 
>> -- 
>> Michel Dumontier
>> Associate Professor of Bioinformatics
>> Carleton University
>> http://dumontierlab.com
>> _______________________________________________
>> bioontology-support mailing list
>> bioontology-support at lists.stanford.edu
>> https://mailman.stanford.edu/mailman/listinfo/bioontology-support
> 
> 
> 
> 
> -- 
> Michel Dumontier
> Associate Professor of Bioinformatics
> Carleton University
> http://dumontierlab.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/bioontology-support/attachments/20120113/67d4f0be/attachment-0001.html>


More information about the bioontology-support mailing list