eyeling 1.13.2 → 1.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,7 @@
25
25
  # - N3 spec: https://w3c.github.io/N3/spec/
26
26
  # - Eyeling builtins: https://eyereasoner.github.io/eyeling/HANDBOOK#ch11
27
27
  # - ODRL vocab: https://www.w3.org/TR/odrl-vocab/
28
- # - DPV risk module: https://w3c.github.io/dpv/2.0/dpv/modules/risk.html
28
+ # - DPV risk module: https://dev.dpvcg.org/dpv/modules/risk
29
29
  # - DPV-RISK: https://w3id.org/dpv/risk
30
30
  # ===========================================================================================
31
31
 
@@ -34,7 +34,6 @@
34
34
  @prefix dpv: <https://w3id.org/dpv#> .
35
35
  @prefix risk: <https://w3id.org/dpv/risk#> .
36
36
  @prefix dct: <http://purl.org/dc/terms/> .
37
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
38
37
  @prefix log: <http://www.w3.org/2000/10/swap/log#> .
39
38
  @prefix math: <http://www.w3.org/2000/10/swap/math#> .
40
39
  @prefix string:<http://www.w3.org/2000/10/swap/string#> .
@@ -44,7 +43,7 @@
44
43
  # 1) Consumer profile (needs)
45
44
  # ---------------------------
46
45
 
47
- :ConsumerExample a :ConsumerProfile ;
46
+ :ConsumerExample a :ConsumerProfile, odrl:Party ;
48
47
  dct:title "Example consumer profile" ;
49
48
  :hasNeed :Need_DataCannotBeRemoved,
50
49
  :Need_ChangeOnlyWithPriorNotice,
@@ -52,20 +51,20 @@
52
51
  :Need_DataPortability .
53
52
 
54
53
  :Need_DataCannotBeRemoved a :Need ;
55
- :importance "20"^^xsd:integer ;
54
+ :importance 20 ;
56
55
  dct:description "Provider must not remove the consumer account/data." .
57
56
 
58
57
  :Need_ChangeOnlyWithPriorNotice a :Need ;
59
- :importance "15"^^xsd:integer ;
60
- :minNoticeDays "14"^^xsd:integer ;
58
+ :importance 15 ;
59
+ :minNoticeDays 14 ;
61
60
  dct:description "Agreement may change only with prior notice (>= 14 days)." .
62
61
 
63
62
  :Need_NoSharingWithoutConsent a :Need ;
64
- :importance "12"^^xsd:integer ;
63
+ :importance 12 ;
65
64
  dct:description "No data sharing without explicit consent." .
66
65
 
67
66
  :Need_DataPortability a :Need ;
68
- :importance "10"^^xsd:integer ;
67
+ :importance 10 ;
69
68
  dct:description "Consumer must be able to export their data." .
70
69
 
71
70
  # ------------------------------------------
@@ -84,7 +83,7 @@
84
83
  # Clause C1: remove account/data without safeguards
85
84
  :PermDeleteAccount a odrl:Permission ;
86
85
  odrl:assigner :Provider ;
87
- odrl:assignee odrl:consumer ;
86
+ odrl:assignee :ConsumerExample ;
88
87
  odrl:action tosl:removeAccount ;
89
88
  odrl:target :UserAccount ;
90
89
  :clause :ClauseC1 .
@@ -92,7 +91,7 @@
92
91
  # Clause C2: change terms with noticeDays >= 3 (may be too short for the consumer)
93
92
  :PermChangeTerms a odrl:Permission ;
94
93
  odrl:assigner :Provider ;
95
- odrl:assignee odrl:consumer ;
94
+ odrl:assignee :ConsumerExample ;
96
95
  odrl:action tosl:changeTerms ;
97
96
  odrl:target :AgreementText ;
98
97
  odrl:duty [
@@ -102,7 +101,7 @@
102
101
  a odrl:Constraint ;
103
102
  odrl:leftOperand tosl:noticeDays ;
104
103
  odrl:operator odrl:gteq ;
105
- odrl:rightOperand "3"^^xsd:integer
104
+ odrl:rightOperand 3
106
105
  ]
107
106
  ] ;
108
107
  :clause :ClauseC2 .
@@ -110,7 +109,7 @@
110
109
  # Clause C3: share data without explicit consent safeguard
111
110
  :PermShareData a odrl:Permission ;
112
111
  odrl:assigner :Provider ;
113
- odrl:assignee odrl:consumer ;
112
+ odrl:assignee :ConsumerExample ;
114
113
  odrl:action tosl:shareData ;
115
114
  odrl:target :UserData ;
116
115
  :clause :ClauseC3 .
@@ -118,7 +117,7 @@
118
117
  # Clause C4: prohibit export (hurts portability)
119
118
  :ProhibitExportData a odrl:Prohibition ;
120
119
  odrl:assigner :Provider ;
121
- odrl:assignee odrl:consumer ;
120
+ odrl:assignee :ConsumerExample ;
122
121
  odrl:action tosl:exportData ;
123
122
  odrl:target :UserData ;
124
123
  :clause :ClauseC4 .
@@ -167,6 +166,8 @@
167
166
  (90 ?w) math:sum ?raw .
168
167
  ( :Agreement1 :ConsumerExample :DeleteAccountNoSafeguards ?cid ) log:skolem ?risk .
169
168
  ( :Agreement1 :ConsumerExample :DeleteAccountNoSafeguardsSource ?cid ) log:skolem ?src .
169
+ ( ?risk :M1 ) log:skolem ?m1 .
170
+ ( ?risk :M2 ) log:skolem ?m2 .
170
171
 
171
172
  ( "Risk: account/data removal is permitted without notice safeguards (no notice constraint and no duty to inform). Clause %s: %s"
172
173
  ?cid ?txt ) string:format ?why .
@@ -189,8 +190,6 @@
189
190
 
190
191
  :ProcessContext1 dpv:hasRisk ?risk .
191
192
 
192
- ( ?risk :M1 ) log:skolem ?m1 .
193
- ( ?risk :M2 ) log:skolem ?m2 .
194
193
 
195
194
  ?m1 a dpv:RiskMitigationMeasure ;
196
195
  dct:description "Add a notice constraint (minimum noticeDays) before account removal." ;
@@ -200,7 +199,7 @@
200
199
  a odrl:Constraint ;
201
200
  odrl:leftOperand tosl:noticeDays ;
202
201
  odrl:operator odrl:gteq ;
203
- odrl:rightOperand "14"^^xsd:integer
202
+ odrl:rightOperand 14
204
203
  ] .
205
204
  } .
206
205
 
@@ -242,6 +241,7 @@
242
241
  (70 ?w) math:sum ?raw .
243
242
  ( :Agreement1 :ConsumerExample :NoticeTooShort ?cid ) log:skolem ?risk .
244
243
  ( :Agreement1 :ConsumerExample :NoticeTooShortSource ?cid ) log:skolem ?src .
244
+ ( ?risk :M1 ) log:skolem ?m1 .
245
245
 
246
246
  ( "Risk: terms may change with notice (%s days) below consumer requirement (%s days). Clause %s: %s"
247
247
  ?days ?req ?cid ?txt ) string:format ?why .
@@ -264,7 +264,6 @@
264
264
 
265
265
  :ProcessContext1 dpv:hasRisk ?risk .
266
266
 
267
- ( ?risk :M1 ) log:skolem ?m1 .
268
267
  ?m1 a dpv:RiskMitigationMeasure ;
269
268
  dct:description "Increase minimum noticeDays in the inform duty to meet the consumer requirement." ;
270
269
  dpv:mitigatesRisk ?risk ;
@@ -276,7 +275,7 @@
276
275
  a odrl:Constraint ;
277
276
  odrl:leftOperand tosl:noticeDays ;
278
277
  odrl:operator odrl:gteq ;
279
- odrl:rightOperand "14"^^xsd:integer
278
+ odrl:rightOperand 14
280
279
  ]
281
280
  ] .
282
281
  } .
@@ -309,6 +308,7 @@
309
308
  (85 ?w) math:sum ?raw .
310
309
  ( :Agreement1 :ConsumerExample :ShareNoConsent ?cid ) log:skolem ?risk .
311
310
  ( :Agreement1 :ConsumerExample :ShareNoConsentSource ?cid ) log:skolem ?src .
311
+ ( ?risk :M1 ) log:skolem ?m1 .
312
312
 
313
313
  ( "Risk: user data sharing is permitted without an explicit consent constraint. Clause %s: %s"
314
314
  ?cid ?txt ) string:format ?why .
@@ -331,7 +331,6 @@
331
331
 
332
332
  :ProcessContext1 dpv:hasRisk ?risk .
333
333
 
334
- ( ?risk :M1 ) log:skolem ?m1 .
335
334
  ?m1 a dpv:RiskMitigationMeasure ;
336
335
  dct:description "Add an explicit consent constraint before data sharing." ;
337
336
  dpv:mitigatesRisk ?risk ;
@@ -364,6 +363,7 @@
364
363
  (60 ?w) math:sum ?raw .
365
364
  ( :Agreement1 :ConsumerExample :NoPortability ?cid ) log:skolem ?risk .
366
365
  ( :Agreement1 :ConsumerExample :NoPortabilitySource ?cid ) log:skolem ?src .
366
+ ( ?risk :M1 ) log:skolem ?m1 .
367
367
 
368
368
  ( "Risk: portability is restricted because exporting user data is prohibited. Clause %s: %s"
369
369
  ?cid ?txt ) string:format ?why .
@@ -386,7 +386,6 @@
386
386
 
387
387
  :ProcessContext1 dpv:hasRisk ?risk .
388
388
 
389
- ( ?risk :M1 ) log:skolem ?m1 .
390
389
  ?m1 a dpv:RiskMitigationMeasure ;
391
390
  dct:description "Add a permission allowing data export (or remove the prohibition) to support portability." ;
392
391
  dpv:mitigatesRisk ?risk ;
@@ -394,7 +393,7 @@
394
393
  :Policy1 odrl:permission [
395
394
  a odrl:Permission ;
396
395
  odrl:assigner :Provider ;
397
- odrl:assignee odrl:consumer ;
396
+ odrl:assignee :ConsumerExample ;
398
397
  odrl:action tosl:exportData ;
399
398
  odrl:target :UserData
400
399
  ] .
@@ -407,19 +406,19 @@
407
406
  # 4) Score normalization + DPV-RISK severity/level
408
407
  # ------------------------------------------------
409
408
 
410
- { ?r a dpv:Risk ; :scoreRaw ?raw . ?raw math:greaterThan "100"^^xsd:integer . }
411
- => { ?r :score "100"^^xsd:integer . } .
409
+ { ?r a dpv:Risk ; :scoreRaw ?raw . ?raw math:greaterThan 100 . }
410
+ => { ?r :score 100 . } .
412
411
 
413
- { ?r a dpv:Risk ; :scoreRaw ?raw . "100"^^xsd:integer math:notLessThan ?raw . }
412
+ { ?r a dpv:Risk ; :scoreRaw ?raw . 100 math:notLessThan ?raw . }
414
413
  => { ?r :score ?raw . } .
415
414
 
416
- { ?r a dpv:Risk ; :score ?s . ?s math:greaterThan "79"^^xsd:integer . }
415
+ { ?r a dpv:Risk ; :score ?s . ?s math:greaterThan 79 . }
417
416
  => { ?r dpv:hasSeverity risk:HighSeverity ; dpv:hasRiskLevel risk:HighRisk . } .
418
417
 
419
- { ?r a dpv:Risk ; :score ?s . ?s math:lessThan "80"^^xsd:integer . ?s math:greaterThan "49"^^xsd:integer . }
418
+ { ?r a dpv:Risk ; :score ?s . ?s math:lessThan 80 . ?s math:greaterThan 49 . }
420
419
  => { ?r dpv:hasSeverity risk:ModerateSeverity ; dpv:hasRiskLevel risk:ModerateRisk . } .
421
420
 
422
- { ?r a dpv:Risk ; :score ?s . ?s math:lessThan "50"^^xsd:integer . }
421
+ { ?r a dpv:Risk ; :score ?s . ?s math:lessThan 50 . }
423
422
  => { ?r dpv:hasSeverity risk:LowSeverity ; dpv:hasRiskLevel risk:LowRisk . } .
424
423
 
425
424
  # ------------------------------------------------------------------------------
@@ -448,14 +447,14 @@
448
447
  dct:description ?why .
449
448
  ?clause :clauseId ?cid .
450
449
 
451
- ( "1000"^^xsd:integer ?score ) math:difference ?inv .
450
+ ( 1000 ?score ) math:difference ?inv .
452
451
 
453
452
  ( "score=%s (%s, %s) clause %s\n %s\n\n"
454
453
  ?score ?lvl ?sev ?cid ?why ) string:format ?line .
455
454
  }
456
455
  =>
457
456
  {
458
- ( :Agreement1 :ConsumerExample 1 ?inv ?r ) log:outputString ?line .
457
+ ( :Agreement1 :ConsumerExample 1 ?inv ?cid 0 ?r ) log:outputString ?line .
459
458
  } .
460
459
 
461
460
  # Mitigation lines (same ordering as their risk)
@@ -467,13 +466,13 @@
467
466
  ?clause :clauseId ?cid .
468
467
  ?m dct:description ?md .
469
468
 
470
- ( "1000"^^xsd:integer ?score ) math:difference ?inv .
469
+ ( 1000 ?score ) math:difference ?inv .
471
470
 
472
471
  ( " - mitigation for clause %s: %s\n"
473
472
  ?cid ?md ) string:format ?mline .
474
473
  }
475
474
  =>
476
475
  {
477
- ( :Agreement1 :ConsumerExample 2 ?inv ?r ) log:outputString ?mline .
476
+ ( :Agreement1 :ConsumerExample 1 ?inv ?cid 1 ?r ?m ) log:outputString ?mline .
478
477
  } .
479
478
 
@@ -0,0 +1,157 @@
1
+ @prefix : <http://example.org/allen#> .
2
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
3
+
4
+ :I :end "2026-02-18T18:00:00+00:00"^^xsd:dateTime .
5
+ :K :end "2026-02-18T14:00:00+00:00"^^xsd:dateTime .
6
+ :I :start "2026-02-18T16:00:00+00:00"^^xsd:dateTime .
7
+ :K :start "2026-02-18T13:30:00+00:00"^^xsd:dateTime .
8
+ :A :duration "PT7200S"^^xsd:duration .
9
+ :B :duration "PT7200S"^^xsd:duration .
10
+ :C :duration "PT7200S"^^xsd:duration .
11
+ :D :duration "PT7200S"^^xsd:duration .
12
+ :E :duration "PT7200S"^^xsd:duration .
13
+ :F :duration "PT3600S"^^xsd:duration .
14
+ :G :duration "PT3600S"^^xsd:duration .
15
+ :H :duration "PT25200S"^^xsd:duration .
16
+ :I :duration "PT7200S"^^xsd:duration .
17
+ :J :duration "PT3600S"^^xsd:duration .
18
+ :K :duration "PT1800S"^^xsd:duration .
19
+ :A :before :B .
20
+ :A :before :I .
21
+ :A :before :J .
22
+ :A :before :K .
23
+ :B :before :I .
24
+ :C :before :I .
25
+ :C :before :J .
26
+ :D :before :I .
27
+ :D :before :J .
28
+ :D :before :K .
29
+ :E :before :B .
30
+ :E :before :I .
31
+ :E :before :J .
32
+ :E :before :K .
33
+ :F :before :B .
34
+ :F :before :C .
35
+ :F :before :I .
36
+ :F :before :J .
37
+ :F :before :K .
38
+ :G :before :B .
39
+ :G :before :I .
40
+ :G :before :J .
41
+ :G :before :K .
42
+ :K :before :I .
43
+ :K :before :J .
44
+ :A :meets :C .
45
+ :B :meets :J .
46
+ :D :meets :B .
47
+ :E :meets :C .
48
+ :F :meets :D .
49
+ :F :meets :G .
50
+ :G :meets :C .
51
+ :H :meets :I .
52
+ :J :meets :I .
53
+ :A :overlaps :D .
54
+ :C :overlaps :B .
55
+ :D :overlaps :C .
56
+ :E :overlaps :D .
57
+ :F :starts :A .
58
+ :F :starts :E .
59
+ :G :starts :D .
60
+ :A :during :H .
61
+ :B :during :H .
62
+ :C :during :H .
63
+ :D :during :H .
64
+ :E :during :H .
65
+ :F :during :H .
66
+ :G :during :H .
67
+ :K :during :B .
68
+ :K :during :H .
69
+ :G :finishes :A .
70
+ :G :finishes :E .
71
+ :J :finishes :H .
72
+ :A :equals :A .
73
+ :A :equals :E .
74
+ :B :equals :B .
75
+ :C :equals :C .
76
+ :D :equals :D .
77
+ :E :equals :A .
78
+ :E :equals :E .
79
+ :F :equals :F .
80
+ :G :equals :G .
81
+ :H :equals :H .
82
+ :I :equals :I .
83
+ :J :equals :J .
84
+ :K :equals :K .
85
+ :B :after :A .
86
+ :I :after :A .
87
+ :J :after :A .
88
+ :K :after :A .
89
+ :I :after :B .
90
+ :I :after :C .
91
+ :J :after :C .
92
+ :I :after :D .
93
+ :J :after :D .
94
+ :K :after :D .
95
+ :B :after :E .
96
+ :I :after :E .
97
+ :J :after :E .
98
+ :K :after :E .
99
+ :B :after :F .
100
+ :C :after :F .
101
+ :I :after :F .
102
+ :J :after :F .
103
+ :K :after :F .
104
+ :B :after :G .
105
+ :I :after :G .
106
+ :J :after :G .
107
+ :K :after :G .
108
+ :I :after :K .
109
+ :J :after :K .
110
+ :C :metBy :A .
111
+ :J :metBy :B .
112
+ :B :metBy :D .
113
+ :C :metBy :E .
114
+ :D :metBy :F .
115
+ :G :metBy :F .
116
+ :C :metBy :G .
117
+ :I :metBy :H .
118
+ :I :metBy :J .
119
+ :D :overlappedBy :A .
120
+ :B :overlappedBy :C .
121
+ :C :overlappedBy :D .
122
+ :D :overlappedBy :E .
123
+ :A :startedBy :F .
124
+ :E :startedBy :F .
125
+ :D :startedBy :G .
126
+ :H :contains :A .
127
+ :H :contains :B .
128
+ :H :contains :C .
129
+ :H :contains :D .
130
+ :H :contains :E .
131
+ :H :contains :F .
132
+ :H :contains :G .
133
+ :B :contains :K .
134
+ :H :contains :K .
135
+ :A :finishedBy :G .
136
+ :E :finishedBy :G .
137
+ :H :finishedBy :J .
138
+ :A :end "2026-02-18T12:00:00+00:00"^^xsd:dateTime .
139
+ :B :end "2026-02-18T15:00:00+00:00"^^xsd:dateTime .
140
+ :C :end "2026-02-18T14:00:00+00:00"^^xsd:dateTime .
141
+ :D :end "2026-02-18T13:00:00+00:00"^^xsd:dateTime .
142
+ :E :end "2026-02-18T12:00:00+00:00"^^xsd:dateTime .
143
+ :F :end "2026-02-18T11:00:00+00:00"^^xsd:dateTime .
144
+ :G :end "2026-02-18T12:00:00+00:00"^^xsd:dateTime .
145
+ :H :end "2026-02-18T16:00:00+00:00"^^xsd:dateTime .
146
+ :J :end "2026-02-18T16:00:00+00:00"^^xsd:dateTime .
147
+ :A :start "2026-02-18T10:00:00+00:00"^^xsd:dateTime .
148
+ :B :start "2026-02-18T13:00:00+00:00"^^xsd:dateTime .
149
+ :C :start "2026-02-18T12:00:00+00:00"^^xsd:dateTime .
150
+ :D :start "2026-02-18T11:00:00+00:00"^^xsd:dateTime .
151
+ :E :start "2026-02-18T10:00:00+00:00"^^xsd:dateTime .
152
+ :F :start "2026-02-18T10:00:00+00:00"^^xsd:dateTime .
153
+ :G :start "2026-02-18T11:00:00+00:00"^^xsd:dateTime .
154
+ :H :start "2026-02-18T09:00:00+00:00"^^xsd:dateTime .
155
+ :J :start "2026-02-18T15:00:00+00:00"^^xsd:dateTime .
156
+ :K :finishes :C .
157
+ :C :finishedBy :K .