You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

These web services use a JSON exchange format (ei-x) to allow external parties to create and update resources in an eagle-i repository. They are currently deployed in the development server:

http://montana.dev.eagle-i.net

Knowsn issues:

  • authentication is still to be implemented (this very first pass uses no authentication). This will most likely be HTTP BasicAuth over HTTPS
  •  

The ei-x JSON request and response formats

ei-x is comprised of two classes:

EIExchangeInstance --  a simplified container for the RDF of an eagle-i resource *and* minimal information of directly  linked resources -- also referred to as primary resource and secondary resources. Information for secondary resources includes *only* text properties (i.e. no tertiary resources!)

InstanceUpdateResponse -- encapsulates the status of requested updates

Browse the Java code from which these are serialized: 

https://open.med.harvard.edu/svn/eagle-i-dev/apps/trunk/datatools/catalyst/src/main/java/org/eaglei/datatools/services/

EIExchangeInstance field descriptions:

instanceEntity -- EIEntity

A container for the primary resource's EIURI and Label; when requesting creation of a new resource, The ID field of the EIURI should be empty, in which case the 

specificTypeUri -- EIURI

The most specific ontology type assigned to the resource. The type EIURI can be obtained from the ontology browser (grab it from the URL bar), e.g. DNA Sequencer: http://purl.obolibrary.org/obo/OBI_0400103

rootType -- EIURI

The root type of the resource (one of the eagle-i Primary Types), e.g. Instrument: http://purl.obolibrary.org/obo/ERO_0000004

foreignKey -- String

A string that uniquely identifies the resource in its external location (format determined by the source)

source -- String

A string that uniquely identifies the source of the resource (format TBD)

linkedResources -- Map<String, EIExchangeInstance>

A map that contains minimal information of secondary resources. It is keyed on the URI of the ontology property that associates the secondary resource to the primary resource (the URI is a String and not an EIURI, as complex map keys are not well supported by GSON)

textProperties -- Map<String, String>

A map that contains the value of text properties, keyed on the URI of the ontology property used to capture them.

InstanceUpdateResponse field descriptions

All these maps are keyed on the resource's (primary or secondary) eagle-i URI.

newlyCreatedUriToForeignKey -- Map<String, String>

updatedUriToForeignKey -- Map<String, String>

failures -- Map<String, String> 

Obtain an ei-x representation of a resource

URL:

 /sweet/api/externalResource

Method:

GET 

Args:

uri  -- the eagle-i identifier of the resource

pretty -- true | false, return prettified JSON (useful for debugging)

Example:

http://montana.dev.eagle-i.net/sweet/api/externalResource?uri=http://montana.dev.eagle-i.net/i/0000012f-989d-df6c-b822-788380000000

Result:

resource information in ei-exf

Create or update a resource in eagle-i

  • No labels