-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathosm-wiki-onto2023.shacl.ttl
79 lines (70 loc) · 2.54 KB
/
osm-wiki-onto2023.shacl.ttl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX osma: <https://example.org/todo-onto-toplevel/>
PREFIX osmnode: <https://www.openstreetmap.org/node/>
PREFIX osmrel: <https://www.openstreetmap.org/relation/>
PREFIX osmway: <https://www.openstreetmap.org/way/>
PREFIX osmm: <https://example.org/todo-meta/>
PREFIX osmt: <https://wiki.openstreetmap.org/wiki/Key:>
PREFIX osmsh: <https://www.openstreetmap.org/validation/shacl/>
PREFIX osmw: <https://wiki.openstreetmap.org/wiki/>
PREFIX osmx: <https://example.org/todo-xref/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX schema: <https://schema.org/>
PREFIX time: <http://www.w3.org/2006/time#>
PREFIX wikidata: <http://www.wikidata.org/entity/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
# osmw: -> exist page on Wiki
# osma: -> no page on Wiki (example: osma:Collection)
# Inspired by https://www.w3.org/ns/shacl.ttl
osmsh:
a owl:Ontology ;
rdfs:label "OpenStreetMap Wiki base elements SHACL"@en ;
rdfs:comment "This vocabulary defines terms used in SHACL, the W3C Shapes Constraint Language."@en ;
sh:declare [
sh:prefix "osmsh" ;
sh:namespace "https://www.openstreetmap.org/validation/shacl/" ;
] ;
.
osmsh:ShNode
a sh:NodeShape ;
sh:targetClass osmw:Node ;
sh:property [
sh:path osmm:loc ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:datatype geo:wktLiteral ;
sh:message "Node without coordinates or wrong type"@en ;
sh:severity sh:Violation ;
] ;
.
osmsh:ShWay
a sh:NodeShape ;
sh:targetClass osmw:Way ;
sh:property [
sh:path osmx:hasnodes ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:message "Way without nodes"@en ;
# @FIXME check minimal number of ordered nodes
sh:severity sh:Violation ;
] ;
.
osmsh:ShRelation
a sh:NodeShape ;
sh:targetClass osmw:Relation ;
sh:property [
sh:path osmx:hasmembers ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:message "Relation without members"@en ;
# @FIXME check minimal number of members
sh:severity sh:Violation ;
] ;
.
# shacl validate --shapes poc/osm-wiki-onto2023.shacl.ttl --data proposal/node-1.ttl
# shacl validate --shapes poc/osm-wiki-onto2023.shacl.ttl --data proposal/shacl/tests/osm-wiki-onto2023.tdata.ttl
# rdfpipe proposal/shacl/tests/osm-wiki-onto2023.tdata.ttl