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 endpoint

Madani,Sina AHMadani at mdanderson.org
Wed Mar 5 09:48:25 PST 2014


Thank you Manuel,
Yes, I understand your point for using SERVICE. I didn't include the portion of the query that points to my local triple store where it makes a federated query.
I wanted to make sure that from my local triple store (AllegroGraph) I can extract data from (remote) Bioportal sparql endpoint first and, if it is successful,  then connect Bioportal data (CUI) to my local CUIs to get the hierarchy/relationships between CUIs. I am not using Java.   Is this even possible?

Thanks!
Sina

P.S Thanks for the filter replacement. In my original code I was using a list of 10 codes and that's why I used Filter :)

Sina

From: manuelso [mailto:manuelso at stanford.edu]
Sent: Wednesday, March 05, 2014 11:20 AM
To: Madani,Sina
Cc: support at bioontology.org Support
Subject: Re: [bioontology-support] sparql endpoint

Hi Sina,

Your apikey seems to be fine.

I am not sure if you can combine FROM and SERVICE. But  you do not need to use a SERVICE query, SERVICE should be  used for federated resources and your query is targeting only one endpoint. Something like this would the job better and faster:

PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#<http://www.w3.org/2001/XMLSchema>>
PREFIX skos:  <http://www.w3.org/2004/02/skos/core#<http://www.w3.org/2004/02/skos/core>>

SELECT ?x ?label
FROM <http://bioportal.bioontology.org/ontologies/SNOMEDCT>
WHERE
{
?x skos:notation '372030009'^^xsd:string;
skos:prefLabel ?label.
}

Notice how I replaced the filter.

If you are using Java, to run that query you can use, as a template, the code in here:

https://github.com/ncbo/sparql-code-examples/blob/master/java/src/org/ncbo/stanford/sparql/examples/JenaARQTest.java

Manuel

PS: I hope you don't mind me cc-ing the support list so that this gets archived. I have removed your api key from the thread.

On Mar 5, 2014, at 7:48 AM, Madani,Sina <AHMadani at mdanderson.org<mailto:AHMadani at mdanderson.org>> wrote:


Thank you Manuel,
One more question. I am trying to access your sparql endpoint from my local AllegroGraph store but am getting error (Executing query failed: bad request Remote server returned error code 403.
) while executing below query.
Is it something wrong with my query or my apikey is not active? I want to link some of Bioportal SNOMED data to my local store data.

Thanks!
Sina

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#<http://www.w3.org/2000/01/rdf-schema>>
PREFIX snomed-term: <http://purl.bioontology.org/ontology/SNOMEDCT/?apikey=APIKEY>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#<http://www.w3.org/2004/02/skos/core>>


SELECT ?o ?label
FROM <http://bioportal.bioontology.org/ontologies/SNOMEDCT>
WHERE
{
SERVICE <http://sparql.bioontology.org/sparql/?apikey=APIKEY> { ?x skos:notation ?o;
                                                                                                                                                                                                                skos:prefLabel ?label.
                                                                                                                                                                                                                  FILTER (str(?o) in ('372030009'))  }
}


Executing query failed: bad request Remote server returned error code 403.

From: manuelso [mailto:manuelso at stanford.edu]
Sent: Monday, March 03, 2014 5:59 PM
To: Madani,Sina
Cc: support at bioontology.org<mailto:support at bioontology.org>
Subject: Re: [bioontology-support] sparql endpoint

Sina,

That is correct, those are different SNOMED versions. We are working on a new version of the SPARQL endpoint that will be updated regularly. This release will probably happen in late March or early April.

Best,

Manuel


On Mar 3, 2014, at 12:09 PM, Madani,Sina <AHMadani at mdanderson.org<mailto:AHMadani at mdanderson.org>> wrote:



Hi
I am using Bioportal's  sparql endpoint to extract preLabel of some SNOMED concepts based on their codes or class names.
However, for some of the concepts no data is returned. If I do a regular Bioportal search (non sparql) for those concept codes (like the one shown in the query below)  I do get a result though.
Does this mean the sparql endpoint is pointing to a different version of SNOMED?


PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#<http://www.w3.org/2000/01/rdf-schema>>
PREFIX snomed-term: <http://purl.bioontology.org/ontology/SNOMEDCT/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#<http://www.w3.org/2004/02/skos/core>>
SELECT ?o ?label
FROM <http://bioportal.bioontology.org/ontologies/SNOMEDCT>
WHERE
{
    ?x skos:notation ?o;
       skos:prefLabel ?label.
FILTER (str(?o) in ('450945008'))
}

[no results]


<image001.png>

Thanks!
Sina
_______________________________________________
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

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


More information about the bioontology-support mailing list