diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 233b6ae2..43d4f8a8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,9 +24,9 @@ jobs: - uses: actions/checkout@v2 - name: Install packages for XML and JSON validation run: | - pip install xmlschema jsonschema xmlstarlet + pip install xmlschema jsonschema xmlstarlet pyshacl - name: Validate - run: make validate_xml validate_json + run: make validate_xml validate_json validate_rdf build: needs: validate diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index bfe2f0b1..3c6d7759 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -24,9 +24,9 @@ jobs: - uses: actions/checkout@v2 - name: Install packages for XML and JSON validation run: | - pip install xmlschema jsonschema xmlstarlet + pip install xmlschema jsonschema xmlstarlet pyshacl - name: Validate - run: make validate_xml validate_json + run: make validate_xml validate_json validate_rdf build: needs: validate runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index e3cd38d4..3c6b63be 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ dmlex-v1.0/specification/dmlex_uml_core_sm.png dmlex-v1.0/specification/dmlex-v1.0-csd02.fo dmlex-v1.0/specification/dmlex-v1.0-csd02.pdf dmlex-v1.0/specification/dmlex-v1.0-csd02.xml +dmlex-v1.0/specification/.venv diff --git a/dmlex-v1.0/specification/Makefile b/dmlex-v1.0/specification/Makefile index ab7de40f..ef4cda96 100644 --- a/dmlex-v1.0/specification/Makefile +++ b/dmlex-v1.0/specification/Makefile @@ -34,7 +34,7 @@ Makefile.dep: dmlex.xml $(SOURCE_XML) makedep.sh echo -n "SOURCE_XML=" > $@ ./makedep.sh >> $@ -.PHONY: clean validate_xml validate_json +.PHONY: clean validate_xml validate_json validate_rdf clean: rm -f dmlex-$(VERSION).html dmlex-$(VERSION).pdf dmlex-$(VERSION).fo dmlex-$(VERSION).xml Makefile.dep dmlex_uml.svg dmlex_uml.pdf dmlex.dot dmlex.dot.content @@ -69,3 +69,12 @@ validate_json: jsondep validate_json.py schemas/JSON/dmlex.schema.json schemas/J exit 4; \ } \ done + +validate_rdf: jsondep schemas/RDF/dmlex.shacl + @for rdfexample in examples/examples/source/*[0-9].rdf; do \ + echo validating "$$rdfexample"; \ + python -m pyshacl -s schemas/RDF/dmlex.shacl -df turtle $$rdfexample -e schemas/RDF/dmlex.ttl -i rdfs \ + || { echo "validation of $$rdfexample failed"; \ + exit 5; \ + } \ + done diff --git a/dmlex-v1.0/specification/examples/examples/source/8.rdf b/dmlex-v1.0/specification/examples/examples/source/8.rdf index 9f785a9b..2c408924 100644 --- a/dmlex-v1.0/specification/examples/examples/source/8.rdf +++ b/dmlex-v1.0/specification/examples/examples/source/8.rdf @@ -13,7 +13,7 @@ ex:doctor-n-1 a dmlex:Sense; dmlex:headwordTranslation [ a dmlex:HeadwordTranslation; dmlex:text "Ă„rztin"; dmlex:listingOrder "2"^^xsd:unsignedInt; - dmlex:langCode "de" + dmlex:langCode "de" ; dmlex:partOfSpeech [ dmlex:tag "n-fem"; dmlex:listingOrder "1"^^xsd:unsignedInt ] ], diff --git a/dmlex-v1.0/specification/serializations/RDF/verify_shacl.sh b/dmlex-v1.0/specification/serializations/RDF/verify_shacl.sh deleted file mode 100644 index ad02975f..00000000 --- a/dmlex-v1.0/specification/serializations/RDF/verify_shacl.sh +++ /dev/null @@ -1,7 +0,0 @@ -# Run in dmlex-v1.0/specification/serializations/RDF/ - -for f in `ls ../../examples/examples/source/*.rdf` -do - echo "Validating $f" - pyshacl -s ontology/dmlex.shacl -df turtle $f -e ontology/dmlex.ttl -i rdfs -done