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] BioPortal API Key for SPARQL queries

Michael Dorf mdorf at
Fri Apr 28 16:01:09 PDT 2017

Hi Maulik,

I am not intimately familiar with our SPARQL endpoint API, but a cursory look at the documentation (I looked at the examples in Java and Ruby) reveal that the API key needs to be passed as a query parameter rather than a header var:

Have you tried passing it that way?


On Apr 27, 2017, at 3:12 PM, Maulik Kamdar <maulikrk at<mailto:maulikrk at>> wrote:

Hi Jennifer, Michael,

I was wondering if I need to submit my BioPortal API key when I execute SPARQL queries against the BioPortal endpoint?

I am using a simple python module SPARQLWrapper to execute queries and it seems to be failing for BioPortal, whereas it works for most other SPARQL endpoints in the Linked Data cloud. I tried including the Authorization key value pair (or should I have username-API key pair?) -- it is similar to when I used to execute GET Requests against the BioPortal API. Please let me know, if I am doing anything incorrect!


-- code below

def get_simple_results_normal(endpoint, query):
    sparql = SPARQLWrapper(endpoint)
    sparql.addParameter('Authorization', 'apikey token=' + API_KEY)
        results = sparql.query().convert()
    except Exception:
        print "Error encountered for " + query
        return None
    return results

qe4 = ""<>

query5 = "PREFIX omv: <><> SELECT ?ont ?name ?acr WHERE { ?ont a omv:Ontology . ?ont omv:acronym ?acr . ?ont omv:name ?name .}"

res5 = get_simple_results_normal(qe4, query5)
Error encountered for PREFIX omv: <><> SELECT ?ont ?name ?acr WHERE { ?ont a omv:Ontology . ?ont omv:acronym ?acr . ?ont omv:name ?name .}

Maulik R. Kamdar
Stanford Center for Biomedical Informatics Research
Stanford University School of Medicine
Google Scholar:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the bioontology-support mailing list