For this assignment you will try your hand at
- creating SHACL shapes to validate data, and
- creating an OWL ontology to make inferences about data.
The data can either be a variation of the same Rijksmuseum data you've used for past assignments, or a new dataset you come up with yourself.
You will be editing four files:
data-invalid.ttl
A version of your data that is expected to fail SHACL validation.data-valid.ttl
A version of your data that is expected to pass SHACL validation.shapes.ttl
The SHACL shapes thatdata-valid.ttl
(but notdata-invalid.ttl
) should conform to.ontology.ttl
An OWL ontology that enables inferences overdata-valid.ttl
.
-
Create two copies of your data file and name them
data-invalid.ttl
anddata-valid.ttl
. -
Edit
shapes.ttl
, writing some shapes that you expect your data will not conform to. -
Run
make report-invalid.ttl
to validatedata-invalid.ttl
using your shapes. -
Open
report-invalid.ttl
; at the top you should see:[ rdf:type sh:ValidationReport ; sh:conforms false ;
… telling you that validation failed (as expected).
-
Edit
data-valid.ttl
, fixing the problems that were causingdata-invalid.ttl
not to validate. -
Run
make report-valid.ttl
to validatedata-valid.ttl
using your shapes. -
Open
report-valid.ttl
; at the top you should see:[ rdf:type sh:ValidationReport ; sh:conforms true ] .
… telling you that validation succeeded (as expected).
You'll probably want to refer to the core constraint components in the SHACL specification, as well as the example I've provided. This Introduction to SHACL may also be helpful.
-
Edit
ontology.ttl
, writing some class and property definitions that will enable inferences over your data. -
Run
make all.ttl
to generateall.ttl
, which will include the triples fromdata-valid.ttl
plus any new triples inferred fromdata-valid.ttl
andontology.ttl
. (This will also generateinferred.ttl
, which will include only the inferred triples.) -
Verify that
all.ttl
includes the inferred triples that you expected to see.
You may want to refer to the OWL 2 Primer, as well as the examples [1, 2] I've provided.
To submit the assignment, run:
make submission.zip
This will check that:
data-invalid.ttl
does not conform toshapes.ttl
data-valid.ttl
does conform toshapes.ttl
inferred.ttl
contains triples inferred fromdata-valid.ttl
andontology.ttl
You will get an error if any of these checks do not pass.
Once the checks pass, submit the zip file at https://aeshin.org/teaching/assignment/212/submit/
Finally, you should commit and push the following files:
data-invalid.ttl
data-valid.ttl
shapes.ttl
ontology.ttl