Imvertor / Imvertor-Maven

Mavenized version of Imvertor
http://www.imvertor.org
7 stars 12 forks source link

Aankoppelen Kadaster aan Json schema best practices #443

Closed ArjanLoeffen closed 4 months ago

ArjanLoeffen commented 5 months ago

Aankoppelen Kadaster aan Json schema best practices. Volg de Geonovum configuratie.

ArjanLoeffen commented 5 months ago

De koppeling is gemaakt. Er zijn 4 bestanden toegevoegd aan de configuratie.

Aanroepen van de OGC schema generator kan op de volgende manier:

createmimformat = yes
mimformattype = xml
mimformatversion = v2

createjsonschema = yes
jsonschemasource = MIM

createjsonschemavariant = plainjson
#createjsonschemavariant = geojson
#createjsonschemavariant = jsonfg

De laatste twee (nu uitgecommentarieerde) regels geven de mogelijkheid andere configs aan te spreken.

Zie BP document in https://geonovum.github.io/uml2json/document.html

ThiesMesdag commented 5 months ago

Met mijn GDP-CDMKAD krijg ik een fout (jobnr: 2024-02-01-14-38-30-668) :

A sequence of more than one item is not allowed as the first argument of imf:get-type-ref-by-id() ("kadastraalobject-objecttype-kadastraalobject", "historie-objecttype-voorkomen")

ArjanLoeffen commented 5 months ago

Ik kan het reproduceren. Het blijkt dat de fout optreedt bij meervoudige overerving. Ik moet vaststellen hoe dit kan worden gerepresenteerd in de BP. (7.3.3.4. Inheritance)

ArjanLoeffen commented 5 months ago

There was no provision for multiple inheritance yet. I assume the following UML construction: image

Must be processed into Json schema (fragment):

{
  ....
  "$defs" : {
    "Ex1_Objecttype" : {
      "$anchor" : "Ex1_Objecttype",
      "type" : "object",
      "properties" : { }
    },
    "Ex2_Objecttype" : {
      "$anchor" : "Ex2_Objecttype",
      "type" : "object",
      "properties" : { }
    },
    "Ex3_Objecttype" : {
      "$anchor" : "Ex3_Objecttype",
      "allOf" : [ {
        "$ref" : "#/$defs/Ex2_Objecttype"
      }, {
        "$ref" : "#/$defs/Ex1_Objecttype"
      }, {
        "type" : "object",
        "properties" : { }
      } ]
    }
  }
}

NB The static relationship is necessary because most metamodels do not support full multiple inheritance. This is not reflected in Json schemas.

I also submit this to Johannes Echterhoff, who wrote the BP. See https://github.com/Geonovum/shapeChangeTest/issues/57

PalmJanssen commented 4 months ago

Static is the not yet official MIM equivalent of gmlMixin. I do not know if there is a JSON equivalent. However this what the uml2json doc says: https://geonovum.github.io/uml2json/document.html#toc27

ArjanLoeffen commented 4 months ago

Ik zie dat mixin is opgenomen in MIM 1.2: https://docs.geostandaarden.nl/mim/cv-st-mim-20231018/#metagegeven-mixin Dit moet dan worden geïmplementeerd. Kan het worden verwerkt zoals we nu ook <<static>> verwerken, dus via een "copy-down"? Zie ook #444

jechterhoff commented 4 months ago

@ArjanLoeffen Your JSON Schema fragment for the multiple inheritance example looks good to me: Ex3 has allOf the constraints of its supertypes Ex1 and Ex2, in addition to the constraints of its own - e.g. regarding Ex3 properties.

PalmJanssen commented 4 months ago

Ik zie dat mixin is opgenomen in MIM 1.2: https://docs.geostandaarden.nl/mim/cv-st-mim-20231018/#metagegeven-mixin Dit moet dan worden geïmplementeerd. Kan het worden verwerkt zoals we nu ook <<static>> verwerken, dus via een "copy-down"? Zie ook #444

Ja dat is precies hetzelfde.

ThiesMesdag commented 4 months ago

Het probleem lijkt opgelost te zijn. Er zijn nog wel problemen zie #457