Number | HTTP Verb | Path | Description | Body |
---|---|---|---|---|
1 | POST | /ngsi-ld/ws/smartmetropolis | Save a new entity | json-ld representation of the entity |
2 | PUT | /ngsi-ld/ws/smartmetropolis | Update a entity | json-ld representation of the entity |
3 | GET | /ngsi-ld/ws/smartmetropolis/find-by-id?entity-id={entity-id} |
Query a entity with id {entity id} |
|
4 | GET | /ngsi-ld/ws/smartmetropolis?limit={limit} &offset={offset} |
Query multiple entities. The values for limit and offset are optionals. | |
5 | DELETE | /ngsi-ld/ws/smartmetropolis/?entity-id={entity id} |
Delete a entity with id{entity id} |
|
6 | POST | /ngsi-ld/ws/smartmetropolis/property?entity-id={entity id} &property-name={property name} |
Insert a new property in an entity | Json representations of the property. |
7 | PUT | /ngsi-ld/ws/smartmetropolis/property?entity-id={entity id} &property-name={property name} |
Update an property of an entity | Json representation os the property |
8 | GET | /ngsi-ld/ws/smartmetropolis/property?entity-id={entity id} &property-name={property name} |
Query an propterty | |
9 | DELETE | /ngsi-ld/ws/smartmetropolis/property?entity-id={entity id} &property-name={property name} |
Delete an property | |
10 | GET | /ngsi-ld/ws/smartmetropolis/find-by-property-filter?field={elmenent of the property} &operator={operator} &value={value} |
Query entities based on your properties. Suported operators: eq (equal); gt (greather); gte (greather or equal); lt (less); lte (less or equal) | |
11 | POST | /ngsi-ld/ws/smartmetropolis/relationship?entity-id={entity id} relationship-name={relationship name} |
Insert a new relationaship | Json representation of the relationaship |
12 | PUT | /ngsi-ld/ws/smartmetropolis/relationaship?entity-id={entity id} &relationship-name={relationship name} |
Update a relationanship | Json representation of the relationship |
13 | DELETE | /ngsi-ld/ws/smartmetropolis/relationship?entity-id={entity id} &relationship-name={relationnship name} |
Delete a relationship | |
14 | GET | /ngsi-ld/ws/smartmetropolis/relationaship?entity-id={entity id} &relationship-name={relationship name} |
Query a relationnship | |
15 | GET | /ngsi-ld/ws/smartmetropolis/find-by-relationship-filter?field={element of relationaship} &operator={operador} &value={value} |
Query entities based in your relationships. Suported operators: eq (equal) | |
16 | GET | /ngsi-ld/ws/smartmetropolis/find-by-query?query={query} &limit={limit} &offset={offset} |
Query entities based on query | |
17 | POST | /ngsi-ld/ws/smartmetropolis/find-by-document?limit={limit} &offset={offset} |
Query entities based on json document | Json document |
POST
http://localhost:8080/ngsi-ld/ws/smartmetropolis
{
"@context" : [ "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/coreContext/ngsi-ld-core-context.json", "https://github.com/JorgePereiraUFRN/SGEOL-LD/blob/master/ngsi-ld/education/student/Student_Context.jsonld" ],
"id" : "urn:ngsi-ld:aluno:32a72d25-8378-4921-a318-87db41968d73",
"type" : "aluno_test",
"nota_portugues" : {"type":"Property","value":"8"},
"nota_matematica" : {"type":"Property","value":"9"},
"location" : {"type":"GeoProperty","value":{"coordinates":["10","30"],"type":"Point"}},
"escola" : {"type":"Relationship","object":"urn:ngsi-ld:escola:12345567"}
}
PUT
http://localhost:8080/ngsi-ld/ws/smartmetropolis
{
"@context" : [ "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/coreContext/ngsi-ld-core-context.json", "https://github.com/JorgePereiraUFRN/SGEOL-LD/blob/master/ngsi-ld/education/student/Student_Context.jsonld" ],
"id" : "urn:ngsi-ld:aluno:32a72d25-8378-4921-a318-87db41968d73",
"type" : "aluno_test",
"nota_portugues" : {"type":"Property","value":"8"},
"nota_matematica" : {"type":"Property","value":"value1"},
"frequencia_de_aula" : {"type":"Property","value":"95"},
"location" : {"type":"GeoProperty","value":{"coordinates":["10","30"],"type":"Point"}},
"escola" : {"type":"Relationship","object":"urn:ngsi-ld:escola:12345567"}
}
GET
http://localhost:8080/ngsi-ld/ws/smartmetropolis?limit=500&offset=0
{"type":"Property","value":"7.5"}
{"type":"Property","value":"8.5"}
This query returns all students with math scores higher than 9
{"type":"Relationship","object":"urn:ngsi-ld:escola:123455321"}
{"type":"Relationship","object":"urn:ngsi-ld:escola:123459634"}
This query returns students who study at school urn:ngsi-ld:escola:12345567
This query returns students whose math scores are higher than 7 and who study at school urn:ngsi-ld:escola:12345567
POST
http://localhost:8080/sgeol-dm/v2/aluno/find-by-document?limit=2
{ "$or": [{ "properties.attendance.value": { "$gte": 99 } }, { "properties.attendance.value": {
"$lte": 100
}
}]
}