BioPortal SPARQL Examples



This page contains interactive SPARQL examples. More documentation is avalaible in our Wiki documentation
x
processing query
Get all graphs IDs that contain ontology content.
Note: This public SPARQL endpoint only contains the latest version of each BioPortal ontology. Graph IDs can be used to target queries to a specific ontology. For example, to query SNOMED, the graph ID is http://bioportal.bioontology.org/ontologies/SNOMEDCT
Get term direct sub-classes with labels. SNOMED Example.
Get all root terms from the Human Phenotype Ontology (HP) ontology.
Get all ontology terms (owl:Class) from the ABA Adult Mouse Brain (ABA) ontology.
In large ontologies, like SNOMED or Gazetteer (GAZ), getting all the terms with just one query can be problematic. The SPARQL server can produce large resultsets difficult to be parsed in the client side. Pagination with LIMIT and OFFSET is recommended for these cases.
Example of case-insensitive term search in SNOMED
For detailed usage of the globals graph read the Wiki documentation.
Select names and acronyms for all ontologies.
All ontologies sorted by creation date including contact name and number of terms only if these exist (OPTIONAL clause).
List ontology categories.
Ontology domains with number of ontologies per domain.
Get all versions of views from a virtual ontology id.
Find all the ontologies that contain SNOMED in their name (case-sensitive).
Get all distinct predicates from a single ontology.
Example of case-insensitive term with subclass relationship.
Notice that as of January 30th (2013) we are hosting the mappings in a separate endpoint. This eases our regular mapping updates. Programmatic queries that target mapping data need to use the following endpoint: http://sparql.bioontology.org/mappings/sparql
Query that lists all the backend graphs that contain mapping data.
Query to get mapping stats for the Pathway ontology.
Query for mapping data that retrieves target terms from a given source term.