Skip to content

DatasetMetadata: express reused-term class linkage with schema:domainIncludes (fixes #92) - #99

Open
Haigutus wants to merge 1 commit into
entsoe:mainfrom
Haigutus:fix/datasetmetadata-domainincludes
Open

DatasetMetadata: express reused-term class linkage with schema:domainIncludes (fixes #92)#99
Haigutus wants to merge 1 commit into
entsoe:mainfrom
Haigutus:fix/datasetmetadata-domainincludes

Conversation

@Haigutus

Copy link
Copy Markdown

Fixes #92 — implements the schema:domainIncludes convention discussed in that thread.

What

In NCP/RDFS/DatasetMetadata-AP-Voc-RDFS2020.rdf, the class↔attribute linkage of reused external terms (dcterms:, prov:, dcat:, adms:, RDF reification) is now expressed with the non-inferential schema:domainIncludes instead of rdfs:domain; CIM-owned terms (dcatcim:, Metadata-European:) keep rdfs:domain.

This:

  • removes the ontology hijacking of rdfs:domain on external terms (it entails every title-bearing resource is a dcat:Dataset), which @VladimirAlexiev correctly flagged;
  • keeps the class↔attribute structure in the RDFS vocabulary (not only in SHACL), so RDFS-driven schema / Simple-SHACL generation still has something to derive from;
  • restores the linkage lost in 489c5c5 for the 11 URI-typed Dataset attributes (8 dcterms: + prov:wasGeneratedBy via schema:domainIncludes; Metadata-European:processType / usedSettings via rdfs:domain), and applies the convention consistently to the string-typed reused terms too.

Verification

  • cims:dataType and cims:multiplicity are unchanged — no drift vs ncp-v2-4-1.
  • The URI/literal classification was cross-checked against the owning vocabularies (DCMI Terms, PROV-O): every #URI attribute has a class-valued range (RightsStatement, Frequency, Standard, LicenseDocument, Agent, Location, prov:Activity) and all literals match. (Separately: dcterms:rights / dcterms:rightsHolder are modelled as #String here although DCT ranges them as classes — pre-existing, unchanged, out of scope for this PR.)
  • The file parses; multi-domain terms became multiple schema:domainIncludes (a union — the intended "used on either" — rather than the conjunction that multiple rdfs:domain implies).

Docs — ⚠️ breaking for rdfs:domain-driven tooling

.github/README.mdRDF schemas) now states the RDFS ↔ SHACL division of responsibility and the RDFS conventions explicitly: flat RDF/XML (no nested nodes); RDFS holds classes + attributes + simple attribute-local constraints (datatype, multiplicity) + the owned/reused class linkage; Simple SHACL is a mechanical projection of the RDFS; Complex/Validation SHACL carries what RDFS cannot express. Tooling that derived attribute-to-class membership from rdfs:domain must now also read schema:domainIncludes for external terms.

@VladimirAlexiev — this implements the non-inferential-domain approach from #92; would appreciate your review.

…Includes (fixes entsoe#92)

The class<->attribute linkage of reused external terms (dcterms:, prov:, dcat:,
adms:, rdf:) is expressed with the non-inferential schema:domainIncludes instead
of rdfs:domain; CIM-owned terms (dcatcim:, Metadata-European:) keep rdfs:domain.
This removes the ontology hijacking of rdfs:domain on external terms (it entails
every title-bearing resource is a dcat:Dataset) while keeping the class<->attribute
structure in the RDFS vocabulary rather than only in SHACL.

Restores the class linkage lost in 489c5c5 for the 11 URI-typed Dataset
attributes (8 dcterms: + prov:wasGeneratedBy via schema:domainIncludes;
Metadata-European:processType/usedSettings via rdfs:domain), and applies the
convention consistently to the string-typed reused terms too.

cims:dataType and cims:multiplicity are unchanged (verified: no drift vs
ncp-v2-4-1). The URI/literal classification was cross-checked against the owning
vocabularies (DCMI Terms, PROV-O): all #URI attributes have class-valued ranges
(RightsStatement, Frequency, Standard, LicenseDocument, Agent, Location,
prov:Activity) and all literals match.

README (# RDF schemas): adds an explicit statement of the RDFS <-> SHACL division
of responsibility and the RDFS conventions (flat RDF/XML, no nested nodes; classes
+ attributes + simple constraints in RDFS; Simple SHACL derived from it; Complex/
Validation SHACL for the rest), with the owned/reused linkage rule and an NB-breaking
flag.
@VladimirAlexiev

Copy link
Copy Markdown
Collaborator

@griddigit-ci @Sveino such fix needs to be done in UML->Ontology, right?

I like domainIncludes for its lightness. But it can't express cardinality.
And @Haigutus in some circumstances cardinality can he considered part of the model. Eg in GraphQL a scalar (single valued) is different from an array (multi valued).
But descriptive data props are always multivalued because they can be expressed in multiple languages. Then you need sh:uniqueLanguage.

Oh well... in the balance, i think that domainIncludes is useful.

@griddigit-ci

Copy link
Copy Markdown
Collaborator

@VladimirAlexiev we are not really able to do this thing in UML due to tooling. So it seems that this RDFS is somehow crafted manually/semi manually
I see the changes from Kristjan and they are fine with me so I will approve the pull request. The in some of the documents we will need to describe what we are doing here

<rdf:Description rdf:about="http://www.w3.org/ns/dcat#inSeries">
<cims:AssociationUsed>Yes</cims:AssociationUsed>
<rdfs:comment>A dataset series of which the dataset is part.</rdfs:comment>
<rdfs:domain rdf:resource="http://www.w3.org/ns/dcat#Dataset"/>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dcat: props can stay with domain not domainIncludes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants