Skip to content

Commit

Permalink
[#6] A concept must be declared before being used in a model. Bump ve…
Browse files Browse the repository at this point in the history
…rsion to 1.6.1
  • Loading branch information
psiotwo committed Apr 23, 2021
1 parent ad3f051 commit 2556ba0
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ compileJava {
}

group 'com.github.sgov'
version = '1.6.0'
version = '1.6.1'

test {
useJUnitPlatform()
Expand Down
30 changes: 30 additions & 0 deletions src/main/resources/rules/s3.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix j-sgov-obecný: <https://slovník.gov.cz/jazyk/obecný/> .

j-sgov-obecný:s2
a sh:NodeShape ;
sh:severity sh:Warning ;
sh:message "Nedeklarovaný pojem je použit ve slovníku."@cs,
"Non-declared concept is used in a vocabulary."@en ;
sh:targetClass skos:Concept ;
sh:sparql [ a sh:SPARQLConstraint ;
sh:select """
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX z-sgov-pojem: <https://slovník.gov.cz/základní/pojem/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
select $this (?g AS ?value) where {
GRAPH ?g {
{
?s ?p ?o .
} UNION {
?o ?p ?s .
}
FILTER(regex(str(?s),"https://slovník.gov.cz/.*/pojem/.*"))
FILTER(!strstarts(str(?s),"https://slovník.gov.cz/základní"))
FILTER NOT EXISTS {
?s skos:inScheme ?g2
}
}
} GROUP BY ?g $this""" ; ]
.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@prefix : <https://slovník.gov.cz/příklad/pojem/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix dc: <http://purl.org/dc/terms/> .

:volby-do-poslanecké-sněmovny-parlamentu-české-republiky
a skos:Concept ;
1 change: 1 addition & 0 deletions src/test/resources/test-cases.csv
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ m7.ttl ,rule-test-cases/category-specializing-kind.ttl ,Violation
s2.ttl,rule-test-cases/concept-with-invalid-iri.ttl ,Violation
s2.ttl,rule-test-cases/concept-with-valid-iri.ttl ,Pass
s2.ttl,rule-test-cases/concept-with-comma-in-iri.ttl ,Pass
s3.ttl,rule-test-cases/concept-without-declaration-used.ttl ,Warning

0 comments on commit 2556ba0

Please sign in to comment.