Open sgrellet opened 5 years ago
GeoJSON Feature Base: gml:identifier -> json id (but including path): BSS000AAAA -> https://data.geoscience.fr/id/well/BSS000AAAA JSON "type": "Feature" JSON "geometry": Geometry nested in Feature, in this case eposb:bholeHeadworks//gwml-wellconstruction:collarLocation
XLink Handling: The 2 XML attributes are transformed to a JSON Object as follows
-> "sampledFeature": { "@href": "https://sweet.jpl.nasa.gov/2.3/realmEarthReference.owl#EarthLithosphere", "@title": "Lithosphere" }
dataType and featureType What worries me a bit here is the loss of the namespace. While this will usually be harmless, it can also lead to serious confusion in cases where a type of the same name is available from different namespaces (as unfortunately often the case within the entirety of OGC Data Models!) I'm wondering if we shouldn't do an approach similar to the xlink handling above, instead of just providing the type as a string, providing an object with the type (still string) together with a namespace
XML Attributes vs. Elements Element names are directly adopted, attribute names are utilized together with an @ prefix as done in XPath I'm a bit worried here as to possible overlaps with other meanings of the @ prefix in JSON/IoT. While I believe we're on the safe side, this is something to keep an eye on
"value": when a XML tag also has attributes example :
<eposb:length uom="http://qudt.org/vocab/unit/M">82.0</eposb:length>
becomes
"length": {
"value": 82,
"@uom": "http://qudt.org/vocab/unit/M"
},
but when no attributes -> direct JSON property
<gml:timePosition>2007-05-20T22:00:00Z</gml:timePosition>
becomes
"timePosition": "2007-05-20T22:00:00Z"
time is a simple type, makes sense however, the moment we have multiple values within one type, it becomes a datatype, and to my view should be typed you've started to make exceptions for the common stuff like xlinks and measures, but then we should also leave it out in other places! please look at custodian, tell me at what degree of nesting we should have stopped there, then maybe I can see the difference!
The current translation rules in the code are simple and stay away from any knowledge of specific GML datatypes, they just use a few general patterns based on the information available at the encoding level (which is some typing info, but not the full breath of info available in the schema):
value
<X>PropertyType
or <X>_PropertyType
, contains a single element whose type is X
, then skip the "polka steps" and encode directly the content@typeName
or @dataType
), removing the "Type" suffix at the end (unless it's a complex type with simple content, rule 2)For reference, here is the current output (should be the final version, there are no more changes planned in our activities): https://gist.githubusercontent.com/aaime/d2c1cf46895aad2706ea871bbfa1c96f/raw/238dd828066cf9022493b3e4ca52a9f8a57b5c4d/borehole2.json
add recent adjutement regarding @datatype see https://github.com/INSIDE-information-systems/WFS3/issues/15#issuecomment-490028212
To my understanding, the adjustment mentioned in #15 means that the description above is now correct
@aaime : is the following correct:
@KathiSchleidt about "6" yes that's correct. Eventually we could encode them as a straight object in case the XML schema states the chained feature cannot appear more than once in the output (max multiplicity = 1) and throw an exception if the actual result is more than one (I guess it could be happening depending on what the database query return)
Link to work done under INSPIRE : https://github.com/INSPIRE-MIF/2017.2/blob/master/GeoJSON/geojson-encoding-rule.md. We should compare with their rules
Note: the example GeoJSON provided is not up to date, not aligned with final report (missing @ before dataType and featureType) - should be updated
For reference: OGC Testbed-14 Next Generation APIs: Complex Feature Handling Engineering Report https://docs.opengeospatial.org/per/18-021.html
Sylvain's MindMap Notes:
- simplify the polka steps one level
- Ignore simple types
simpleContent in the slides
- where do we stop on the road down to typing simpletypes ?
- every time max Cardinality is > 1