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

SHACL: Checking Datatypes #150

Open
VladimirAlexiev opened this issue Dec 27, 2024 · 0 comments
Open

SHACL: Checking Datatypes #150

VladimirAlexiev opened this issue Dec 27, 2024 · 0 comments
Assignees
Labels
shacl Pertains to SHACL shapes

Comments

@VladimirAlexiev
Copy link
Collaborator

CIM SHACL includes datatype checking: there are 3778 checks:

PREFIX sh: <http://www.w3.org/ns/shacl#>
select * {
    ?propShape sh:path ?prop; sh:datatype ?dt
} order by ?prop

The breakdown of prop checks by namespace is as follows:

ns c comment
http://iec.ch/TC57/CIM100 3060
https://cim4.eu/ns/nc 577
(blank) 31 complex property paths, see prev section
https://cim.ucaiug.io/ns 30
http://purl.org/dc/terms/ 27
http://iec.ch/TC57/CIM100-European 18
http://www.w3.org/ns/dcat 15
http://iec.ch/TC57/61970-552/ModelDescription/1 12
http://www.w3.org/ns/prov 2
http://www.w3.org/ns/adms 2
https://cim.ucaiug.io/ns/eu 2
http://publications.europa.eu/ontology/euvoc 1
https://cim4.eu/ns/Metadata-European 1

The following query finds props whose datatype is not checked.
It considers both the cim17 (older) and the cim (current) namespace:

PREFIX cim17: <http://iec.ch/TC57/CIM100#>
PREFIX cim: <https://cim.ucaiug.io/ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX sh: <http://www.w3.org/ns/shacl#>

select ?prop ?dt {
  ?prop a owl:DatatypeProperty; rdfs:range ?dt
  bind(iri(concat(str(cim17:),strafter(str(?prop),str(cim:)))) as ?propOld)
  filter not exists {[] sh:path ?prop; sh:datatype ?dt}
  filter not exists {[] sh:path ?propOld; sh:datatype ?dt}
} order by ?prop

Saved as prop-datatypes-not-checked.tsv.
Notes:

  • Props of value objects (cim:StreetAddress, cim:StreetDetail, cim:TownDetail) are checked,
    but using unnecessary prop paths
  • Some props use wrong prefixes, eg dct:Resource.modified
  • Some props are not really used in instance data, eg rdf:Statement.object
  • Some props are probably in wrong namespaces, eg dct:PowerSystemProjectGroup.description
  • Some newer props need to be added to checking: cim:Contingency.mustStudy, cim:DCConductingEquipment.ratedCurrent; nc:GridStateAlteration.enabled, nc:GridStateAlteration.participationFactor
@VladimirAlexiev VladimirAlexiev added the shacl Pertains to SHACL shapes label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
shacl Pertains to SHACL shapes
Projects
None yet
Development

No branches or pull requests

2 participants