Sveino / Inst4CIM-KG

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

Fix Representation of NamedIndividuals #45

Open VladimirAlexiev opened 2 months ago

VladimirAlexiev commented 2 months ago

This query finds 554 individuals (all CIM individuals have these 3 characteristics)

select * {
  ?s a owl:Thing, owl:NamedIndividual; rdfs:domain ?class
} order by ?s

They are represented like this:

cim:AsynchronousMachineKind.generator a owl:NamedIndividual, owl:Thing ;
  rdfs:label "generator "@en ;
  rdfs:domain cim:AsynchronousMachineKind ;
  skos:definition "The Asynchronous Machine is a generator."@en ;
  ssh:isenum "True" .

Problems:

So we want to change this to:

cim:AsynchronousMachineKind.generator a cim:AsynchronousMachineKind ;
  rdfs:label "generator "@en ;
  skos:definition "The Asynchronous Machine is a generator."@en ;
  ssh:isenum "True" .
griddigit-ci commented 2 months ago

There is also a question if AsynchronousMachineKind.generator is the right convention or we just need generator

when you look here cim:AsynchronousMachineKind.generator a cim:AsynchronousMachineKind do you understand that generator is enumerated value of the cim:AsynchronousMachineKind class?

VladimirAlexiev commented 2 months ago

@griddigit-ci If you know these 2 naming conventions then you will understand :-)

The question is whether "generator" means just one thing or multiple different things. Looking at how it is used, I tend to think there are different things:

# grep -hF ".generator " */*/*|sort|uniq
cim:AsynchronousMachineKind.generator a owl:NamedIndividual, owl:Thing ;
cim:HydroEnergyConversionKind.generator a owl:NamedIndividual, owl:Thing ;
cim:SynchronousMachineKind.generator a owl:NamedIndividual, owl:Thing ;
cim:SynchronousMachineOperatingMode.generator a owl:NamedIndividual, owl:Thing ;

(I'm curious what would happen if you have a SynchronousMachine that's a generator, and you try to operate it as something else ;-)

BTW, two of those enum values are also defined in the way that this issue asks for:

cim:SynchronousMachineOperatingMode.generator a cim:SynchronousMachineOperatingMode ;
cim:AsynchronousMachineKind.generator a cim:AsynchronousMachineKind ;

Let's see where:

>grep -F ".generator a cim:" */*/*
CGMES-NC/ttl/SteadyStateHypothesisSchedule-AP-Voc-RDFS2020.ttl:cim:AsynchronousMachineKind.generator a cim:AsynchronousMachineKind ;
CGMES-NC/ttl/SteadyStateHypothesisSchedule-AP-Voc-RDFS2020.ttl:cim:SynchronousMachineOperatingMode.generator a cim:SynchronousMachineOperatingMode ;

So old-style files use the better representation:

cim:AsynchronousMachineKind.generator a cim:AsynchronousMachineKind ;
  rdfs:label "generator"@en ;
  rdfs:comment "The Asynchronous Machine is a generator." ;
  cims:stereotype "enum" .

I've added this as "regression" in https://github.com/Sveino/Inst4CIM-KG/issues/41

griddigit-ci commented 1 month ago

Do we still need to discuss something here? Most probably yes