Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Introduction

The most of the basic objects that Synapse currently supports are Entities. Each Entity has first class data that makes up the fields of an entity. All Entities also have Annotations that store additional data about an entity.

...

Before we look at the definition of our Example.json let's first look at the definition of our new BioOntologyTissueType.json. For this example we want to use an external ontology to control the valid values for
BioOntologyTissueType.json

Code Block

  
{
        "type":"string",
	"format":"uri",
	"enum":["SPARQL":"
		PREFIX abc: <http://purl.bioontology.org/ontology/MCCL#>
		SELECT ?uri
		WHERE {
  			?y abc:FullId ?uri ;
     			abc:isA abc:/FMA_9637 .
		}
	"]
   }

...

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 entity.
Here is our definition of our example Entity:
Example.json

Code Block

  
{
     "extends":"org/sagebionetworks/entity/type/Entity.json"
     "name":"Product",
     "properties":{
       "id":{
         "type":"number",
         "description":"Example identifier",
         "required":true
       },
       "name":{
         "description":"Name of the Example",
         "type":"string",
         "required":true
       },
     },
     "additionalProperties":{
	"tissue":{
	"type":"object",
	"$ref":"org/sagebionetworks/annotation/types/BioOntologyTissueType.json"
       }
     }
   }

...