Skip to content

Upload Edit APIs

pgopavar edited this page May 17, 2017 · 4 revisions

Upload

After creating a login, a user can upload their ontologies. Some metadata is required to provide context for the ontology. It is good practice to check that your ontology is well-formed according to W3C rules before uploading. This validation can be performed by first opening your ontology in Protege. Parsing of the ontology in the portal sometimes takes a while, so the ontology is not available immediately.

Edit

The owner of an ontology can change the metadata and upload new versions of their ontology as these become available. Previous versions remain downloadable in OWL format only. Note: The ESIP Semantic Portal is NOT an ontology editor. For creating ontologies, including collaborative editing, see the NCBO Protege tool: http://protege.stanford.edu

API

One can interact with the Semantic Portal using the REST API. Make sure you supply your public key. The REST API uses port number 8080.

API Examples

These code examples require the user to provide their API key.

  1. Listing Ontologies We can use the API to get a list of all the ontologies present in the Semantic Portal. The script is available at https://github.com/ESIPFed/Semantic-Portal/blob/master/api_examples/list_ontologies.py

  2. Obtain all the classes within an Ontology We can use the API to get a list of classes associated with a specific ontology. The script can be found at https://github.com/ESIPFed/Semantic-Portal/blob/master/api_examples/get_labels.py This script requires the user to choose the name of the ontology in the code. Users can modify it to match the acronym of the Ontology they wish to find the classes of.

  3. Classes Search We can use the API to find the ontologies associated with a specific class. The code is available at https://github.com/ESIPFed/Semantic-Portal/blob/master/api_examples/classes_search.py This script also requires the user to change the name of the variable to the class they wish to search for.

  4. Annotate Text We can also use the API to annotate text provided by the user. This tool parses the text provided by the user and obtains the classes present in it along with the relevant ontologies. The script is located at https://github.com/ESIPFed/Semantic-Portal/blob/master/api_examples/annotate_text.py

Clone this wiki locally