Hi Fermin, and hi all, At the beginning of our implementation, TI Context Broker supported only JSON, and then XML was added. The JSON format implemented in TI CB is strictly related to the XML binding specification, preserving every tag in both formats, in order to have easy interoperability. The XML attributes (as "type" in "entityId" tag) are transformed as a standard JSON field, as shown in the following fragments (and also as assumed in your proposal): XML: <entityId type="urn:username"> <id>urn:username:cristinaF</id> </entityId> JSON: "entityId": { "id": "urn:username:cristinaF", "type": "urn:username" } Here is an example of the same UpdateContextRequest message (sorry for the TI-like example :-) ) in both XML and JSON format: XML: <updateContextRequest> <contextElementList> <contextElement> <entityId type="urn:username"> <id>urn:username:cristinaF</id> </entityId> <contextAttributeList> <contextAttribute> <name>cell</name> <contextValue> <cgi>222-1-61101-7065</cgi> </contextValue> <metadata> <contextMetadata> <name>Timestamp</name> <value>2012-06-13T15:04:52+01:00</value> </contextMetadata> <contextMetadata> <name>Expires</name> <value>2012-06-13T15:04:52+01:00</value> </contextMetadata> <contextMetadata> <name>Source</name> <value>teamlife_1.0</value> </contextMetadata> </metadata> </contextAttribute> </contextAttributeList> </contextElement> </contextElementList> <updateAction>UPDATE</updateAction> </updateContextRequest> JSON: { "updateContextRequest": { "contextElementList": { "contextElement": [ { "entityId": { "id": "urn:username:cristinaF", "type": "urn:username" }, "contextAttributeList": { "contextAttribute": [ { "name": "cell", "metadata": { "contextMetadata": [ { "name": "Timestamp", "value": "2012-06-13T15:04:52+01:00" }, { "name": "Expires", "value": "2012-06-13T15:04:52+01:00" }, { "name": "Source", "value": "TeamLife_1.0" } ] }, "contextValue": { "cgi": "222-1-61101-7065" } } ] } } ] }, "updateAction": "UPDATE" } } Your proposal for JSON binding is more compact, and it would be a great solution if there was no legacy of XML binding, but it is pretty different from the XML binding specification. Specifically, some tags are missing, e.g.: - first external tag identifying the message type (e.g. "updateContextElement") - "entity" in updateContextElement message (there is only "id"/"type"/"isPattern", assuming that they are related to the entity) - tags ending in -List for list of structures. We have also to consider that the XML binding specification was built based on the standard NGSI specification, and the XML messages strictly match the standard NGSI data structures, so it could be a further reason to preserve it also in JSON. It would be interesting to know the opinion of Salvatore and Tobias from NEC, who studied and developed the XML binding. Best regards, Sergio -----Original Message----- From: fiware-ngsi-bounces at lists.fi-ware.eu [mailto:fiware-ngsi-bounces at lists.fi-ware.eu] On Behalf Of Fermín Galán Márquez Sent: martedì 17 settembre 2013 13.23 To: fiware-ngsi at lists.fi-ware.eu Subject: [Fiware-ngsi] JSON rendering proposal Hi, As previously discussed in this list (see https://lists.fi-ware.eu/private/fiware-ngsi/2013-September/000490.html), please find attached TID's proposal for NGSI JSON rendering. We will start this week implementing JSON support in Orion Context Broker based in it. Any feedback is highly welcome! Best regards, ------ Fermín ________________________________ Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo. This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at: http://www.tid.es/ES/PAGINAS/disclaimer.aspx
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy