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
Sat Jul 14 12:01:55 PDT 2012


Good, I am glad it helped. Do not hesitate to contact us if you have more questions.

Best,

Manuel

PS: please always cc support list to maintain QA archived. thanks.

On Jul 14, 2012, at 11:41 AM, Rance, Bastien (NIH/NLM/LHC) [C] wrote:

> Hi Manuel,
> 
> Apparently i was too sleepy yesterday when I read your answer, because it actually solved my problem.
> Here is the query that i have used:
> 
> 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/>
> PREFIX meta: <http://bioportal.bioontology.org/metadata/def/> 
> 
> SELECT distinct ?graph ?s ?cui
> WHERE {
>  ?m map:target_ontology <http://bioportal.bioontology.org/ontologies/1290> .
>  ?m map:source_ontology ?ontology .
>  ?ontology meta:hasVersion ?version .
>  ?version meta:hasDataGraph ?graph .
>  ?m map:source ?o .
>  ?m map:target ?s .
>  GRAPH ?graph {
>    ?o umls:cui ?cui .
>  }
> }
> LIMIT 1000
> 
> Thank you very much!
> 
> Best regards,
> Bastien
> ________________________________________
> From: manuelso [manuelso at stanford.edu]
> Sent: Friday, July 13, 2012 9:39 PM
> To: Rance, Bastien (NIH/NLM/LHC) [C]
> Cc: bioontology-support at mailman.stanford.edu
> Subject: Re: [bioontology-support] Ungrounded graphs in Bioportal SPARQL endpoint
> 
> 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<mailto:bioontology-support at lists.stanford.edu>
> https://mailman.stanford.edu/mailman/listinfo/bioontology-support



More information about the bioontology-support mailing list