-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
we should not use "data" to be the key of json #10
Comments
@kunlinyu I'm sorry, but I don't fully understand this explanation.
Q1. What is the difference between "data" and "key" you are describing here?
Q2. Why does it say ID generation? Isn't it just parsing the incoming data? Q3. Also, you gave 2 examples, are you saying that the first approach (using the indexes of the array) is better? I would be grateful if you could answer. |
A1: for example
"Adam" is data, 23 is data, 1.70 is data also. this is a bad example:
this example use "Adam" as key, but "Adam" is data. We should not put data on key. A2: I guess "C1", "C2", "R1", "E1" is kind of ID.
then use an array to wrap them. A3: And, at last, ID can be generated automatically without any declaration for high level coding language. |
https://github.com/opengeospatial/IndoorGML-SWG/blob/27d50895a4365b5bfd8f7f5c5315bbb187fc19ff/IndoorGML2/IndoorGML2-v.0.3/Part%20II/JSON/indoorjson2_dummy.json#L12C18-L12C18
There are some json keys "C1", "C2", "R1", "E1" in it.
I guess it is kind of "id", which is "data", but not "keys".
Think about it, in the parsing programing, we should do something like:
indoorFeatures["layers"][0]["primalSpace"]["cellSpaceMember"][3];
but this is not good:
indoorFeatures["layers"]["TopographicLayer"]["primalSpace"]["cellSpaceMember"]["C1"];
Because different encoder or parser may use different id genaration. Which should nothing to do with standard.
we should never put data in the [ ], but we should put keys in [ ];
And put data in [ ] will make the schema file wired. It is hard to describe it.
The text was updated successfully, but these errors were encountered: