From ea35ea6e9279be4a0551bab9212630af7d77eb54 Mon Sep 17 00:00:00 2001 From: Milos Jakubicek Date: Fri, 6 Sep 2024 11:39:17 +0200 Subject: [PATCH 1/2] RDF validation checks for pyshacl module --- dmlex-v1.0/specification/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dmlex-v1.0/specification/Makefile b/dmlex-v1.0/specification/Makefile index 1a388fa..c7c2739 100644 --- a/dmlex-v1.0/specification/Makefile +++ b/dmlex-v1.0/specification/Makefile @@ -44,6 +44,9 @@ xmldep: jsondep: @python -c 'import jsonschema' 2>/dev/null || { echo "Python jsonschema module is not installed, cannot validate JSON examples."; exit 2; } +rdfdep: + @python -c 'import pyshacl' 2>/dev/null || { echo "Python pyshacl module is not installed, cannot validate JSON examples."; exit 2; } + validate_xml: xmldep validate_xml.py schemas/XML/dmlex.xsd schemas/XML/dmlex_no-crosslingual.xsd @for xmlexample in examples/examples/source/*[0-9].xml; do \ echo validating "$$xmlexample"; \ @@ -70,7 +73,7 @@ validate_json: jsondep validate_json.py schemas/JSON/dmlex.schema.json schemas/J } \ done -validate_rdf: jsondep schemas/RDF/dmlex.shacl +validate_rdf: rdfdep 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 \ From 5a26224291ea1ad774ec10519b9c618c36ecd801 Mon Sep 17 00:00:00 2001 From: Milos Jakubicek Date: Fri, 6 Sep 2024 11:33:40 +0200 Subject: [PATCH 2/2] run xmllint to check docbook XML for broken cross-references --- .github/workflows/main.yml | 2 +- .github/workflows/pr.yml | 2 +- dmlex-v1.0/specification/Makefile | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c43efd1..441efdf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,7 +41,7 @@ jobs: run: | echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections sudo apt-get update - sudo apt-get install xsltproc fop xmlstarlet ttf-mscorefonts-installer graphviz + sudo apt-get install xsltproc fop xmlstarlet ttf-mscorefonts-installer graphviz libxml2-utils sudo fc-cache -f - name: Make XML, HTML and PDF run: make html pdf diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3c6d775..3233e19 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -39,7 +39,7 @@ jobs: run: | echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections sudo apt-get update - sudo apt-get install xsltproc fop xmlstarlet ttf-mscorefonts-installer graphviz + sudo apt-get install xsltproc fop xmlstarlet ttf-mscorefonts-installer graphviz libxml2-utils sudo fc-cache -f - name: Make XML, HTML and PDF run: make html pdf diff --git a/dmlex-v1.0/specification/Makefile b/dmlex-v1.0/specification/Makefile index c7c2739..a1bc197 100644 --- a/dmlex-v1.0/specification/Makefile +++ b/dmlex-v1.0/specification/Makefile @@ -17,6 +17,7 @@ dmlex-$(VERSION).html: dmlex-$(VERSION).xml dmlex-$(VERSION).xml: dmlex.xml docbook/dbgenent.mod dmlex_uml.svg $(SOURCE_XML) ./merge.sh $@ + xmllint --valid --noout $@ dmlex_uml.pdf: dmlex.dot dot -Tpdf < $< > $@