Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't use Overly Specific Props; guidance when to use class vs subclass in prop name #149

Open
VladimirAlexiev opened this issue Dec 27, 2024 · 0 comments
Assignees
Labels
longterm Will be done in the (far) future ontology Pertains to ontology representation

Comments

@VladimirAlexiev
Copy link
Collaborator

This query finds 36 props named "Terminal" or "Terminals":

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
select * {
  ?p a owl:ObjectProperty; rdfs:range ?range
  bind(replace(str(?p),".*\\.","") as ?suffix)
  filter(regex(?suffix,"Terminal","i"))
} order by ?suffix
p range suffix
nc:InfeedTerminal.ACDCTerminal cim:ACDCTerminal "ACDCTerminal"
nc:PowerFlowResult.ACDCTerminal cim:ACDCTerminal "ACDCTerminal"
nc:VoltageAngleLimit.AngleReferenceTerminal cim:Terminal "AngleReferenceTerminal"
nc:MonitoringArea.AreaBorderTerminal nc:AreaBorderTerminal "AreaBorderTerminal"
nc:Terminal.AreaBorderTerminal nc:AreaBorderTerminal "AreaBorderTerminal"
nc:PinDCTerminal.DCTerminal cim:DCTerminal "DCTerminal"
cim:ACDCConverter.DCTerminals cim:ACDCConverterDCTerminal "DCTerminals"
cim:DCNode.DCTerminals cim:DCBaseTerminal "DCTerminals"
cim:DCConductingEquipment.DCTerminals cim:DCTerminal "DCTerminals"
cim:DCTopologicalNode.DCTerminals cim:DCBaseTerminal "DCTerminals"
cim:MutualCoupling.First_Terminal cim:Terminal "First_Terminal"
nc:PowerFrequencyController.FrequencyMonitoringTerminal nc:FrequencyMonitoringTerminal "FrequencyMonitoringTerminal"
nc:Terminal.FrequencyMonitoringTerminal nc:FrequencyMonitoringTerminal "FrequencyMonitoringTerminal"
nc:Circuit.IdentifyingTerminal cim:Terminal "IdentifyingTerminal"
nc:ACDCTerminal.InfeedTerminal nc:InfeedTerminal "InfeedTerminal"
nc:InfeedLimit.InfeedTerminal nc:InfeedTerminal "InfeedTerminal"
nc:DirectCurrentSubstationController.MultiterminalControl nc:DirectCurrentMasterController "MultiterminalControl"
cim:ACDCConverter.PccTerminal cim:Terminal "PccTerminal"
nc:DCTerminal.PinDCTerminal nc:PinDCTerminal "PinDCTerminal"
nc:Terminal.PinTerminal nc:PinTerminal "PinTerminal"
cim:MutualCoupling.Second_Terminal cim:Terminal "Second_Terminal"
cim:OperationalLimitSet.Terminal cim:ACDCTerminal "Terminal"
nc:FrequencyMonitoringTerminal.Terminal cim:Terminal "Terminal"
nc:PinTerminal.Terminal cim:Terminal "Terminal"
nc:AreaBorderTerminal.Terminal cim:Terminal "Terminal"
cim:RemoteInputSignal.Terminal cim:Terminal "Terminal"
cim:BusNameMarker.Terminal cim:ACDCTerminal "Terminal"
cim:AuxiliaryEquipment.Terminal cim:Terminal "Terminal"
cim:RegulatingControl.Terminal cim:Terminal "Terminal"
cim:TieFlow.Terminal cim:Terminal "Terminal"
cim:TransformerEnd.Terminal cim:Terminal "Terminal"
cim:Measurement.Terminal cim:ACDCTerminal "Terminal"
cim:SvPowerFlow.Terminal cim:Terminal "Terminal"
cim:TopologicalNode.Terminal cim:Terminal "Terminal"
cim:ConductingEquipment.Terminals cim:Terminal "Terminals"
cim:ConnectivityNode.Terminals cim:Terminal "Terminals"

Which of these properties could be renamed to just "Terminal"?

  • Only First_Terminal, Second_Terminal are likely to appear together within the same hosting class.
  • Plurals can be renamed to singular without any confusion or loss of meaning
  • There is no clear guidance when a specific subclass should be used in the prop URL, and there are some inconsistencies:
    • cim:ACDCConverter.DCTerminals uses "DCTerminal" but the range is cim:ACDCConverterDCTerminal
    • cim:DCNode.DCTerminals uses "DCTerminal" but the range is cim:DCBaseTerminal
    • cim:OperationalLimitSet.Terminal uses "Terminal" but the range is cim:ACDCTerminal

Note: there are 12 classes named "Terminal":

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
select * {
  ?c a owl:Class
  filter(strends(str(?c),"Terminal"))
  optional {?c rdfs:subClassOf ?parent}
} order by ?parent

Their hierarchy is as follows:

  • cim:IdentifiedObject
    • cim:ACDCTerminal
      • cim:Terminal
      • cim:DCBaseTerminal
        • cim:DCTerminal
        • cim:ACDCConverterDCTerminal
    • nc:FunctionInputVariable
      • nc:GateInputPin
        • nc:PinTerminal
        • nc:PinDCTerminal
  • nc:FrequencyMonitoringTerminal
  • nc:InfeedTerminal
  • nc:AreaBorderTerminal
@VladimirAlexiev VladimirAlexiev added longterm Will be done in the (far) future ontology Pertains to ontology representation labels Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
longterm Will be done in the (far) future ontology Pertains to ontology representation
Projects
None yet
Development

No branches or pull requests

2 participants