Sveino / Inst4CIM-KG

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

make custom CIM XML parser #94

Closed VladimirAlexiev closed 1 month ago

VladimirAlexiev commented 1 month ago

To do https://github.com/Sveino/Inst4CIM-KG/issues/53, we need to:

I made such a thing: https://github.com/Sveino/Inst4CIM-KG/blob/develop/rdf-improved/cim-trig.pl

See results: https://github.com/Sveino/Inst4CIM-KG/tree/develop/rdf-improved/test/trig @Sveino @griddigit-ci do you like it, should something be improved?

VladimirAlexiev commented 1 month ago

@Sveino I think the model metadata should also be in the model graph: else you can't delete a model completely because if its metadata is in the default graph, it will be intermingled with all other models.

VladimirAlexiev commented 1 month ago

Moved metadata into the graph. Now it looks like

{ # reverseDifferences cim:IdentifiedObject.description "SET_PNT_1" . cim:AnalogLimit.value "99" . } { # forwardDifferences cim:IdentifiedObject.description "SET_PNT_1 test" . cim:AnalogLimit.value "100" . } ``` - FullGrid_OP.trig ```ttl { # model graph a cim:Discrete ; cim:Discrete.ValueAliasSet ; ... a md:FullModel ; md:Model.DependentOn ; md:Model.created "2020-12-10T00:21:43Z" ; } ```
VladimirAlexiev commented 1 month ago

Closing and I seek approve

VladimirAlexiev commented 1 month ago

Please comment on

removes the pesky _ from node URLs

Sveino commented 3 weeks ago

It is better to replace "_" with "urn:uuid" that change rdf:ID and rdf:about. We have tried to use this as indented back in 2000... We use rdf:ID in the EQ instance file and then rdf:about in any of the other profile based instance file to tell the receiver that you should already have the object. In the EQ you might or you might not have the object before. Even if we start using the DIFF we might need to exchange a full model as part of Schema upgrade (CIM17 to CIM18), major re-modelling and sync. For JSON-LD we do not have this difference.

So I am OK that this:


<http://fullgrid.eu/CGMES/3.0#_13dacabf-aa4c-4a78-806e-c7c4c6949718> a cim:Discrete ;
  cim:Discrete.ValueAliasSet <http://fullgrid.eu/CGMES/3.0#1a457323-2094-440f-8d30-dc93adf0cdb3> ;

Can be converted to:


<urn:uuid:13dacabf-aa4c-4a78-806e-c7c4c6949718> a cim:Discrete ;
  cim:Discrete.ValueAliasSet <urn:uuid:1a457323-2094-440f-8d30-dc93adf0cdb3> ;

or we go for the way we would like it to be for JSON-LD with a base that is http://model4powersystem.eu/Statnett

@VladimirAlexiev do base need to be the same for all the releated instance files or could/should it be named graph. If the later then it could be:

@base <http://model4powersystem.eu/Statnett-EQOP/> .

For the header we have added the concept of MAS though the use of the following properties


<dcat:isVersionOf rdf:resource="https://energy.referencedata.eu/Model/Statnett-EQOP"/>
<dcat:keyword>RA</dcat:keyword>
<dcterms:publisher rdf:resource="https://energy.referencedata.eu/EIC/10X1001A1001A38Y"/>
<dcterms:references rdf:resource="urn:uuid:99ae9f41-0a91-4d21-a483-7398c160da96"/>
<dcterms:spatial rdf:resource="https://energy.referencedata.eu/Frame/NO-Power-Transmission-System"/>

dcterms:references is refering to the instance dataset that is a named graph. This could be:


<dcterms:references rdf:resource="http://model4powersystem.eu/Statnett-EQCO/urn:uuid:99ae9f41-0a91-4d21-a483-7398c160da96"/>