RDF validation using ShEx - MaastrichtU-IDS/data2services-pipeline GitHub Wiki

Validate your RDF Knowledge Graph to make sure it complies with a defined data model/ontology.

PyShEx

Reference implementation.

pip3 install PyShEx
shexeval -h

shexeval /home/vemonet/Desktop/181107_biolink-drugbank.jsonld /home/vemonet/sandbox/biolink-model/shex/biolink-model.shex

# Turtle
shexeval -f turtle /home/vemonet/Desktop/181121-biolink-drugbank.ttl /home/vemonet/sandbox/biolink-model/shex/biolink-model.shex
# Json-ld
shexeval -f json-ld /home/vemonet/Desktop/181107_biolink-drugbank.jsonld /home/vemonet/sandbox/biolink-model/shex/biolink-model.shex

Simple validation with rapper

Quick validation of turtle RDF file using rapper on Unix

sudo apt install raptor2-utils
rapper -i turtle 181107-biolink-drugbank-reified-associations.ttl

ShEx Java

# Start the UI
java -jar shexjapp-0.0.1.jar

# Commandline
mvn exec:java -Dexec.classpathScope=test -Dexec.mainClass="fr.inria.lille.shexjava.commandLine.Validate" -Dexec.args="-s ../../shexTest/schemas/1dotSemi.shex -d file:///home/jdusart/Documents/Shex/workspace/shexTest/validation/Is1_Ip1_Io1.ttl -l http://a.example/S1 -f http://a.example/s1 -a recursive"

Shex js

Not working. 40 tests fail.

# Install and test
npm install --save shex
npm explore shex 'npm install'

# Tests (failing)
npm explore shex 'npm test'

KGX validate

cd ~/sandbox/kgx
source env/bin/activate
kgx validate /home/vemonet/sandbox/data-constructor/resources/biogrid_test.ttl

Valid BioLink

Additional notes for the BioLink model: