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

prefixes trouble when using --subjectOrder #27

Open
VladimirAlexiev opened this issue Sep 13, 2024 · 1 comment
Open

prefixes trouble when using --subjectOrder #27

VladimirAlexiev opened this issue Sep 13, 2024 · 1 comment

Comments

@VladimirAlexiev
Copy link

If I run with these options:

--subjectOrder owl:Ontology						\
--subjectOrder cims:ClassCategory					\
--subjectOrder rdfs:Class						\
--subjectOrder owl:Class						\
--subjectOrder rdf:Property						\
--subjectOrder owl:ObjectProperty					\
--subjectOrder owl:DatatypeProperty					\
--subjectOrder owl:AnnotationProperty					\
--subjectOrder owl:NamedIndividual

I get

16:31:23.120 [main] DEBUG de.atextor.owlcli.OWLCLIWriteCommand -- No prefix declaration matched URI owl:Ontology, keeping as-is
16:31:23.120 [main] DEBUG de.atextor.owlcli.OWLCLIWriteCommand -- No prefix declaration matched URI cims:ClassCategory, keeping as-is
16:31:23.120 [main] DEBUG de.atextor.owlcli.OWLCLIWriteCommand -- No prefix declaration matched URI rdfs:Class, keeping as-is
16:31:23.120 [main] DEBUG de.atextor.owlcli.OWLCLIWriteCommand -- No prefix declaration matched URI owl:Class, keeping as-is
16:31:23.120 [main] DEBUG de.atextor.owlcli.OWLCLIWriteCommand -- No prefix declaration matched URI rdf:Property, keeping as-is
16:31:23.135 [main] DEBUG de.atextor.owlcli.OWLCLIWriteCommand -- No prefix declaration matched URI owl:ObjectProperty, keeping as-is
16:31:23.135 [main] DEBUG de.atextor.owlcli.OWLCLIWriteCommand -- No prefix declaration matched URI owl:DatatypeProperty, keeping as-is
16:31:23.135 [main] DEBUG de.atextor.owlcli.OWLCLIWriteCommand -- No prefix declaration matched URI owl:AnnotationProperty, keeping as-is
16:31:23.135 [main] DEBUG de.atextor.owlcli.OWLCLIWriteCommand -- No prefix declaration matched URI owl:NamedIndividual, keeping as-is

I thought it knows about the standard prefixes, so I don't need to mention them?

Then I tried:

--prefix owl								\
--prefix rdf								\
--prefix rdfs								\
--prefix cims=http://iec.ch/TC57/1999/rdf-schema-extensions-19990926# \

As a result, all terms are sorted in alphabetical order.
So I think it reset owl. rdf, rdfs to empty URLs.

This contradicts the documentation

You can specify a well-known prefix (currently: rdf, rdfs, xsd, owl, dcterms)

(without giving the URL)

@VladimirAlexiev
Copy link
Author

VladimirAlexiev commented Sep 17, 2024

I'm converting this file: https://github.com/Sveino/Inst4CIM-KG/blob/develop/source/CGMES-NC/r2.3/ap-voc/rdf/SensitivityMatrix-AP-Voc-RDFS2020.rdf .
I tried to list the standard prefixes in full:

owl.bat write --prefixAlign=right --useCommaByDefault \
 --prefixOrder cim --prefixOrder nc --prefixOrder cims --prefixOrder dcat-cim --prefixOrder dm --prefixOrder eu --prefixOrder eumd --prefixOrder md --prefixOrder prof --prefixOrder profcim --prefixOrder dh --prefixOrder dl --prefixOrder dy --prefixOrder eq --prefixOrder eqbd --prefixOrder gl --prefixOrder op --prefixOrder sc --prefixOrder ssh --prefixOrder sv --prefixOrder tp --prefixOrder ae --prefixOrder as --prefixOrder co --prefixOrder er --prefixOrder gd --prefixOrder iam --prefixOrder ma --prefixOrder or --prefixOrder ps --prefixOrder psp --prefixOrder ra --prefixOrder ras --prefixOrder sar --prefixOrder sm --prefixOrder sis --prefixOrder shs --prefixOrder ssi --prefixOrder dcat --prefixOrder dct --prefixOrder dcterms --prefixOrder euvoc --prefixOrder owl --prefixOrder prov --prefixOrder rdf --prefixOrder rdfs --prefixOrder sh --prefixOrder skos --prefixOrder xsd \
 --prefix rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns# --prefix rdfs=http://www.w3.org/2000/01/rdf-schema# --prefix owl=http://www.w3.org/2002/07/owl# --prefix cims=http://iec.ch/TC57/1999/rdf-schema-extensions-19990926# \
 --subjectOrder owl:Ontology --subjectOrder cims:ClassCategory --subjectOrder rdfs:Class --subjectOrder owl:Class --subjectOrder rdf:Property --subjectOrder owl:ObjectProperty --subjectOrder owl:DatatypeProperty --subjectOrder owl:AnnotationProperty --subjectOrder owl:NamedIndividual \
 --input=rdfxml  SensitivityMatrix-AP-Voc-RDFS2020.rdf SensitivityMatrix-AP-Voc-RDFS2020.ttl

The terms are output in the following order. It seems to be

  • owl:Ontology, cims:ClassCategory : I asked for this
  • then rdf:Property: but I asked for classes first
  • then everything else
sm:Ontology a owl:Ontology
sm:Package_DocSensitivityMatrixProfile a cims:ClassCategory
sm:Package_SensitivityMatrixProfile a cims:ClassCategory
cim:IdentifiedObject.description a rdf:Property
cim:IdentifiedObject.mRID a rdf:Property
cim:IdentifiedObject.name a rdf:Property
nc:AssessedElement.ObservableQuantity a rdf:Property
nc:Contingency.ObservableQuantity a rdf:Property
nc:ControllableQuantity.GridStateAlteration a rdf:Property
nc:ControllableQuantity.RemedialAction a rdf:Property
nc:ControllableQuantity.SensitivityFactor a rdf:Property
nc:ControllableQuantity.value a rdf:Property
nc:GridStateAlteration.ControllableQuantity a rdf:Property
nc:ObservableQuantity.AssessedElement a rdf:Property
nc:ObservableQuantity.Contingency a rdf:Property
nc:ObservableQuantity.SensitivityFactor a rdf:Property
nc:ObservableQuantity.observableQuantityKind a rdf:Property
nc:RemedialAction.ControllableQuantity a rdf:Property
nc:SensitivityFactor.ControllableQuantity a rdf:Property
nc:SensitivityFactor.ObservableQuantity a rdf:Property
nc:SensitivityFactor.SensitivityMatrix a rdf:Property
nc:SensitivityFactor.value a rdf:Property
nc:SensitivityMatrix.SensitivityFactor a rdf:Property
nc:SensitivityMatrix.kind a rdf:Property
cim:Contingency a rdfs:Class
cim:Date a rdfs:Class
cim:DateTime a rdfs:Class
cim:Float a rdfs:Class
cim:IdentifiedObject a rdfs:Class
cim:String a rdfs:Class
nc:AssessedElement a rdfs:Class
nc:ControllableQuantity a rdfs:Class
nc:GridStateAlteration a rdfs:Class
nc:ObservableQuantity a rdfs:Class
nc:ObservableQuantityKind a rdfs:Class
nc:ObservableQuantityKind.activePower a nc:ObservableQuantityKind
nc:ObservableQuantityKind.reactivePower a nc:ObservableQuantityKind
nc:ObservableQuantityKind.voltageAngle a nc:ObservableQuantityKind
nc:ObservableQuantityKind.voltageMagnitude a nc:ObservableQuantityKind
nc:RemedialAction a rdfs:Class
nc:SensitivityFactor a rdfs:Class
nc:SensitivityMatrix a rdfs:Class
nc:SensitivityMatrixKind a rdfs:Class
nc:SensitivityMatrixKind.other a nc:SensitivityMatrixKind
nc:SensitivityMatrixKind.uniformLoad a nc:SensitivityMatrixKind
nc:SensitivityMatrixKind.uniformNode a nc:SensitivityMatrixKind
nc:SensitivityMatrixKind.zoneToSlack a nc:SensitivityMatrixKind
profcim:IRI a rdfs:Class
profcim:StringFixedLanguage a rdfs:Class
profcim:StringIRI a rdfs:Class
profcim:URL a rdfs:Class

The original terms are in this order:

  • first Ontology
  • then everything else, by alphabetical order of the local name: maybe that's a useful option if you know what name you're looking for, but not the namespace
sm:Ontology
nc:AssessedElement
nc:AssessedElement.ObservableQuantity
cim:Contingency
nc:Contingency.ObservableQuantity
nc:ControllableQuantity
nc:ControllableQuantity.GridStateAlteration
nc:ControllableQuantity.RemedialAction
nc:ControllableQuantity.SensitivityFactor
nc:ControllableQuantity.value
cim:Date
cim:DateTime
cim:Float
nc:GridStateAlteration
nc:GridStateAlteration.ControllableQuantity
profcim:IRI
cim:IdentifiedObject
cim:IdentifiedObject.description
cim:IdentifiedObject.mRID
cim:IdentifiedObject.name
nc:ObservableQuantity
nc:ObservableQuantity.AssessedElement
nc:ObservableQuantity.Contingency
nc:ObservableQuantity.SensitivityFactor
nc:ObservableQuantity.observableQuantityKind
nc:ObservableQuantityKind
nc:ObservableQuantityKind.activePower
nc:ObservableQuantityKind.reactivePower
nc:ObservableQuantityKind.voltageAngle
nc:ObservableQuantityKind.voltageMagnitude
sm:Package_DocSensitivityMatrixProfile
sm:Package_SensitivityMatrixProfile
nc:RemedialAction
nc:RemedialAction.ControllableQuantity
nc:SensitivityFactor
nc:SensitivityFactor.ControllableQuantity
nc:SensitivityFactor.ObservableQuantity
nc:SensitivityFactor.SensitivityMatrix
nc:SensitivityFactor.value
nc:SensitivityMatrix
nc:SensitivityMatrix.SensitivityFactor
nc:SensitivityMatrix.kind
nc:SensitivityMatrixKind
nc:SensitivityMatrixKind.other
nc:SensitivityMatrixKind.uniformLoad
nc:SensitivityMatrixKind.uniformNode
nc:SensitivityMatrixKind.zoneToSlack
cim:String
profcim:StringFixedLanguage
profcim:StringIRI
profcim:URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant