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] Federated Sparql Question

manuelso manuelso at stanford.edu
Tue Feb 18 12:00:38 PST 2014


Hi Tom,

Jena ARQ will try to do joins on the client side moving a lot of data between our servers and your client process. In many cases this is not an optimized query plan and probably is not working very well for you. See “Performance Considerations” here [1]. Also the fact that the second section has two binds on skos:altLabel that is N-ary can make this problem even worse.

I would try the following. Run the two queries independently replacing ?source and ?target from the first section with a FILTER on the second section. For example, if from the first query you get:

?source    ?target
<source1> <target1>
<source2> <target2>
….
<sourceN> <targetN>

The second query would look like …

?term skos:prefLabel ?pref .
?term skos:altLabel ?alt .
FILTER( ?term = <source1> || ?term = <source2> || ?term <target1> || ?term <target2> ||  … || ? term = <sourceN> || ?term = <targetN>)

This type of query is heavily optimize in our systems. You might want to break into slices of 100 terms or so to avoid timeouts or query strings too long. Most of the mappings are bidirectional so you do not need to track ?source and ?target in the second section.

Could you comment on how slow is the performance of the federated query ? I am just curious about it … and also how many rows it returns. Thanks.

Best,

Manuel

[1] http://jena.sourceforge.net/ARQ/service.html

On Feb 17, 2014, at 3:03 PM, tomd <tom.dwyer at patientfirst.com> wrote:

> Hi,
> I am an experienced developer but new to SPARQL, like what I see so far.  I
> am trying to create a mapping lookup table from ICD-10 to SNOMEDCT, along
> with descriptions.  I can get the mappings running fine but to get the
> descriptions I need to do a federated query.  The performance is not very
> good.  Can you offer any suggestions.  I am running the following query over
> a local Jena ARQ client:
> 
> PREFIX map: <http://protege.stanford.edu/ontologies/mappings/mappings.rdfs#>
> PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
> SELECT DISTINCT ?icdNum ?snoNum ?icdLabel ?snoLabel 
> FROM <http://bioportal.bioontology.org/ontologies/SNOMEDCT>
> FROM <http://bioportal.bioontology.org/ontologies/ICD10>
> FROM <http://bioportal.bioontology.org/ontologies/globals>
> FROM <http://purl.bioontology.org/mapping/loom>
> FROM <http://purl.bioontology.org/mapping/umls_cui> 
> WHERE {
>    SERVICE
> <http://sparql.bioontology.org/mappings/sparql/?apikey=24e242d6-54e0-11e0-9d7b-005056aa3316>
> {
>      ?m map:source_ontology
> <http://bioportal.bioontology.org/ontologies/1553> .
>      ?m map:target_ontology
> <http://bioportal.bioontology.org/ontologies/1353> .
>      ?m map:source ?source .
>      ?m map:target ?target .
>    }
>    SERVICE
> <http://sparql.bioontology.org/ontologies/sparql/?apikey=24e242d6-54e0-11e0-9d7b-005056aa3316>
> {
>      ?source skos:prefLabel ?icdLabel  .
>      ?source skos:notation ?icdNum.
>      ?target skos:prefLabel ?snoLabel  .
>      ?target skos:notation ?snoNum.
>    }
> }
> ORDER BY asc (?icdNum)
> LIMIT 10000
> 
> Thanks in advance,
> Tom
> 
> 
> 
> 
> 
> --
> View this message in context: http://ncbo-support.2288202.n4.nabble.com/Federated-Sparql-Question-tp4652567.html
> Sent from the NCBO Support mailing list archive at Nabble.com.
> _______________________________________________
> bioontology-support mailing list
> bioontology-support at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/bioontology-support



More information about the bioontology-support mailing list