-
Notifications
You must be signed in to change notification settings - Fork 20
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
GML encoding of code lists #56
Comments
The NGA maintains a registry of codelists designed for run-time access from GML documents. It is located at https://nsgreg.nga.mil/voc/registers.jsp?register=CDV. The intent of this register is to remove the codelist values from the data model, managing them as a separate resource. Codelist values are identified in a GML document through a URI. That URI consists of the URI for the register, followed by the codelist name, followed by the codelist value. An advantage of this approach is that the codelist value is resolvable to a definition of that value. |
The European Commission's INSPIRE Code Lists are managed at https://inspire.ec.europa.eu/codelist towards a similar (the same?) result. The preferred approach from the GML documents is an encoding like this: Where the URI goes "straight to" the required code list value; the xlink:title provides a utility value for those parsers who do not want to dereference the URI. (Some schemas allow the element to also have text content carrying a national translation of the code list value). The definition can be retrieved in various formats by dereferencing the URI. |
@PeterParslow The registers are comparable. The difference is how the code list values are encoded. While INSPIRE uses xlinks, NGA uses |
@cmheazel : I have to ask "which ISO schemas?" |
Sorry for dropping the ball on codelists. Even though I was tied up in another SWG at the time, I did do some prototyping for the 21 October meeting. My suggestion was for
|
All code list values are encoded using I think this approach is very flexible and lightweight as we can neither manage nor define a global registry for all CityGML users and use cases. And, it is very in line with how CityGML 2.0 and 1.0 work. |
I have made some progress in prototyping this, using some 2.0 codelists as a starting point. |
I am also happy with Claus' comment. See you soon. |
Thanks for your thoughts, @3DXScape. I would welcome having a third predefined JSON encoding. |
In our web meeting on 18 November 2021 we discussed that each code list should have the following metadata information
GML does not provide a content model for the metadata. We need to define our own UML class with the required metadata attributes and encode it in XML to be able to add the metadata to the GML code lists. Furthermore, we discussed that we do not intend to specify the encoding of code lists in a normative way. We will try to provide non-empty code lists for all code lists defined in the conceptual model. These code lists will only serve as examples, they will not provide exhaustive lists of possible code list values. These code lists may be used by others, but everybody is still free to create their own code lists. Setting up a registry for the code lists and defining a REST API to access the code list values are tasks that our group cannot deal with as part of the GML encoding specification. |
The results from the web meeting on 15 December 2021. Metadata for code lists We discussed the following slides on the encoding of the metadata information that is to be provided with each code list: https://github.com/opengeospatial/CityGML-3.0Encodings/blob/master/CityGML/Encoding%20Rules/Metadata%20for%20code%20lists.pdf We agreed on making use of option 2, i.e. providing our own container element for the metadata information. The XML schema for the metadata is available here: Code list structure We agreed on the following CityGML 3.0 codelist structure: <gml:Dictionary gml:id="roofTypes">
<gml:metaDataProperty>
<cmd:CodeListMetaData>
<cmd:dataType>RoofTypeValue</cmd:dataType>
<cmd:namespace>http://www.opengis.net/citygml/building/3.0</cmd:namespace>
<cmd:language>en</cmd:language>
<cmd:authority>xyz</cmd:authority>
<cmd:version>1.0</cmd:version>
<cmd:CodeListMetaData>
</gml:metaDataProperty>
<gml:description>Roof type values</gml:description>
<gml:identifier codeSpace="https://ogc.org/citygml/3.0/codelists/gml/rooftypes">RoofTypeValue</gml:identifier>
<gml:dictionaryEntry>
<gml:Definition gml:id="id1">
<gml:description>roof primarily a single plane, not necessarily level</gml:description>
<gml:identifier codeSpace="https://ogc.org/citygml/3.0/codelists/gml/rooftypes">1000</gml:identifier>
<gml:name>flat roof</gml:name>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry>
<gml:Definition gml:id="id2">
<gml:description>a roof that has a ridge and two gables</gml:description>
<gml:identifier codeSpace="https://ogc.org/citygml/3.0/codelists/gml/rooftypes">3100</gml:identifier>
<gml:name>saddle roof</gml:name>
</gml:Definition>
</gml:dictionaryEntry>
</gml:Dictionary> For the individual code list entries we defined the following:
|
@3DXScape I had a look at the chapter on ADEs and have some comments and questions.
Regarding the metadata elements:
I noted down several things from the meeting where we discussed code lists. Would it make sense to provide these things as recommencations?
The CSV example is completely different from what @thomashkolbe and I suggested some time ago. |
I will realign the chapter as you describe. We should review the results at the next meeting. |
Good point. I ignored the details of the discussion. I originally wanted an XML encoding not tied to external schemas. I will use the GML Dictionary as it is in 3.2.1.
No. It was intended to be informative for consumers of our example codelists. Most real world codelists defined by government agencies or other communities will not follow our choice.
See above for the reason. I am happy to explicitly use the gml:Dictionary structure.
I do not see a difference between a "code" value and a "text" value. Again, I have no problem using the name field and the description field for essentially the same purpose if it aligns better.
Will change.
Yes.
Yes.
I think it makes sense to just make the name element optional. An identifier can be opaque even it is not a number. I think the discussion was that a name is only helpful if the identifier is some opaque value, such as a number. My opinion is that the description is the best place to explain opaque codes. I will agree with having an optional name, since we have legacy codelist entries with both codes and names.
OK. |
Do we intend to include anything about how we recommend/expect the code lists to be referenced? gml:CodeType in GML 3.2.1 and 3.2.2 primarily expects e.g. <gml:name codeSpace = “http://www.ukusa.gov/placenames”>St Paul</gml:name>, but the codeSpace is optional. Should we say (somewhere!) that codeSpace is required? GML3.3 then deprecates this ("The use of CodeType to reference code list entries is deprecated" which has always been slightly odd in an 'extension'!) So in that sense, the CityGML schemas do not conform to CityGML 3.3. |
Good point. I see that most (all?) of the examples in the repo and in the document do not have a codeSpace attribute. The attribute seems logically necessary in order to interpret or validate the code value. One way to solve the GML issues is to change the mapping of CodeList stereotyped types from GML:CodeType. to the Core type "Code", which is in the CM and seems to be a clone of CodeType but not in the GML namespace. (Maybe I am missing something in the history of Code??) Optionality would still be still an issue. We add a requirement that restricts the allowed multiplicity to 1 or to 1..* That would support testing whether a codelist value was indeed valid in the specified codelist. It might also give access to other information specific to an external codelist that might enhance the user experience, e.g. plaintext alias or description for the code values- all outside the scope of our standard. The downside of removing optionality would be breaking of backwards compatibility. |
"We add a requirement that restricts the allowed multiplicity to 1 or to 1..*" - better be "1", because XML doesn't allow an element to have more than one attribute with the same name, so an element of type gml:CodeType can't reference more than one codeSpace. |
The downside of making the XML attribute A (possibly undocumented?) idea of CityGML 2.0 is that you can simply store a clear-text string as value of a |
I agree with Claus' comment. |
That is two votes for leaving the codeSpace attribute optional. If we do that, then we should give some more definition to the use of the attribute when it is present. Here's my suggestion:
|
This suggestion looks good to me! |
I think it would be helpful to include something in the note about the benefit to users of having the codeSpace attribute populated, such as: "Providing the codeSpace, especially when you use a dereferenceable identifier, should allows the user easy access to further information about the value such as more detail about what it means." |
Incorporating that suggestion and tidying up the language a bit:
|
The language of my previous text, that is! |
I like the text. |
Also looks good to me. Thanks, @3DXScape and @PeterParslow |
A question about Claus' comment April 9: since the gml:CodeType codeSpace attribute is optional can we have the requirements:
This seems necessary to me since an gml:CodeType value that does not occur in a codelist referenced via a codeSpace attribute seems pointless. |
In the meeting on 21 October 2021 we discussed the GML encoding of code lists.
The code lists should be kept simple, i.e. they should only contain codes with associated code descriptions.
In addition, metadata information should be added to the code lists, in particular metadata attributes for the language of the code list, the CityGML data type to which the code list refers and the CityGML version.
-> This information is enough to allow for providing code lists for the same data type in different languages. These language specific code lists contain the same codes, but the descriptions are provided in different languages.
-> In this way, by means of the metadata information also the code lists in other languages can be identified, even if the CityGML file refers to a code list in a specific language only.
The code lists are to be represented using GML 3.2.1 dictionaries.
-> Metadata information can be added to the dictionaries by means of a <gml:metaDataProperty> element.
-> The <gml:identifier> element can be used for the code.
-> the <gml:name> element can be used for the description, also in different languages as the element has multiplicity "unbounded".
We also discussed about providing a CSV encoding in addition.
The CSV files should contain three columns.
The first column indicates whether the row contains a code or metadata.
The second column contains the code or name of the metadata attribute.
The third column contains the code description or the metadata value.
-> When a code value in a CityGML instance links to an external code list, the encoding of the external code list can be determined based on the suffix .gml or .csv.
-> The code lists could then simply be managed using Excel.
Homework tasks:
The text was updated successfully, but these errors were encountered: