INSPIRE-MIF / gp-geopackage-encodings

Good practice for GeoPackage encodings of INSPIRE datasets
7 stars 4 forks source link

[END] Encoding of complex data types that actually can be identified uniquely #15

Open heidivanparys opened 3 years ago

heidivanparys commented 3 years ago

Data types such as SimpleCitation, LegislationCitation and RelatedParty are special data types in the sense that somewhere, outside INSPIRE, instances with a unique identifier corresponding to those data type instances exists, their management is simply outside the scope of INSPIRE.

Example: if we refer to the Noise Directive from within an INSPIRE data model, data type LegislationCitation will be used, but in the system behind EUR-Lex, directives are definitely seen as having identity (it has ELI identifier https://eur-lex.europa.eu/eli/dir/2002/49/oj and would thus be modelled as a UML class. The same goes for national legislation.

Depending on whether the attribute using this data type is voidable or not, the encoding seems to be different.

image

So you could end up in a situation that SimpleCitation is flattened into columns in AbcVoidables when it is voidable and is encoded as a separate table when it is not voidable.

I would suggest creating separate tables for RelatedParty and LegislationCitation, and have a column in AbcVoidables referring to that.

CREATE TABLE "abc_voidables" (
  "competentauthority" INTEGER,
  "legalbasis" INTEGER
  -- ...
);
CREATE TABLE "relatedparty" (
  "contact" TEXT,
  "individualname" TEXT,
  "organisationname" TEXT,
  "positionname" TEXT,
  "role" TEXT
  -- ...
);
CREATE TABLE "legislationcitation" (
  "level" TEXT,
  "link" TEXT
  -- ...
);

instead of

CREATE TABLE "AbcVoidables" (
  "competentAuthority_contact" TEXT,
  "competentAuthority_indivName" TEXT,
  "competentAuthority_orgName" TEXT,
  "competentAuthority_posName" TEXT,
  "competentAuthority_role" TEXT,
  "legalBasis_link" TEXT,
  "legalBasis_level" TEXT,
    -- ...
);
thorsten-reitz commented 3 years ago

Results of the discussion on 30.06.2021: