VladimirAlexiev / soml

Semantic Objects Modeling Language
8 stars 2 forks source link

owl2soml option `-shorten` #4

Open VladimirAlexiev opened 1 year ago

VladimirAlexiev commented 1 year ago
domain prop range SOML name
cim:ApparentPower cim:ApparentPower.value cim:Float value
cim:CurrentLimit entsoe2:CurrentLimit.normalValue cim:CurrentFlow entsoe2:normalValue
cim:Equipment cim:Equipment.EquipmentContainer cim:EquipmentContainer equipmentContainer
cim:EquipmentContainer cim:EquipmentContainer.Equipments cim:Equipment.EquipmentContainer equipments

This allows natural and shorter GraphQL querying, eg:

{equipmentContainer(ID:"...") {
  name
  equipments { # shorter and nicer than: EquipmentContainer_Equipments
    id
    name
  }
}}

A bigger example: instead of queries like this:

{
  substation {
    id
    powerSystemResource_Location {
      location_PositionPoints {
        positionPoint_yPosition
        positionPoint_xPosition
      }
    }
    substation_VoltageLevels {
      voltageLevel_BaseVoltage {
        baseVoltage_nominalVoltage
      }
    }
  }

You can use shorter queries like this:

{
  substation {
    id
    location {positionPoints {
        yPosition
        xPosition
      }}
    voltageLevels { baseVoltage { nominalVoltage } }
  }

Mirrored from https://ontotext.atlassian.net/browse/DATA-119

VladimirAlexiev commented 1 year ago

In addition to removing the domain class name (eg DiagramObject below), we should remove all its superclass names (eg IdentifiedObject). Eg from ENTSO-E_Test_Configurations_v3.0.2\v3.0\MicroGrid\MicroGrid-Type2\MicroGrid-Type2-HVDC-MAS\20210401T1730Z_1D_HVDC_DL_1.xml:

  <cim:DiagramObject rdf:ID="_162a0a97-7da2-a8bd-bdfd-39fc11ca0baf">
    <cim:IdentifiedObject.name>none</cim:IdentifiedObject.name>
    <cim:DiagramObject.rotation>0</cim:DiagramObject.rotation>
    <cim:DiagramObject.IdentifiedObject rdf:resource="#_b6978550-cb6e-11e1-bcee-406c8f32ef58" />
    <cim:DiagramObject.Diagram rdf:resource="#_f27170a0-16d5-292d-d803-39fc11ca0baf" />
    <cim:IdentifiedObject.mRID>162a0a97-7da2-a8bd-bdfd-39fc11ca0baf</cim:IdentifiedObject.mRID>
  </cim:DiagramObject>

How to check whether this won't lead to any conflicts? Eg above are two similar names that I mistakenly took to be a conflict: