The read entity operation returns property values for an entity in a Context Graph model.
HTTP GET URL Format
The request is specified as follows. The Spectrum server supports both HTTP and HTTPS.
GET http://server_name:port/rest/ContextGraph/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 an existing entity in the model.
Return codes
The operation returns the status code "200 OK" when it is successful. The operation returns the status code 500 (Error) when it fails.
Response
The response returns a name-value pair for each entity property in the following format. Note that numeric values are not enclosed between quotation marks.
{
"result":{
"property":value,
"property":value,
...
"property":value
}}
JSON response
The following request reads properties from the "Place" entity type in the "911" model with the label "FlightSafety International".
GET http://localhost:8080/rest/ContextGraph/operations/911/entities/Place/FlightSafety%20International
This results in the following response:
{"result":{
"Latitude":"27.6386433",
"Location":"Vero Beach, Florida",
"Longitude":"-80.39727",
"Place":"FlightSafety International",
"Date":1275782400000
}}