Skip to content

Commit

Permalink
Allow some more properties for describing the concept scheme #14
Browse files Browse the repository at this point in the history
  • Loading branch information
sroertgen committed Apr 22, 2024
1 parent e41c74b commit 9fe2940
Show file tree
Hide file tree
Showing 4 changed files with 217 additions and 17 deletions.
64 changes: 47 additions & 17 deletions skohub.shacl.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@prefix dct: <http://purl.org/dc/terms/> .
@prefix sdo: <https://schema.org> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .

# rdfs:comment holds info with what file under ./tests/invalid/skohub.shacl.ttl
# the constraint is tested
Expand All @@ -17,14 +18,32 @@
:ConceptSchemeShape
a sh:NodeShape ;
sh:targetClass skos:ConceptScheme ;
sh:property [
sh:path dct:title ;
sh:minCount 1;
sh:datatype rdf:langString ;
sh:message "Concept Scheme has no dct:title with a language tag!" ;
sh:severity sh:Violation ;
rdfs:comment "Tested with 01_cs_no_title.ttl" ;
] ;
sh:or (
[
sh:path dct:title ;
sh:minCount 1;
sh:datatype rdf:langString ;
sh:message "Concept Scheme has no dct:title with a language tag!" ;
sh:severity sh:Violation ;
rdfs:comment "Tested with 01_cs_no_title.ttl" ;
]
[
sh:path skos:prefLabel ;
sh:minCount 1;
sh:datatype rdf:langString ;
sh:message "Concept Scheme has no skos:prefLabel with a language tag!" ;
sh:severity sh:Violation ;
rdfs:comment "Tested with 01_cs_no_title.ttl" ;
]
[
sh:path dc:title ;
sh:minCount 1;
sh:datatype rdf:langString ;
sh:message "Concept Scheme has no dc:title with a language tag!" ;
sh:severity sh:Violation ;
rdfs:comment "Tested with 01_cs_no_title.ttl" ;
]
);
sh:property [
sh:path skos:hasTopConcept ;
sh:minCount 1 ;
Expand All @@ -40,15 +59,26 @@
sh:message "The target class for hasTopConcept should be skos:Concept" ;
rdfs:comment "Tested with 03_cs_target_class_hasTopConcept.ttl" ;
] ;
sh:property [
sh:path dct:description ;
sh:datatype rdf:langString ;
sh:severity sh:Warning ;
sh:minCount 1 ;
sh:message: "A description of the Concept Scheme should be provided." ;
rdfs:comment "Tested with 04_cs_no_description.ttl" ;
rdfs:comment "Tested with 05_cs_description_no_langstring.ttl" ;
] ;
sh:or (
[
sh:path dct:description ;
sh:datatype rdf:langString ;
sh:severity sh:Warning ;
sh:minCount 1 ;
sh:message: "A description of the Concept Scheme should be provided." ;
rdfs:comment "Tested with 04_cs_no_description.ttl" ;
rdfs:comment "Tested with 05_cs_description_no_langstring.ttl" ;
]
[
sh:path dc:description ;
sh:datatype rdf:langString ;
sh:severity sh:Warning ;
sh:minCount 1 ;
sh:message: "A description of the Concept Scheme should be provided." ;
rdfs:comment "Tested with 04_cs_no_description.ttl" ;
rdfs:comment "Tested with 05_cs_description_no_langstring.ttl" ;
]
) ;
sh:property [
sh:path dct:license ;
sh:minCount 1 ;
Expand Down
56 changes: 56 additions & 0 deletions tests/valid/skohub.shacl.ttl/02_valid_skohub_file_cs_prefLabel.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
@base <http://w3id.org/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix schema: <http://schema.org/> .
@prefix vann: <http://purl.org/vocab/vann/> .

# This Concept Scheme has a skos:prefLabel

<> a skos:ConceptScheme ;
skos:prefLabel "Test Vokabular"@de, "Test Vocabulary"@en ;
dct:description "Test Beschreibung"@de, "Test Description"@en ;
dct:issued "2019-12-11" ;
dct:publisher <https://oerworldmap.org/resource/urn:uuid:fd06253e-fe67-4910-b923-51db9d27e59f> ;
dct:license <http://creativecommons.org/licenses/by/4.0/> ;
vann:preferredNamespaceUri "https://w3id.org/test" ;
skos:hasTopConcept <c1> .

<c1> a skos:Concept ;
skos:prefLabel "Konzept 1"@de, "Concept 1"@en ;
skos:altLabel "Alternativbezeichnung 1"@de, "Alternativbezeichnung 2"@de, "Alt Label 1"@en ;
skos:hiddenLabel "Verstecktes Label 1"@de, "Verstecktes Label 2"@de ;
skos:definition "Meine Definition"@de ;
skos:scopeNote "Meine Scope Note"@de ;
skos:note "Meine Anmerkung"@de ;
skos:notation "1", "notation" ;
skos:example "Ein Beispiel"@de ;
skos:narrower <c2> ;
skos:narrowerTransitive <c2> ;
skos:narrowMatch <https://my-iri.org/> ;
skos:related <c4> ;
skos:relatedMatch <https://my-iri.org/> ;
skos:closeMatch <https://my-iri.org/> ;
skos:exactMatch <https://my-iri.org/> ;
skos:topConceptOf <> .

<c2> a skos:Concept ;
skos:prefLabel "Konzept 2"@de, "Concept 2"@en ;
skos:narrower <c3> ;
skos:broader <c1> ;
skos:broaderTransitive <c1> ;
skos:broadMatch <https://my-iri.org/> ;
skos:inScheme <> .

<c3> a skos:Concept ;
skos:prefLabel "Konzept 3"@de ;
skos:broader <c2> ;
skos:inScheme <> .

<c4> a skos:Concept ;
skos:prefLabel "Konzept 4"@de ;
skos:broader <c2> ;
skos:inScheme <> .

<collection> a skos:Collection ;
skos:prefLabel "Meine Collection"@de, "My Collection"@en ;
skos:member <c1>, <c2> .
57 changes: 57 additions & 0 deletions tests/valid/skohub.shacl.ttl/03_valid_skohub_file_cs_dctitle.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@base <http://w3id.org/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix schema: <http://schema.org/> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .

# This Concept Scheme has a dc:title field

<> a skos:ConceptScheme ;
dc:title "Test Vokabular"@de, "Test Vocabulary"@en ;
dct:description "Test Beschreibung"@de, "Test Description"@en ;
dct:issued "2019-12-11" ;
dct:publisher <https://oerworldmap.org/resource/urn:uuid:fd06253e-fe67-4910-b923-51db9d27e59f> ;
dct:license <http://creativecommons.org/licenses/by/4.0/> ;
vann:preferredNamespaceUri "https://w3id.org/test" ;
skos:hasTopConcept <c1> .

<c1> a skos:Concept ;
skos:prefLabel "Konzept 1"@de, "Concept 1"@en ;
skos:altLabel "Alternativbezeichnung 1"@de, "Alternativbezeichnung 2"@de, "Alt Label 1"@en ;
skos:hiddenLabel "Verstecktes Label 1"@de, "Verstecktes Label 2"@de ;
skos:definition "Meine Definition"@de ;
skos:scopeNote "Meine Scope Note"@de ;
skos:note "Meine Anmerkung"@de ;
skos:notation "1", "notation" ;
skos:example "Ein Beispiel"@de ;
skos:narrower <c2> ;
skos:narrowerTransitive <c2> ;
skos:narrowMatch <https://my-iri.org/> ;
skos:related <c4> ;
skos:relatedMatch <https://my-iri.org/> ;
skos:closeMatch <https://my-iri.org/> ;
skos:exactMatch <https://my-iri.org/> ;
skos:topConceptOf <> .

<c2> a skos:Concept ;
skos:prefLabel "Konzept 2"@de, "Concept 2"@en ;
skos:narrower <c3> ;
skos:broader <c1> ;
skos:broaderTransitive <c1> ;
skos:broadMatch <https://my-iri.org/> ;
skos:inScheme <> .

<c3> a skos:Concept ;
skos:prefLabel "Konzept 3"@de ;
skos:broader <c2> ;
skos:inScheme <> .

<c4> a skos:Concept ;
skos:prefLabel "Konzept 4"@de ;
skos:broader <c2> ;
skos:inScheme <> .

<collection> a skos:Collection ;
skos:prefLabel "Meine Collection"@de, "My Collection"@en ;
skos:member <c1>, <c2> .
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@base <http://w3id.org/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix schema: <http://schema.org/> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .

# Concept Scheme has a dc:description

<> a skos:ConceptScheme ;
dct:title "Test Vokabular"@de, "Test Vocabulary"@en ;
dc:description "Test Beschreibung"@de, "Test Description"@en ;
dct:issued "2019-12-11" ;
dct:publisher <https://oerworldmap.org/resource/urn:uuid:fd06253e-fe67-4910-b923-51db9d27e59f> ;
dct:license <http://creativecommons.org/licenses/by/4.0/> ;
vann:preferredNamespaceUri "https://w3id.org/test" ;
skos:hasTopConcept <c1> .

<c1> a skos:Concept ;
skos:prefLabel "Konzept 1"@de, "Concept 1"@en ;
skos:altLabel "Alternativbezeichnung 1"@de, "Alternativbezeichnung 2"@de, "Alt Label 1"@en ;
skos:hiddenLabel "Verstecktes Label 1"@de, "Verstecktes Label 2"@de ;
skos:definition "Meine Definition"@de ;
skos:scopeNote "Meine Scope Note"@de ;
skos:note "Meine Anmerkung"@de ;
skos:notation "1", "notation" ;
skos:example "Ein Beispiel"@de ;
skos:narrower <c2> ;
skos:narrowerTransitive <c2> ;
skos:narrowMatch <https://my-iri.org/> ;
skos:related <c4> ;
skos:relatedMatch <https://my-iri.org/> ;
skos:closeMatch <https://my-iri.org/> ;
skos:exactMatch <https://my-iri.org/> ;
skos:topConceptOf <> .

<c2> a skos:Concept ;
skos:prefLabel "Konzept 2"@de, "Concept 2"@en ;
skos:narrower <c3> ;
skos:broader <c1> ;
skos:broaderTransitive <c1> ;
skos:broadMatch <https://my-iri.org/> ;
skos:inScheme <> .

<c3> a skos:Concept ;
skos:prefLabel "Konzept 3"@de ;
skos:broader <c2> ;
skos:inScheme <> .

<c4> a skos:Concept ;
skos:prefLabel "Konzept 4"@de ;
skos:broader <c2> ;
skos:inScheme <> .

<collection> a skos:Collection ;
skos:prefLabel "Meine Collection"@de, "My Collection"@en ;
skos:member <c1>, <c2> .

0 comments on commit 9fe2940

Please sign in to comment.