RDF data validation
Optionally you can setup data validation to make sure all data added to the knowledge graph is complying with a specific data model.
#
SHACL validationFor more informations about creating SHACL shapes, checkout the SHACL Shapes repository of the Institute of Data Science at Maastricht University: https://github.com/MaastrichtU-IDS/shacl-shapes
To find SHACL shapes, checkout the Shapes of You SHACL shapes registry: http://index.semanticscience.org
Here are a few solutions to validate RDF with SHACL:
- Enable SHACL validation when creating a new repository if using Ontotext GraphDB free edition.
- Use RDF4J with java (good if your already working on a java app based on RDF4J)
- TopQuadrant/shacl (java)
- RDFLib/pySHACL (python, requires to load the RDF in rdflib)
You can also validate small RDF files directly from a few web app:
#
Use Compact SHACLYou can try out the experimental Compact SHACL syntax to more easily write shapes.
There are currently no VisualStudio Code extension for better visualization of compact SHACL files, but you can use the turtle
format to make it more readable. Open the settings.json
file in File > Preference > Settings, and add:
You can easily convert Compact SHACL to RDF SHACL (required for most use of SHACL) with java:
- Download the jar:
- Convert compact SHACL to RDF SHACL:
#
ShEx validationHere are a few solutions to validate RDF with ShEx:
- iovka/shex-java using RDF4J
- hsolbrig/PyShEx (python, can perform validation directly on a SPARQL endpoint)
You can also validate small RDF files directly from a few web app: