Validation using rule-based reasoning.
first have EYE and Python installed
npm install
node gather.js
./bin/validate_owl -i [inputfile] -o outputfile -s [comma-delimited schemas, e.g. 'skos,foaf'] --ram [amount of RAM, e.g. 2g, 512m] -r [reasoning profile, rdfs and/or owl]
--ram
and -r
are optional.
the prefices of the schemas are saved locally at
resources/ontologies/prefix.json
. If a prefix isn't found, you can also enter the full URI If you add no schemas, N3Unit will look for all included schemas (best effort)
npm test
The testing goes as follows:
- gather all rule files (see
gather.js
)- take extra files
rdfsResource
andrdfsSubClassOf
- take all rule files under
resources/rules/*/rule.n3
- combine them in a pvm under
dist/n3unit.pvm
- take extra files
- for every profile (in this case only
owl
)- take the testing ontology file (in this case
test/owl/ontology.ttl
) - for every test file (in this case
test/owl/*Correct-Wrong*.ttl
)- run the validation with the pvm, the ontology, the test file, and the profile (in this case
profiles/owl.n3
) - put the ttl output in
tmp/tmp-CONSTRAINT.n3
- put the stderr output in
tmp/tmp-CONSTRAINT_err.n3
- check: if it should be correct, you should receive 0 violations, and otherwise you should receive more than 0
- run the validation with the pvm, the ontology, the test file, and the profile (in this case
- take the testing ontology file (in this case
Docker does the installation for you, so you only need to do
docker build -t n3unit .
docker run n3unit -it -i test/test.ttl -o test.ttl -s foaf
There's a test file at
test/test.ttl
Docker does the installation for you, so you only need to do
docker build -f cmd.Dockerfile -t n3unit-rml .
docker run -it -v [absolute path to local resources folder]:/usr/local/n3unit/resources n3unit-rml [path to rml file] > output.ttl
Make sure the path to rml file is within the root folder of this project
- Documentation about ./bin/cmd
- Documentation about ./bin/fetchTurtle
- Separate libs for fetchTurtle and eyeHandler
- Constraint generator (from generic to anything and vice versa)