Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We are proposing to use JSON Schema 03 to define both an Entity and the Annotations of an Entitytype. The JSON Schema breaks an object definition into two major categories; properties and additional properties.

...

Initially we were planning to use "additinalProperties" to define the Annotations of a Synapse Entity, but this raised a fundamental issue. If the Annotations of an entity are provided for ad-hock user data, then formally defining them in the entity schema for all instances of a type seems like a poor fit. That said, we still have many use cases where we want to constrain the data of an annotation when they are added to an instance of an entity. Therefore, we are positioning that these annotation types are set on a per-instances basis rather than at the entity type definitionschema level. Annotation types are covered in a separate document: Proposal for Annotation Types

...

Code Block
/lib-auto-generated/src/main/resource/org/sagebionetworks/annotation/types/BioOntologyTissueTypeVertebrateOrganType.json

Before we look at the definition of our Example.json let's first look at the definition of our new BioOntologyTissueTypeVertebrateOrganType.json. For this example we want to use an external the Basic Vertebrate Anatomy ontology to control define the valid values for Organs:
BioOntologyTissueTypeVertebrateOrganType.json

Code Block
{
        "type":"string",
	"format":"uri",
	"enum":["NCBOXQUERY":"
		SELECT fullId FROM doc(http://rest.bioontology.org/bioportal/concepts/4531?conceptid=tbio:Organ&ligthlight=1&apikey=2fb9306a-7f3f-477a-821e-e3ccd7356a18
	"]
)/success/data/classBean/relations/entry[string=Subclass]/list/classBean/fullId
	"]
   }

In this example, we can see that we expect the enumeration values to be URI strings limited to the values returned from a SPARQL query. In this case, the SPARQL query translates to the following:

...

are defined by an XQuery that is used to get the "fullId" (URIs) of all Sub-classes of the Term "Organ" using the XML returned from NCBO's BioPortal Term services. Here is the XML returned by the term service for this exampl: http://rest.bioontology.org/bioportal/concepts/4531?conceptid=tbio:Organ&light=1&apikey=2fb9306a-7f3f-477a-821e-e3ccd7356a18.

Now that we have defined an Annotation Type for Tissue's defined by the http://purl.bioontology.org/ ontology, we can now use this type to define an Organ using the ontology we can use this type in the definition of the entity.
Here is our definition of our example Entity:
Example.json

...