Skip to content

Commit

Permalink
Merge pull request #133 from jmccrae/shacl-validation
Browse files Browse the repository at this point in the history
Add RDF validation to GitHub workflow
  • Loading branch information
DavidFatDavidF authored Aug 8, 2024
2 parents 4e786a4 + 028de39 commit f833bcc
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 10 additions & 1 deletion dmlex-v1.0/specification/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion dmlex-v1.0/specification/examples/examples/source/8.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -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 ] ],
Expand Down
7 changes: 0 additions & 7 deletions dmlex-v1.0/specification/serializations/RDF/verify_shacl.sh

This file was deleted.

0 comments on commit f833bcc

Please sign in to comment.