Dear all, NEC is continuing to analyze & discuss the FIWARE NGSI 2.0 proposal. I update you with new discussion points below in green, keeping the old ones for the sake of tracability. Please feel free to answer to any of the points anytime ☺ Best Tobias [NEC]: For NEC it is important to preserve the possibility to have multiple instances of attribute values. This might not be so important for most of the cases where NGSI is used these days, where entities represent sensors and attributes represent their readings. However, in we expect that in IoT scenarios entities will represent arbitrary objects like rooms, houses, etc. and then there can indeed be several providers of the same attribute values who should be distinguishable. However, we also see that this possibility should not make the life of users difficult who do not care about multiple attribute value instances because in their scenarios this does not play a role. Therefore our proposal is that NGSI systems treat attribute values with no given ID as having a specific “null” ID. By this, the value ID possibility can be completely ignored by scenarios where it is not needed, while the NGSI standard still offers the possibility to have multiple values. --- [TJ] The NGSI v2 proposal is very rich and there will be many different things to discuss or clarify. I am not sure what is the best “format” for the discussion, but let me start in this email with a few points (most of them questions). We are not done yet analyzing the complete proposal and more discussions will follow. [FGM1] Email discussions are perfectly ok. Other alternative ways to provide feedback would be issues in github.com and even pull request suggesting modification to the specification or cookbook .apib files (.apib files at https://github.com/telefonicaid/fiware-orion/tree/develop/doc/apiary/v2 are the "source code" for Apiary web at http://telefonicaid.github.io/fiware-orion/api/v2/ and http://telefonicaid.github.io/fiware-orion/api/v2/cookbook) (If you are not familiar with the pull request way of working in github.com, please tell me and we try to provide an introduction). [TJ] OK; I think I prefer at the moment the email format for the basic discussions, and when it comes to the subtle details we can consider moving to pull requests. [Personally I am also not so well aware yet on how this works, but I have colleagues who can help me ☺] --- 1) “flat” JSON message: In general NEC agrees to reserve “id”, “type”, “value” to have special semantics. Even if this means that entities can have no attributes called “id”, “type” or “value” Alternatively (and for maybe making the descriptions easier to understand) we might think about calling “id”, “type”, “value” special attributes with special semantics; some being mandatory (e.g. “id” is mandatory in entities). --- 2) Predefined value types: in general NEC supports to have predefined types in order to improve interoperability --- 3) JSON types as predefined value types: We understand that a JSON property whose value is not a JSON object (and thus has no explicitly stated type) is implicitly either of type “number”, “string” or “boolean”, depending on the type of the JSON property. So for example "temperature": 32.5 would be implicitly of type “number”. [FGM2] Yes, that's the idea. I would recommend you to have a new look to the specification, as we have merged some changes this morning that (we hope) make this idea clearer. (The diff of the newest changes is at https://github.com/telefonicaid/fiware-orion/pull/1042/files in the case you prefer to see only the modifications) [TJ] It seems in the newest version that you removed the “implicit” types number, boolean and string, so that every attribute value now needs to be a JSON object. Is this correct? --- 4) Further predefined value types: We also understand that there will be further predefined types like for example “geo:point”. But we believe that attribute values having this kind of type will still need to be a JSON object with explicitly stated “type” property, because otherwise e.g. one cannot distinguish a “date” value from a “string” value. This would mean that the example "timestamp": "2017-06-17T07:21:24.238Z" is incorrect and would instead have to look like “timestamp”:{ “value”: "2017-06-17T07:21:24.238Z" “type”: date } [FGM3] In the new version of the spec, there are only two special NGSI types ("date" and "geo:point"), both associated to the JSON string type. I think it works in the way you suggest here, but a double checking the new version of the spec to get your feedback would be great. [TJ] Yes, in the new versions the values are objects with explicitly given types. --- 5) Further predefined value types: We assume that some predefined value types can refer to specific JSON object formats, not only to specific string formats. [FGM4] It could be so from a theoretical point of view. However, by the moment, the only two special types we have found make sense are "date" and "geo:point", both associated to JSON string. Maybe you have some other case in mind? [TJ] I do not have a specific example in my mind at the moment, so it is indeed more a theoretical consideration. I imagine that for the sake of interoperability specific domains could publish something like a catalogue of their entity types and the format of the values they are using. [TJ] Probably we should first discuss what other predefined value types we want to have (if any), and only then discuss whether some of them should rather be JSON objects than specific string formats. --- 6) User-defined types: It is currently written that “The values of user-defined informative types are represented by JSON string”, but we believe that user-defined types should be representable by numbers, Booleans and JSON objects as well. [FGM5] This has changed in the new version of the spec and I guess now works in the way you suggest. Now, NGSI type and JSON type are "orthogonal" aspects on the attribute. [TJ] OK, I read that even arrays would be allowed. Makes sense to me. --- 7) Error format: Currently an error code is not specified. Is this because it is intended to use the status code in the HTTP header instead? Can this lead to conflicts between standard HTTP error codes (e.g. 404 resource not found) and NGSI error codes (eg. 404 context element not found)? [FGM6] Exactly. The idea is to use HTTP status code for the numeric error code, so no conflict should occur. Note that one of the criticized aspects in NGSI v1 is not using HTTP code to convey the error code, as this is not the common way of working in RESTful APIs. E.g. this would be a "not found" error response in NGSIv2: HTTP/1.1 404 Not Found Content-Length: 95 Content-Type: application/json Date: ... { "error": "NotFound", "description": "The requested entity has not been found. Check type and id" } --- [TJ] I need to further discuss with my colleagues about this before agreeing or proposing an alternative. One concern is that not having the status code in the response message forces applications to also look into the response header, which is not always convenient. 8) API entry point In general NEC agrees to make this resource somehow an overview of the main API urls. Would you make the format if this link list predefined, or would you leave the specific format to the API developer? [FGM7] I think Jose Manuel could answer this better than me. --- 9) 10) Pagination: In principle NEC supports the concept of pagination. However we are not sure how it can be realized in practice, as query results are dynamic (especially when getting the queried data live from a distributed system like IoT systems do). What the user probably expects is that the query results are “frozen” for him and then delivered page by page. But then something like a query ID is needed to collect the query results. Alternatively the query result could be represented by a specific http resource (which is similar to a query id). In both cases things become slightly more complex… Do you have a proposal how to deal with that issue? [FGM8] Frozen the query at NGSI server implementation could have an important performance impact (as the frozen results would need to be maintained in memory from an undefined amount of time while the client gets all the result) and would make NGSI sever implementation stateful, which is very bad from the point of view of HA and horizontal scaling. Some ordering criteria may alleviate the problem In particular, entity creation date, which ensures that any new entity have to be put at the end. However, even in this case, there could be some problems if an entity already seen page is deleted (as it would introduce a shift in the next pages). Thus, the solution based on limit/offset is not perfect, but may suffice most of the cases and have a good simplicity tradeoff. So, it is probably "the best of the worse" solution. But this point is still opened. [TJ] I understand the scalability aspect. On the other hand, NGSI systems who do not have the information ready in a database but need to assemble it from various sources anyway somehow have to cache the query result when it is retrieved page by page, as otherwise they would have to run the same queries on the subsystem again and again. From this point of view the question is whether clients should have separate control on data generation and on data retrieval, or if this difference should be transparent to applications. To be discussed. --- -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.fiware.org/private/fiware-ngsi/attachments/20150703/01b1052d/attachment.html>
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy