-
Notifications
You must be signed in to change notification settings - Fork 3
/
regional-rules.owl.yml
353 lines (290 loc) · 9.33 KB
/
regional-rules.owl.yml
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
---
# This yml-file models which rules ("directives") apply in which regions, while taking a given structure for geographic
# entities into account (District ∈ FederalState ∈ NationalState). Its main purpose is to explore which OWL-features
# are most important for this purpose and how they could be represented in YAML.
# The background motivation for modeling region-dependent rules is to formally represent different regulations in
# different regions of germany during COVID19 pandemic.
- iri: "https://w3id.org/yet/undefined/regional-rules-ontology#"
- multiple_owl_classes:
- GeographicEntity:
SubClassOf: "owl:Thing"
- NationalState:
SubClassOf: GeographicEntity
- FederalState:
SubClassOf: GeographicEntity
- District:
SubClassOf: GeographicEntity
- LocationType:
SubClassOf: "owl:Thing"
- Facility:
SubClassOf: "owl:Thing"
- TrainStation:
SubClassOf:
- Facility
- LocationType
# <Public Management>
- Document:
SubClassOf: "owl:Thing"
- DirectiveSourceDocument:
# source or reference document for rules
SubClassOf: Document
# </Public Management>
- Directive:
SubClassOf: "owl:Thing"
- Debug:
# A dummy class used for debugging. This will be removed in the future
SubClassOf: "owl:Thing"
#
# ######################################################################################################################
#
- owl_object_property:
hasPart:
Domain: GeographicEntity
Range: GeographicEntity
Characteristics:
- Transitive
- owl_inverse_property:
isPartOf:
Domain: GeographicEntity
Range: GeographicEntity
Characteristics:
- Transitive
Inverse: hasPart
- owl_object_property:
hasDirective:
Domain: GeographicEntity
Range: Directive
- owl_object_property:
appliesTo:
Domain: DirectiveSourceDocument
Range: GeographicEntity
- owl_object_property:
affects:
# model if a geographic entity is affected by a rule (typically from another ge)
Domain: Directive
Range: GeographicEntity
- owl_object_property:
hasSourceDocument:
Domain: "owl:Thing"
Range: Document
Characteristics:
- Functional
- owl_data_property:
hasSection:
Domain: "owl:Thing"
Range: str
Characteristics:
- Functional
# The following properties are meant to be uses with RelationConcepts. They should thus have
# `Domain: X_InterRegionRelation_RC`
# However, this class is only defined below. Temporary Workaround: `Domain: "owl:Thing"`
- owl_object_property:
hasIRRTarget:
# Domain: X_InterRegionRelation_RC
Domain: "owl:Thing"
Range: GeographicEntity
Characteristics:
- Functional
- owl_data_property:
hasIRRValue:
# Domain: X_InterRegionRelation_RC
Domain: "owl:Thing"
Range: float
Characteristics:
- Functional
- owl_data_property:
hasTestValue1:
# Domain: X_Testing_RC
Domain: "owl:Thing"
Range: int
Characteristics:
- Functional
- owl_data_property:
hasTestValue2:
# Domain: X_Testing_RC
Domain: "owl:Thing"
Range: float
Characteristics:
- Functional
- multiple_owl_classes:
# <Relation-Concepts>
# These concepts model n-ary relations, see https://www.w3.org/TR/swbp-n-aryRelations/#pattern1
- X_RelationConcept:
SubClassOf: "owl:Thing"
- X_DocumentReference_RC:
SubClassOf: X_RelationConcept
# note: yamlpyowl will automatically create a role `X_hasDocumentReference_RC`
X_associatedWithClasses:
- Directive
- X_InterRegionRelation_RC:
SubClassOf: X_RelationConcept
# model a numerical relation between Regions. Say munich -> ([dresden, zwickau, passau], 0.5)
X_associatedWithClasses:
- GeographicEntity
- X_Testing_RC:
SubClassOf: X_RelationConcept
X_associatedWithClasses:
Or:
- Directive
- Facility
# </Relation-Concepts>
# ######################################################################################################################
- owl_multiple_individuals:
names:
- leipzig
- dresden
- bautzen
- zwickau
- erzgebirgskreis
- goerlitz
- erlangen
- munich
- regensburg
- rosenheim
- hof
- passau
- bamberg
types:
- District
# federal states
- owl_multiple_individuals:
names:
- saxony
- bavaria
types:
- FederalState
- owl_individual:
germany:
types:
- NationalState
label:
- Federal Republic of Germany
- Bundesrepublik Deutschland
- property_facts:
hasPart:
Facts:
- saxony:
- leipzig
- dresden
- bautzen
- zwickau
- erzgebirgskreis
- goerlitz
- bavaria:
- erlangen
- munich
- regensburg
- rosenheim
- hof
- passau
- bamberg
- germany:
- bavaria
- saxony
# source documents
- owl_multiple_individuals:
names:
- law_book_of_germany
- law_book_of_saxony
- law_book_of_bavaria
- law_book_of_dresden
- partially_redundant_law_book_of_dresden
types:
- DirectiveSourceDocument
- property_facts:
appliesTo:
Facts:
- law_book_of_germany:
- germany
- law_book_of_saxony:
- saxony
- law_book_of_bavaria:
- bavaria
- law_book_of_dresden:
- dresden
- partially_redundant_law_book_of_dresden:
- dresden
# directives
- owl_multiple_individuals:
names:
- dir_rule0
- dir_rule1
- dir_rule2
- dir_rule3
- dir_rule4
types:
- Directive
- relation_concept_facts:
dir_rule1:
# ternary relation. Meaning: <Directive dir_rule1> is specified in "§1.3" of law_book_of_germany
X_hasDocumentReference_RC:
- hasSourceDocument: law_book_of_germany
hasSection: "§ 1.1"
dir_rule2:
X_hasDocumentReference_RC:
- hasSourceDocument: law_book_of_saxony
hasSection: "§ 1.5"
dir_rule3:
X_hasDocumentReference_RC:
- hasSourceDocument: law_book_of_dresden
hasSection: "§ 42"
dir_rule4:
X_hasDocumentReference_RC:
# this list syntax allows to specify several RC-objects at once
- hasSourceDocument: law_book_of_dresden
hasSection: "§ 100"
- hasSourceDocument: partially_redundant_law_book_of_dresden
hasSection: "§ 200"
# ######################################################################################################################
- swrl_rule:
name: top_down
label: "Meaning: A directive which is valid in a GeographicEntity is valid in all its parts as well"
src: "GeographicEntity(?ge), hasPart(?ge, ?p), hasDirective(?ge, ?r) -> hasDirective(?p, ?r)"
- swrl_rule:
name: applicable_doc
label: "Meaning: All directives which reference a DirectiveSourceDocument should apply in the GeographicEntities"
src: >
Directive(?d), X_hasDocumentReference_RC(?d, ?dr), hasSourceDocument(?dr, ?doc),
appliesTo(?doc, ?ge) -> hasDirective(?ge, ?d)
- swrl_rule:
name: affected_regions
label: >
Every GeographicEntity which has an InterRegionalRelation with an GeographicEntity where dir_rule3 applies
'is affected' by that rule
src: >
hasDirective(?ge1, dir_rule3), X_hasInterRegionRelation_RC(?ge1, ?xirr), hasIRRTarget(?xirr, ?ge2),
hasIRRValue(?xirr, ?v), greaterThan(?v, 0.3) -> affects(dir_rule3, ?ge2)
# ######################################################################################################################
## end of static part of knowledge
## the data below describes statements which might be subject to change ("stipulations")
# ######################################################################################################################
- property_facts:
hasDirective:
Facts:
- germany:
- dir_rule0
- munich:
- dir_rule2
- dir_rule3
- relation_concept_facts:
munich:
X_hasInterRegionRelation_RC:
# it follows a lists of len2-dicts
- hasIRRTarget: dresden
hasIRRValue: 0.5
- hasIRRTarget: passau
hasIRRValue: 0.4
- hasIRRTarget: regensburg
hasIRRValue: 0.7
- hasIRRTarget: leipzig
hasIRRValue: 0.2
- swrl_rule:
name: debug
src: "Debug(?d) -> hasTestValue1(?d, 1)"
- owl_multiple_individuals:
names:
- debug1
- debug2
- debug3
types:
- Debug