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 BioPortal

manuelso manuelso at stanford.edu
Wed May 23 15:37:30 PDT 2012


Hi Sunita,

I have increased the query timeouts limits in our SPARQL endpoint and now your query returns solutions.

As you will experience, your query takes around 1.2 minutes to run. There is one way to speed things up. Break the query into two separate queries and it will run much faster:

(1) get the results for the ?x elements:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT *
FROM <http://bioportal.bioontology.org/ontologies/SNOMEDCT>
FROM <http://bioportal.bioontology.org/ontologies/globals>
WHERE
{
    ?x rdfs:label ?label .
    FILTER (CONTAINS ( UCASE(str(?label)), "AXONAL NEUROPATHY"))
}

(2) iterate over the result of query (1) to extend and/or filter the information with the parent terms.

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 
SELECT DISTINCT *
FROM <http://bioportal.bioontology.org/ontologies/SNOMEDCT>
FROM <http://bioportal.bioontology.org/ontologies/globals>
WHERE
{
    <http://purl.bioontology.org/ontology/SNOMEDCT/128208007> rdfs:subClassOf ?parent .
    ?parent rdfs:label ?parentLabel .
    FILTER (CONTAINS ( UCASE(str(?parentLabel)), "NEUROPATHY") )
}

Where <http://purl.bioontology.org/ontology/SNOMEDCT/128208007>  is a result from (1).

If you do it this way the whole thing should not take more than 10 secs. 

On a side note ... we expect to improve the performance of our SPARQL backend as we move from Beta to production.

If you need to run your queries  programmatically  you'll find code examples here:

https://github.com/ncbo/sparql-code-examples

Manuel



On May 23, 2012, at 1:33 PM, Koul, Sunita wrote:

> Hi,
> I am trying to run some sparql queries to retrieve some data from SNOMED
> Here is one of the queries that I am running which returns no result
>  
>  
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>  
> SELECT DISTINCT *
> FROM <http://bioportal.bioontology.org/ontologies/SNOMEDCT>
> FROM <http://bioportal.bioontology.org/ontologies/globals>
> WHERE
> {
>     ?x rdfs:label ?label .
>     ?x rdfs:subClassOf ?parent .
>     ?parent rdfs:label ?parentLabel .
>     FILTER (CONTAINS ( UCASE(str(?label)), "AXONAL NEUROPATHY") && CONTAINS ( UCASE(str(?parentLabel)), "NEUROPATHY") )
> }
>  
> If I go to UMLS browser for SNOMED and search for  AXONAL NEUROPATHY I get multiple results and one of them
> C0270921 has a parent as Neuropathy.
> I am hoping that the above query should return that result
>  
>  
>  
> Also I was wondering if someone can help me build a query that will return all the SNOMEDIDS that matches a string (say AXONAL NEUROPATHY)
> Under the root "DISEASE" meaning that I need all the IDS that fall under DISEASE(not limited to immediate children) that match my term (e.g. AXONAL NEUROPATHY)
>  
>  
>  
> Thanks
> Sunita
>  
> 
> 
> The materials in this email are private and may contain Protected Health Information. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return email.
> _______________________________________________
> 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/20120523/0e1c32e4/attachment-0001.html>


More information about the bioontology-support mailing list