Last active
June 13, 2016 12:45
-
-
Save kozo2/ecc4312f3dcc00418a5514b7bf517e1e to your computer and use it in GitHub Desktop.
biohack16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from SPARQLWrapper import SPARQLWrapper, JSON | |
| #sparql = SPARQLWrapper("http://sparql.uniprot.org/") | |
| sparql = SPARQLWrapper("http://sparql.uniprot.org/sparql/") | |
| sparql.setQuery(""" | |
| PREFIX up:<http://purl.uniprot.org/core/> | |
| SELECT ?taxon | |
| FROM <http://sparql.uniprot.org/taxonomy/> | |
| WHERE | |
| { | |
| ?taxon a up:Taxon . | |
| } | |
| """) | |
| sparql.setReturnFormat(JSON) | |
| results = sparql.query().convert() | |
| print(results['results']['bindings']) |
Author
Could you try
sparql = SPARQLWrapper("http://sparql.uniprot.org/sparql/")From logs SPARQLWrapper not following a redirect to the real endpoint.
Author
@JervenBolleman Sorry my reply is late.
Thank you very much.
New endpoint works well for Python SPARQLWrapper package.
I replaced
"http://sparql.uniprot.org/" to "http://sparql.uniprot.org/sparql/"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@JervenBolleman Thank you for you advice.
I had the same response again.