Create Entity Operation

The create entity operation adds a new entity to a Context Graph model. The entity metadata must already exist in the Context Graph model.

HTTP PUT URL Format

The request is specified as follows. The Spectrum server supports both HTTP and HTTPS.

PUT http://server_name:port/rest/DataHub/operations/modelName/entities/entityType/entityLabel

URL Path Elements

modelName
The name of the Context Graph model.
entityType
An entity type defined in the model
entityLabel
The label for the new entity.

URL PUT Body Format

Content-Type:application/json {Property Name-Value Pairs}

Optionally, you can specify a property name and value pair for any existing property in the following format. A property is not created if it is omitted or contains a null or empty value. The property name pairs are formatted as follows:

{
    "Property1":"Value1",
    "Property2":"Value2",
    ...
}

Response

The operation returns the status code "200 OK" when it is successful. The operation returns the status code 500 (Error) when it fails.

Create entity with JSON response

The following request creates a "Place" entity type in the "911" model with the label "FlightSafety International" and adds the following properties: "Latitude", "Location", "Longitude", and "Place".

PUT http://localhost:8080/rest/DataHub/operations/911/entities/Place/FlightSafety%20International

Body:

{
    "Latitude":"27.6386433",
    "Location":"Vero Beach, Florida",
    "Longitude":"-80.39727",
    "Place":"FlightSafety International",
    "Date":1275782400000
}
            
Note: Date, time, and date-time property values are UNIX Epoch time values formatted as long data type in both requests and responses.

Response:

{
"success":"200 OK"
}