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] Ungrounded graphs in Bioportal SPARQL endpoint

manuelso manuelso at stanford.edu
Fri Jul 13 18:39:15 PDT 2012


Hi Bastien,

You can use the predicates map:source_ontology or map:target_ontology to restrict the mappings to certain pairs of ontologies.

These two predicates do not use acronym based URIs they use virtual ID based ontology URIs.  The following query returns a table that can help you to understand how to move between acronym and virtual ID URIs:

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

As you can see in the result set ...

ABA is http://bioportal.bioontology.org/ontologies/1290
MSH is http://bioportal.bioontology.org/ontologies/1351

You can use these URIs and write a query that does something like:

SELECT * WHERE {
?m map:source_ontology <http://bioportal.bioontology.org/ontologies/1351> .
?m map:target_ontology <http://bioportal.bioontology.org/ontologies/1290> .
}

If you want bidirectional mappings you can use a UNION:

SELECT * WHERE {
{
?m map:source_ontology <http://bioportal.bioontology.org/ontologies/1351> .
?m map:target_ontology <http://bioportal.bioontology.org/ontologies/1290> .
} UNION {
?m map:target_ontology <http://bioportal.bioontology.org/ontologies/1351>
?m map:source_ontology <http://bioportal.bioontology.org/ontologies/1290>
}
}

Does this help you to rewrite your queries without using FROM ? 

I do not entirely understand what you are trying to do. We only have CUIs for things that originally come from UMLS. Could you please explain your use case in further detail ? Maybe a descriptive example might help me.

On a side note, our SPARQL endpoint has  timeouts enabled so if you try to retrieve too much data your query result set will be cut. It is always better to run smaller (more selective) queries even if you have to run several of them.

Best,

Manuel


On Jul 13, 2012, at 4:38 PM, Rance, Bastien (NIH/NLM/LHC) [C] wrote:

> Hi,
> 
> I am playing with the BioPortal SPARQL endpoint. I would like to retrieve the CUIs mapped to concepts of terminologies not included in the UMLS.
> The query below allows to retrieve the results for two given ontologies. I would like to be able to find the results without specifying the ontologies (in the FROM).
> Is it possible or do I have to include all the ontologies in the FROM clause?
> 
> Thanks in advance,
> Bastien
> 
> ----- 
> Query retrieving CUIs mapped to ABA concepts through MeSH.
> 
> PREFIX owl:  <http://www.w3.org/2002/07/owl#>
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
> PREFIX map: <http://protege.stanford.edu/ontologies/mappings/mappings.rdfs#>
> PREFIX umls: <http://bioportal.bioontology.org/ontologies/umls/>
> 
> SELECT DISTINCT ?s ?label ?m ?r ?umls_s ?cui
> 
> FROM <http://bioportal.bioontology.org/ontologies/ABA>
> FROM <http://bioportal.bioontology.org/ontologies/MSH>
> FROM <http://purl.bioontology.org/mapping/loom> 
> FROM <http://purl.bioontology.org/mapping/umls_cui>
> 
> WHERE {
>       ?s a owl:Class .
>       ?s rdfs:label ?label .
>       ?m map:target ?s .
>       ?m map:relation ?r .
>       ?m map:source ?umls_s .
>       ?umls_s umls:cui ?cui .
> }
> LIMIT 10
> _______________________________________________
> 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/20120713/b35bb86b/attachment.html>


More information about the bioontology-support mailing list