International-Data-Spaces-Association / InformationModel

The Information Model of the International Data Spaces implements the IDS reference architecture as an extensible, machine readable and technology independent data model.
Apache License 2.0
64 stars 37 forks source link

Measure the coverage of SHACL shapes for validation of the Information Model #147

Closed HaydarAk closed 3 years ago

HaydarAk commented 4 years ago

It would be good to have statistics (preferably generated automatically) on how much percent of the information model is covered by SHACL shapes and therefore validatable.

Could be done with a simple script. We usually have a SHACL shape for each class in the Information Model.

changqin26 commented 3 years ago

We usually have a SHACL shape for each class in the Information Model.---Do we already have a SHACL shape for each class in IM? No missing part?

HaydarAk commented 3 years ago

Our motivation for this issue was to check whether there might be some missing shapes. It has happened before that major changes were made to the information model without adjusting / adding the corresponding SHACL classes.

Do we already have a SHACL shape for each class in IM?

My assumption: No. We definitly have shapes for the mainly used classes (Resource, Message, Connector and so on) but there might be one or two cases with no shacl shapes.

We could do the checking on class level -> check for existing IDS classes in our ontology if there is a corresponding shacl shape in the testing directory. A rather simple approach would be to use a simple RDF / OWL framework to parse the ontology, get all relevant (ids) classes and check, if there is a corresponding shacl shape in the testing, subdirectory. Usually, we define shapes as follows:

shapes:someShapeName
    a sh:NodeShape ; 
    sh:targetClass ids:SomeIDSclassname ;
...

therefore, one could possibly retrieve and read all shacl shapes of the testing subdir, check for each IDS class (from the ontology) wether there is a corresponding triple. E.g. for the ids:Message, there should be a SHACL shape in the testing subdir with the triple ____ sh:targetClass ids:Message . .

changqin26 commented 3 years ago

Thanks for your reply! that is exactly what I want to know. I would like to take over the part of job. I know Matthias has worked on this before, I will firstly check with him and begin to work on the missing shapes.

HaydarAk commented 3 years ago

Great! Thank you :)