Sveino / Inst4CIM-KG

Instance of CIM Knowledge Graph
Apache License 2.0
5 stars 1 forks source link

deprecate `cims:AssociationUsed "No"` props (or even delete them?) #113

Open VladimirAlexiev opened 1 month ago

VladimirAlexiev commented 1 month ago

However, @Sveino explained that cims:AssociationUsed points out which prop of an inverse pair is actually used, eg:

cim:ACDCConverterDCTerminal.DCConductingEquipment a owl:ObjectProperty, owl:FunctionalProperty ;
  rdfs:label "DCConductingEquipment" ;
  rdfs:comment "A DC converter terminal belong to an DC converter."@en ;
  cims:AssociationUsed "Yes" ; ###########
  cims:multiplicity cims:M:1..1 ;
  owl:inverseOf cim:ACDCConverter.DCTerminals ;
  rdfs:domain cim:ACDCConverterDCTerminal ;
  rdfs:range cim:ACDCConverter .

cim:ACDCConverter.DCTerminals a owl:ObjectProperty, owl:InverseFunctionalProperty ;
  rdfs:label "DCTerminals" ;
  rdfs:comment "A DC converter have DC converter terminals. A converter has two DC converter terminals."@en ;
  cims:AssociationUsed "No" ; #############
  cims:multiplicity cims:M:0..n ;
  owl:inverseOf cim:ACDCConverterDCTerminal.DCConductingEquipment ;
  rdfs:domain cim:ACDCConverter ;
  rdfs:range cim:ACDCConverterDCTerminal .

My proposal is to make this explicit by using standard props:

cim:ACDCConverter.DCTerminals owl:deprecated true;
  skos:scopeNote "This property is not asserted in instance data. Use its owl:inverseOf property instead"@en

An even "stronger" approach would be to omit the definition of the "recessive" prop and declare only its name in the "dominant" prop:

cim:ACDCConverterDCTerminal.DCConductingEquipment prov:inverse "ACDCConverterDCTerminal.DCConductingEquipment".

This is the PROV approach: https://www.w3.org/TR/prov-o/#inverse-names. It has been adopted in DCAT (at least in part): https://w3c.github.io/dxwg/dcat/#inverse-properties, https://github.com/w3c/dxwg/issues/1336 .

However, we have rich info (owl:InverseFunctionalProperty, cims:multiplicity) that we would lose if we use a mere name.

griddigit-ci commented 3 weeks ago

Indeed the association used denotes the usage, but a bit more than that the presence in the serialised data. The "used" might be a bit broader terms as I do not know if you actually do some sort of RDFS based validation you kind of use both...

I guess this is point to discuss. Deprecate seems not that nice option as this can confuse with the meaning of deprecate we use in CIM = being it is still used, but it will be deleted in next or following versions

I may propose another approach

A disadvantage is that if we remove cims:AssociationUsed we have trouble to derive constraints from RDFS to SHACL, so that part of the tooling will need additional input which we can see to supply by other means

VladimirAlexiev commented 3 weeks ago

@Sveino please state whether CIM data will use inverseOf inference

can confuse with the meaning of deprecate we use in CIM = being it is still used, but it will be deleted in next or following versions

Sveino commented 3 weeks ago

I agree with Chavdar. We need to owl:inversOfand we expect that there will be reasoning to derive the association that is not included in the instance file. cims:AssociationUsed is a profile information. It will not be included in the vocabulary. It can therefore be translated into relevant SHACL validation without being included as RDFS.

VladimirAlexiev commented 3 weeks ago

Decided that:

griddigit-ci commented 2 weeks ago

the current outcome here is that 1) We keep owl:inverseOf in the RDFS so that we have the description of the 2 association ends 2) in SHACL we use the following pattern to validate that inverse associations are not exchanged. We can use the same/similar pattern in the SHACL for the profile so that we describe used direction of the association.

dl:DiagramObjectPoint.DiagramObject-inversePresent1 rdf:type sh:NodeShape ;             sh:property dl:DiagramObject.DiagramObjectPoints-present1; sh:targetSubjectsOf cim:DiagramObject.DiagramObjectPoints .

dl:DiagramObject.DiagramObjectPoints-present1 rdf:type sh:PropertyShape ;             sh:description "Inverse associations should not be instantiated" ;             sh:message "Inverse association present" ; sh:name "Inverse1-targetSubjectsOf" ;             sh:maxCount       0; sh:path cim:DiagramObject.DiagramObjectPoints; sh:severity sh:Violation .