Sveino / Inst4CIM-KG

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

Align NC instance file to both CGMES 2.4 and CGMES 3.0 #123

Open Sveino opened 1 week ago

Sveino commented 1 week ago

CGMES Network Code (NC) instance data will follow the same namespace that will be used for the CIMJSON-LD. However, we need to defined a machine-understandable structure and syntax to explain the mapping between the namespaces. In addition, we would like that the same Network Code instance file should work with CGMES 2.4 (CIM16) and CGMES 3.0 (17).

@prefix rdfs:   <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:    <http://www.w3.org/2002/07/owl#> .
@prefix cim:    <https://cim.ucaiug.io/ns#> .
@prefix cim16:  <http://iec.ch/TC57/2013/CIM-schema-cim16#> .
@prefix cim17:  <http://iec.ch/TC57/CIM100#> .

cim:Equipment owl:equivalentClass cim16:Equipment .
cim16:Equipment owl:equivalentClass cim:Equipment .
cim:Equipment owl:equivalentClass cim17:Equipment .
cim17:Equipment owl:equivalentClass cim:Equipment .
VladimirAlexiev commented 1 week ago

Equivalences like this are not free!

I think the more feasible approach is to write SPARQL updates that migrate a database from the older to the newest namespace.

Furthermore, equivalences don't express the idea of migrating namespaces across versions (16->17->18) because:

ps: I see I said the same (but in more detail) in #70

Sveino commented 1 week ago

"There’s No Such Thing as a Free Lunch" The alternative is that we have everything duplicated three times and use sameAs. In the future we need to implement this by versioning of the vocabulary. Now we have - in the context of Semantic Web three different ontologies. For OOP tool vendors they will have one internal datamodell that they would need to map to three different namespace. In the context of NC they need to use cim: <https://cim.ucaiug.io/ns#> in the context of CGMES 3.0 cim: <http://iec.ch/TC57/CIM100#> and in the context CGMES 2.4 cim: <http://iec.ch/TC57/2013/CIM-schema-cim16#>

We need to find a way to inform the tools - as we want everything to be data/schema driven. We can come up with our own mapping or try to re-use something from Semantic web.

As part of KG we would need to evaluate the best way to execute this. Primarily we are now looking into SHACL validation that can support multiple versions.

Good point that the operation is symmetric:

@prefix rdfs:   <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:    <http://www.w3.org/2002/07/owl#> .
@prefix cim:    <https://cim.ucaiug.io/ns#> .
@prefix cim16:  <http://iec.ch/TC57/2013/CIM-schema-cim16#> .
@prefix cim17:  <http://iec.ch/TC57/CIM100#> .

cim:Equipment owl:equivalentClass cim16:Equipment .
cim:Equipment owl:equivalentClass cim17:Equipment .

This statement does not cover all the requirement in regards to the migrating namespaces across versions (16->17->18). However, this solution will be based on the fact that there will be different version of the same namespace.

griddigit-ci commented 1 day ago

Vlado, I was thinking that it is possible to define "mapping" or basically a transformation technique between 2 graphs (e.g. the graphs of the RDFS) by using SPARQL as we can also express mathematical relationship between properties. I attempted to so a small sample which I can try to find. What do you think for such an idea?

Perhaps this is a bit bigger scope than what is in this issue

VladimirAlexiev commented 18 hours ago

insert { graph { ?x cim:Equipment.inService ?y } } where { graph { ?x cim17:Equipment.inService ?y } };


- We could also do this with GraphDB rules. The benefit is that if you change the value of `cim17:Equipment.inService` in `<old-graph>`, it will be automatically propagated to `cim:Equipment.inService` in `<new-graph>`