Commit 34747ece authored by Petar Hristov's avatar Petar Hristov 💬
Browse files

Merge branch 'master' into 'Request/37753c6a-9600-439d-a8da-2cd42472ce69'

Master

See merge request !104
parents 22da3be7 b1765758
Pipeline #635111 passed with stage
in 1 minute and 35 seconds
image: python:latest
stages:
- validate
before_script:
- python -V
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
validate:
stage:
validate
tags:
- runner:docker
parallel:
matrix:
- KIND: "Ontologies"
- KIND: "Profiles"
- KIND: "Rules"
- KIND: "Terms"
- KIND: "Vocabularies"
variables:
TTLNAME: "*.ttl"
FAILONERROR: 1
JUNITREPORT: .out/report.xml
script:
- pip install pyshacl
- TTLDIR=`echo "$KIND" | awk '{ print tolower($1) }'`
- mkdir -p ".out/$TTLDIR"
- |
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" >> $JUNITREPORT
echo "<testsuites id=\"$(date -Iseconds)\" name=\"RDF Validation\">" >> $JUNITREPORT
echo "<testsuite id=\"shapevalidation.$KIND\" name=\"$KIND Validation\">" >> $JUNITREPORT
FAIL=0
for RDFFILE in $(find "$TTLDIR" -name "$TTLNAME");
do
REPORT=".out/$RDFFILE.report"
mkdir -p $(dirname $REPORT) ; touch $(basename $REPORT)
pyshacl -i rdfs $RDFFILE >> $REPORT 2>&1 || FAIL=1 ; (exit 0)
echo "<testcase id=\"$RDFFILE\" name=\"$RDFFILE\">" >> $JUNITREPORT
if [[ "$(tail $REPORT)" =~ "Conforms: True" ]]
then
echo "- [OK] \"$RDFFILE\" conforms!"
else
echo "- [ERROR] \"$RDFFILE\" does not conform!"
MSG="Validation Error"
if [[ "$(tail $REPORT)" =~ (rdflib\.plugins)(.*\n*)* ]]; then
MSG=`echo "${BASH_REMATCH[0]}" | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&#39;/g'`
echo "${BASH_REMATCH[0]}"
fi
echo "<failure message=\"Validation Error\" type=\"ERROR\">"$MSG"</failure>" >> $JUNITREPORT
fi
echo "</testcase>" >> $JUNITREPORT
done
echo "</testsuite>" >> $JUNITREPORT
echo "</testsuites>" >> $JUNITREPORT
mkdir -p $(dirname .out/$KIND)
cp $JUNITREPORT .out/$KIND.xml
(exit $(($FAILONERROR && $FAIL)))
artifacts:
paths:
- .out
expire_in: 1 day
when: always
reports:
junit: $JUNITREPORT
......@@ -47,6 +47,23 @@ prefixes:prefixes
""" ;
] ;
# fileName
sh:rule [
a sh:SPARQLRule ;
rdfs:label "Construct fileName" ;
sh:prefixes prefixes:prefixes ;
sh:construct """
CONSTRUCT {
$this coscinesearch:fileName ?fileName
}
WHERE {
$this a ?profile .
?profile a sh:NodeShape .
BIND(STRAFTER(STR($this), "@path=") AS ?fileName)
}
""" ;
] ;
# is public
#sh:rule [
# a sh:SPARQLRule ;
......
@base <https://purl.org/coscine/terms/mode/> .
@base <https://purl.org/coscine/terms/mode/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix coscinemode: <https://purl.org/coscine/terms/mode#> .
......@@ -23,4 +23,4 @@ coscinemode:experiment
coscinemode:analysis
rdfs:label "Analysis"@en ;
rdfs:label "Analyse"@de ;
a <https://purl.org/coscine/terms/mode/> .
\ No newline at end of file
a <https://purl.org/coscine/terms/mode/> .
@base <https://purl.org/coscine/terms/types/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix coscinetypes: <https://purl.org/coscine/terms/types#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
<https://purl.org/coscine/terms/types/>
dcterms:license <http://spdx.org/licenses/MIT> ;
dcterms:publisher <https://itc.rwth-aachen.de/> ;
dcterms:rights "Copyright © 2022 IT Center, RWTH Aachen University" ;
dcterms:title "Types"@en .
coscinetypes:Vocabulary
rdfs:label "Vocabulary"@en ;
rdfs:label "Vokabular"@de ;
a <https://purl.org/coscine/terms/types/> .
coscinetypes:ApplicationProfile
rdfs:label "Application Profile"@en ;
rdfs:label "Applikationsprofil"@de ;
a <https://purl.org/coscine/terms/types/> .
@base <https://purl.org/coscine/vocabulary/din4000-128/G8/> .
@prefix coscinetype: <https://purl.org/coscine/terms/types#> .
<https://purl.org/coscine/vocabulary/din4000-128/G8/>
a coscinetype:Vocabulary .
@base <https://purl.org/coscine/vocabulary/din4000-128/J5/> .
@prefix coscinetype: <https://purl.org/coscine/terms/types#> .
<https://purl.org/coscine/vocabulary/din4000-128/J5/>
a coscinetype:Vocabulary .
@base <https://purl.org/coscine/vocabulary/din4000-128/J8/> .
@prefix coscinetype: <https://purl.org/coscine/terms/types#> .
<https://purl.org/coscine/vocabulary/din4000-128/J8/>
a coscinetype:Vocabulary .
@base <http://purl.org/auto/criticality_phenomena#Criticality_Phenomenon> .
@prefix coscinetype: <https://purl.org/coscine/terms/types#> .
<http://purl.org/auto/criticality_phenomena#Criticality_Phenomenon>
a coscinetype:Vocabulary .
@base <http://purl.org/dc/dcmitype/> .
@prefix coscinetype: <https://purl.org/coscine/terms/types#> .
<http://purl.org/dc/dcmitype/>
a coscinetype:Vocabulary .
@base <http://purl.org/dc/dcmitype/> .
@base <http://purl.org/dc/dcmitype/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
......
@base <http://www.dfg.de/dfg_profil/gremien/fachkollegien/faecher/> .
@prefix coscinetype: <https://purl.org/coscine/terms/types#> .
<http://www.dfg.de/dfg_profil/gremien/fachkollegien/faecher/>
a coscinetype:Vocabulary .
@base <http://purl.org/coscine/vocabularies/isf/> .
@prefix coscinetype: <https://purl.org/coscine/terms/types#> .
<http://purl.org/coscine/vocabularies/isf/>
a coscinetype:Vocabulary .
@base <http://purl.org/coscine/vocabularies/isf/> .
@base <http://purl.org/coscine/vocabularies/isf/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
......
@base <http://spdx.org/licenses/> .
@prefix coscinetype: <https://purl.org/coscine/terms/types#> .
<http://spdx.org/licenses/>
a coscinetype:Vocabulary .
@base <http://spdx.org/licenses/> .
@base <http://spdx.org/licenses/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
......
@base <https://www.iana.org/assignments/media-types/> .
@prefix coscinetype: <https://purl.org/coscine/terms/types#> .
<https://www.iana.org/assignments/media-types/>
a coscinetype:Vocabulary .
@base <https://www.iana.org/assignments/media-types/> .
@base <https://www.iana.org/assignments/media-types/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
......
@base <http://purl.org/coscine/vocabularies/sfb1394/> .
@prefix coscinetype: <https://purl.org/coscine/terms/types#> .
<http://purl.org/coscine/vocabularies/sfb1394/>
a coscinetype:Vocabulary .
@base <http://purl.org/coscine/vocabularies/sfb1394/> .
@base <http://purl.org/coscine/vocabularies/sfb1394/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment