Difference between revisions of "RDF in BioPortal"
m (→Sample Queries) |
m (→SPARQL Endpoint: added check tags) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 26: | Line 26: | ||
There are two ways to access the RDF content that we generate for BioPortal ontologies and their terms: | There are two ways to access the RDF content that we generate for BioPortal ontologies and their terms: | ||
− | # Use the [[#SPARQL_Endpoint | SPARQL Endpoint]] | + | # Use the [[#SPARQL_Endpoint | SPARQL Endpoint]]. |
− | # Use the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services#RDF_Term_Service RDF Term Service] to get an RDF snippet for a single term or several terms and the | + | # Use the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services#RDF_Term_Service RDF Term Service] to get an RDF snippet for a single term or several terms and the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services#RDF_Download_Service RDF Download Service] to download the whole ontology in RDF. Note that the second service will provide only some basic information about each term, not all the relations that are defined in the ontology. |
− | [http://www.bioontology.org/wiki/index.php/NCBO_REST_services#RDF_Download_Service RDF Download Service] to download the whole ontology in RDF. Note that the second service will provide only some basic information about each term, not all the relations that are defined in the ontology. | ||
= Content of the RDF graph = | = Content of the RDF graph = | ||
Line 53: | Line 52: | ||
The BioPortal [http://sparql.bioontology.org SPARQL Endpoint] currently uses the [http://www.mulgara.org Mulgara] RDF store. For more information, please see the [http://www.mulgara.org/trac/wiki Mulgara documentation]. | The BioPortal [http://sparql.bioontology.org SPARQL Endpoint] currently uses the [http://www.mulgara.org Mulgara] RDF store. For more information, please see the [http://www.mulgara.org/trac/wiki Mulgara documentation]. | ||
+ | <small style="font-size:10%; color:lightgray">√Link √Info</small> | ||
== Sample Queries == | == Sample Queries == | ||
Line 58: | Line 58: | ||
=== List all named graphs === | === List all named graphs === | ||
− | + | For every BioPortal ontology, list its named graph, display label, version id, virtual id and format. | |
Graph URI: | Graph URI: | ||
Line 79: | Line 79: | ||
=== Filter for a specific object === | === Filter for a specific object === | ||
− | Graph URI: | + | For the NEMO ontology, filter for the object having string "ERP_spatiotemporal_pattern." |
+ | |||
+ | Graph URI (e.g., NEMO): | ||
<pre> | <pre> | ||
http://purl.bioontology.org/virtual/rdf/download/1321.rdf | http://purl.bioontology.org/virtual/rdf/download/1321.rdf | ||
Line 95: | Line 97: | ||
=== List all triples === | === List all triples === | ||
− | Graph URI: | + | For the NEMO ontology, list all subject-property-object triples. |
+ | |||
+ | Graph URI (e.g., NEMO): | ||
<pre> | <pre> | ||
http://purl.bioontology.org/virtual/rdf/download/1321.rdf | http://purl.bioontology.org/virtual/rdf/download/1321.rdf | ||
Line 108: | Line 112: | ||
=== List all subclass relationships === | === List all subclass relationships === | ||
− | Graph URI: | + | For the NEMO ontology, list only the subclass properties, i.e., the child-parent relationships. |
+ | |||
+ | Graph URI (e.g., NEMO): | ||
<pre> | <pre> | ||
http://purl.bioontology.org/virtual/rdf/download/1321.rdf | http://purl.bioontology.org/virtual/rdf/download/1321.rdf | ||
Line 121: | Line 127: | ||
=== List properties of each class === | === List properties of each class === | ||
− | Graph URI: | + | For the NEMO ontology, filter by class identifiers and list each property of the class. |
+ | |||
+ | Graph URI (e.g., NEMO): | ||
<pre> | <pre> | ||
http://purl.bioontology.org/virtual/rdf/download/1321.rdf | http://purl.bioontology.org/virtual/rdf/download/1321.rdf |
Latest revision as of 21:07, 9 July 2016
This page describes representation of ontologies in the NCBO BioPortal and individual classes in these ontologies in RDF. Please send comments and questions to support@bioontology.org.
You can access RDF graphs for all BioPortal ontologies at our prototype SPARQL endpoint.
Goals for generating RDF for BioPortal content
We had the following goals in generating RDF for BioPortal:
- Provide RDF for each class in BioPortal so that we can have a URL to a concept that resolves to a set of RDF triples that provide essential information about the term.
- Provide an RDF dump of each ontology in BioPortal to put them in a tripelstore to enable SPARQL access to the ontologies.
Our goal was not to provide an RDF graph that covers the complete content of each ontology. Rather, we wanted to provide uniform RDF format for all the terms from the ontologies that were originally developed in different formats.
Providing URIs
In order to have an RDF graph for each term, we must have an http URI for the term. We used the following approach to determine the URIs for the terms for ontologies in different formats:
- OWL and RDF ontologies: these ontologies already have http URIs for each resource that they define. We used the URIs provided by ontology authors.
- OBO ontologies: terms in the ontologies in the OBO format do not have http URIs. We used the same URIs that the OBO library uses for these terms
- http://purl.obolibrary.org/obo/IDSPACE_LOCALID
- For example: http://purl.obolibrary.org/obo/GO_0050918
- RRF and Protégé ontologies: terms in these ontologies do not have http URIs. We generate the URIs in the following form for these terms:
- http://purl.bioontology.org/ontology/{Acronym}/{ID}
Accessing RDF content
There are two ways to access the RDF content that we generate for BioPortal ontologies and their terms:
- Use the SPARQL Endpoint.
- Use the RDF Term Service to get an RDF snippet for a single term or several terms and the RDF Download Service to download the whole ontology in RDF. Note that the second service will provide only some basic information about each term, not all the relations that are defined in the ontology.
Content of the RDF graph
For each term in BioPortal, we provide the following information in the RDF graph:
- id (including the original id, using skos:notation)
- preferred name
- synonyms
- superclasses (for OWL, Protege, and OBO)
- skos:broader for terms from RRF ontologies
- CUI, TUI and UMLS code for RRF ontologies
We also use the BioPortal Metadata Ontology to represent the following information about the ontology being described by the RDF:
- id (i.e., BioPortal version id)
- name (i.e., display label)
- acronym (i.e., abbreviation)
- ontology language (i.e., format such as OBO, OWL or RRF)
- description
- URI (the persistent URL or purl)
SPARQL Endpoint
The BioPortal SPARQL Endpoint currently uses the Mulgara RDF store. For more information, please see the Mulgara documentation. √Link √Info
Sample Queries
Using the SPARQL Endpoint WebUI, paste the following queries into the appropriate text box and press "Submit Query." For several of the examples below, we use the NEMO ontology as an example. Using the "List all named graphs" query example, please find the named graph for your ontology of interest and substitute appropriately.
List all named graphs
For every BioPortal ontology, list its named graph, display label, version id, virtual id and format.
Graph URI:
sys:default
Query Text:
SELECT ?graphURI ?label ?versionId ?virtualId ?format WHERE { GRAPH ?graphURI { ?s <http://purl.bioontology.org/ontology/bioportal/displayLabel> ?label . ?s <http://purl.bioontology.org/ontology/bioportal/id> ?versionId . ?s <http://purl.bioontology.org/ontology/bioportal/ontologyId> ?virtualId . ?s <http://purl.bioontology.org/ontology/bioportal/format> ?format } }
Filter for a specific object
For the NEMO ontology, filter for the object having string "ERP_spatiotemporal_pattern."
Graph URI (e.g., NEMO):
http://purl.bioontology.org/virtual/rdf/download/1321.rdf
Query Text:
SELECT ?subject ?property ?object FROM <http://purl.bioontology.org/virtual/rdf/download/1321.rdf> WHERE { ?subject ?property ?object FILTER regex(?object, "ERP_spatiotemporal_pattern", "i") }
List all triples
For the NEMO ontology, list all subject-property-object triples.
Graph URI (e.g., NEMO):
http://purl.bioontology.org/virtual/rdf/download/1321.rdf
Query Text:
SELECT ?subject ?property ?object FROM <http://purl.bioontology.org/virtual/rdf/download/1321.rdf> WHERE {?subject ?property ?object}
List all subclass relationships
For the NEMO ontology, list only the subclass properties, i.e., the child-parent relationships.
Graph URI (e.g., NEMO):
http://purl.bioontology.org/virtual/rdf/download/1321.rdf
Query Text:
SELECT ?child ?parent FROM <http://purl.bioontology.org/virtual/rdf/download/1321.rdf> WHERE {?child <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?parent}
List properties of each class
For the NEMO ontology, filter by class identifiers and list each property of the class.
Graph URI (e.g., NEMO):
http://purl.bioontology.org/virtual/rdf/download/1321.rdf
Query Text:
SELECT ?s ?p ?o FROM <http://purl.bioontology.org/virtual/rdf/download/1321.rdf> WHERE { { ?ontoid <http://purl.bioontology.org/ontology/bioportal/displayLabel> ?label FILTER regex(?label, "Neural ElectroMagnetic Ontologies", "i") . ?s <http://www.w3.org/2004/02/skos/core#notation> ?classid FILTER regex(?classid, "NEMO_0") . ?s ?p ?o } }