SPARQL BioPortal

From NCBO Wiki
Revision as of 11:14, 1 December 2011 by Manuel Salvadores (Talk | contribs)

Jump to: navigation, search

Before using the BioPortal SPARQL service please read our SPARQL Release Notes And Usage Policy


Web Interface and Query Examples

There is a Web interface to test SPARQL queries at

Also, interactive examples can be tested here

Submitting SPARQL queries programmatically

A github project contains examples to query our SPARQL service programmatically:

A tarball with these examples is for download here:

This project contains examples in Java, Python, JavaScript and Perl. Some of the examples use just language built-in capabilities and other need third-party libraries like Jena, Sesame or SPARQLWrapper. The github project and the tarball are self-contained, no need to download and install extra libraries.

To run these examples or any other SPARQL queries programmatically an API key from BioPortal is required. If you do not have a BioPortal account go to [New Account] and create one. Once you have the BioPortal account, login in BioPortal and go to your account details. You should see your API Key as part of your account profile.

Database Named Graph Structure

Eventually the graphs IDs for each ontology will be based on the PURL URIs that use BioPortal abbreviations. Currently, not all ontologies have unique abbreviations. While we resolve this issue the graph IDs are based on the virtual IDs. With the form:{VIRTUAL ID}

For example:

The predicate that connects metadata graphs with ontology data graphs is:

Therefore, a SPARQL query like:

SELECT ?graph {
    ?graph <> ?version

... would list all the graphs IDs for all the ontologies in the RDF database.

BioPortal Preferred Label


Preferred Names, Synonyms and other common predicates


Personal tools