Closed VladimirAlexiev closed 7 months ago
Thanks @VladimirAlexiev for creating such a well constructed issue.
Jargon does support the type of naming conventions you mention, but only for Classes and Properties.
I'll get a backlog item added that includes similar rules for codelists. This will notify domain authors of this type of collision in the future.
I've also worked with @onthebreeze to add a workaround for this specific domain in the meantime.
I'll close this issue when the feature is implemented.
When a Jargon Domain is configured to generate JSON-LD, it will detect and raise an error for code lists colliding with names of things in the model:
Jargon will also now warn you when you are about to save a Domain with errors:
Whilst this won't prevent the situation from happening again, Domain authors will be aware of it.
I'll investigate and consider if a Domain with errors should still generate JSON-LD - or only allow that if the Domain is error free.
This is now also resolved in https://jargon.sh/user/unece/DigitalProductPassport/v/working/artefacts/jsonld/render.jsonld, thanks @onthebreeze:
{
rdfs:label: "assuranceLevelCode",
@type: "rdfs:Class",
@id: "DigitalProductPassport:assuranceLevelCode",
rdfs:comment: "Code that describes the assurance level of the conformity assessment"
},
{
@id: "DigitalProductPassport:assuranceLevel",
@type: [
"rdf:Property",
"owl:ObjectProperty"
],
rdfs:label: "assuranceLevel",
schema:rangeIncludes: {
@id: "DigitalProductPassport:assuranceLevelCode"
},
schema:domainIncludes: {
@id: "DigitalProductPassport:Evidence"
},
rdfs:comment: "The assurance level of the evidence (self declaration, 2nd party, 3rd party, accredited auditor)"
},
Look at https://jargon.sh/user/unece/DigitalProductPassport/v/working/artefacts/diagram/render.svg?light=true. Here is a problem:
This leads to the following conflict in the generated ontology (JSONLD) https://jargon.sh/user/unece/DigitalProductPassport/v/working/artefacts/jsonld/render.jsonld:
You can already see the conflict: a property refers to itself as "range" (i.e. a class).
This is also seen explicitly at the beginning:
This domain is by @onthebreeze, but I think Jargon should enforce that each prop, class and codelist name is unique within the domain (and across these 3 categories).
Most ontologies enforce a naming convention that classes (and codelist classes) use UpperCase whereas props use lowerCase. So it's just fine for the prop to be
DigitalProductPassport:assuranceLevel
and the class to beDigitalProductPassport:AssuranceLevel
.