eyeling 1.14.6 → 1.14.8
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.
- package/examples/odrl-dpv-ehds-risk-ranked.n3 +38 -58
- package/examples/odrl-dpv-risk-ranked.n3 +37 -55
- package/examples/output/kaprekar.n3 +8010 -8010
- package/examples/output/n3-delegation-access.n3 +7 -7
- package/examples/output/n3-speaks-for-itself.n3 +27 -27
- package/examples/output/odrl-dpv-ehds-risk-ranked.n3 +8 -140
- package/examples/output/odrl-dpv-risk-ranked.n3 +9 -155
- package/examples/output/transcendental-families.n3 +155 -129
- package/examples/output/transcendental-lab.n3 +53 -53
- package/examples/output/transcendental-names-and-families.n3 +131 -104
- package/examples/output/transcendental-numbers-stretched.n3 +112 -112
- package/examples/output/transcendental-numbers.n3 +22 -22
- package/examples/output/wind-turbine.n3 +2 -2
- package/eyeling.js +207 -3
- package/lib/cli.js +8 -0
- package/lib/engine.js +9 -2
- package/lib/printing.js +190 -1
- package/package.json +1 -1
|
@@ -171,22 +171,18 @@
|
|
|
171
171
|
?clause :clauseId ?cid ; :text ?txt .
|
|
172
172
|
|
|
173
173
|
(80 ?w) math:sum ?raw .
|
|
174
|
-
( :AgreementEHDS1 :PatientProfileExample :MissingDataPermit ?cid ) log:skolem ?risk .
|
|
175
|
-
( :AgreementEHDS1 :PatientProfileExample :MissingDataPermitSource ?cid ) log:skolem ?src .
|
|
176
|
-
( ?risk :M1 ) log:skolem ?m1 .
|
|
177
|
-
|
|
178
174
|
( "Risk: secondary use is permitted without an EHDS Data Permit safeguard. Clause %s: %s"
|
|
179
175
|
?cid ?txt ) string:format ?why .
|
|
180
176
|
}
|
|
181
177
|
=>
|
|
182
178
|
{
|
|
183
|
-
|
|
179
|
+
_:srcH1 a risk:RiskSource, risk:LegalComplianceRisk ;
|
|
184
180
|
dct:source :PermSecondaryUseDUA ;
|
|
185
181
|
dct:description "Secondary use permitted without EHDS Data Permit." .
|
|
186
182
|
|
|
187
|
-
|
|
183
|
+
_:riskH1 a dpv:Risk, risk:PolicyRisk ;
|
|
188
184
|
dct:source :PermSecondaryUseDUA ;
|
|
189
|
-
risk:hasRiskSource
|
|
185
|
+
risk:hasRiskSource _:srcH1 ;
|
|
190
186
|
dpv:hasConsequence risk:CustomerConfidenceLoss ;
|
|
191
187
|
dpv:hasImpact risk:FinancialLoss, risk:NonMaterialDamage ;
|
|
192
188
|
:aboutClause ?clause ;
|
|
@@ -194,11 +190,11 @@
|
|
|
194
190
|
:violatesNeed :Need_RequireDataPermit ;
|
|
195
191
|
dct:description ?why .
|
|
196
192
|
|
|
197
|
-
:ProcessContext1 dpv:hasRisk
|
|
193
|
+
:ProcessContext1 dpv:hasRisk _:riskH1 .
|
|
198
194
|
|
|
199
|
-
|
|
195
|
+
_:mH1_1 a dpv:RiskMitigationMeasure ;
|
|
200
196
|
dct:description "Require an EHDS Data Permit (eu-ehds:DataPermit) issued by a Health Data Access Body prior to secondary use." ;
|
|
201
|
-
dpv:mitigatesRisk
|
|
197
|
+
dpv:mitigatesRisk _:riskH1 ;
|
|
202
198
|
:suggestAdd {
|
|
203
199
|
:PermSecondaryUseDUA odrl:constraint [
|
|
204
200
|
a odrl:Constraint ;
|
|
@@ -210,7 +206,7 @@
|
|
|
210
206
|
dct:description "Example placeholder for an issued data permit." .
|
|
211
207
|
} .
|
|
212
208
|
|
|
213
|
-
|
|
209
|
+
_:riskH1 dpv:isMitigatedByMeasure _:mH1_1 .
|
|
214
210
|
} .
|
|
215
211
|
|
|
216
212
|
# R2 (H2): Secondary use allowed WITHOUT an explicit opt-out safeguard (EHDS Art.71 right A71)
|
|
@@ -234,22 +230,18 @@
|
|
|
234
230
|
?clause :clauseId ?cid ; :text ?txt .
|
|
235
231
|
|
|
236
232
|
(75 ?w) math:sum ?raw .
|
|
237
|
-
( :AgreementEHDS1 :PatientProfileExample :MissingOptOutSafeguard ?cid ) log:skolem ?risk .
|
|
238
|
-
( :AgreementEHDS1 :PatientProfileExample :MissingOptOutSafeguardSource ?cid ) log:skolem ?src .
|
|
239
|
-
( ?risk :M1 ) log:skolem ?m1 .
|
|
240
|
-
|
|
241
233
|
( "Risk: secondary use may include patients who opted out (EHDS A71). Clause %s: %s"
|
|
242
234
|
?cid ?txt ) string:format ?why .
|
|
243
235
|
}
|
|
244
236
|
=>
|
|
245
237
|
{
|
|
246
|
-
|
|
238
|
+
_:srcH2 a risk:RiskSource, risk:LegalComplianceRisk ;
|
|
247
239
|
dct:source :PermSecondaryUseAllPatients ;
|
|
248
240
|
dct:description "Opt-out from secondary use not explicitly respected." .
|
|
249
241
|
|
|
250
|
-
|
|
242
|
+
_:riskH2 a dpv:Risk, risk:PolicyRisk, risk:UnwantedDisclosureData ;
|
|
251
243
|
dct:source :PermSecondaryUseAllPatients ;
|
|
252
|
-
risk:hasRiskSource
|
|
244
|
+
risk:hasRiskSource _:srcH2 ;
|
|
253
245
|
dpv:hasConsequence risk:CustomerConfidenceLoss ;
|
|
254
246
|
dpv:hasImpact risk:NonMaterialDamage ;
|
|
255
247
|
:aboutClause ?clause ;
|
|
@@ -257,11 +249,11 @@
|
|
|
257
249
|
:violatesNeed :Need_RespectOptOutSecondaryUse ;
|
|
258
250
|
dct:description ?why .
|
|
259
251
|
|
|
260
|
-
:ProcessContext1 dpv:hasRisk
|
|
252
|
+
:ProcessContext1 dpv:hasRisk _:riskH2 .
|
|
261
253
|
|
|
262
|
-
|
|
254
|
+
_:mH2_1 a dpv:RiskMitigationMeasure ;
|
|
263
255
|
dct:description "Add an explicit safeguard to exclude records of persons who exercised the EHDS opt-out from secondary use (A71)." ;
|
|
264
|
-
dpv:mitigatesRisk
|
|
256
|
+
dpv:mitigatesRisk _:riskH2 ;
|
|
265
257
|
:suggestAdd {
|
|
266
258
|
:PermSecondaryUseAllPatients odrl:constraint [
|
|
267
259
|
a odrl:Constraint ;
|
|
@@ -271,7 +263,7 @@
|
|
|
271
263
|
] .
|
|
272
264
|
} .
|
|
273
265
|
|
|
274
|
-
|
|
266
|
+
_:riskH2 dpv:isMitigatedByMeasure _:mH2_1 .
|
|
275
267
|
} .
|
|
276
268
|
|
|
277
269
|
# R3 (H3): Local download permitted (no secure processing environment safeguard)
|
|
@@ -295,22 +287,18 @@
|
|
|
295
287
|
?clause :clauseId ?cid ; :text ?txt .
|
|
296
288
|
|
|
297
289
|
(70 ?w) math:sum ?raw .
|
|
298
|
-
( :AgreementEHDS1 :PatientProfileExample :InsecureProcessing ?cid ) log:skolem ?risk .
|
|
299
|
-
( :AgreementEHDS1 :PatientProfileExample :InsecureProcessingSource ?cid ) log:skolem ?src .
|
|
300
|
-
( ?risk :M1 ) log:skolem ?m1 .
|
|
301
|
-
|
|
302
290
|
( "Risk: the agreement permits local downloads rather than processing within a secure processing environment. Clause %s: %s"
|
|
303
291
|
?cid ?txt ) string:format ?why .
|
|
304
292
|
}
|
|
305
293
|
=>
|
|
306
294
|
{
|
|
307
|
-
|
|
295
|
+
_:srcH3 a risk:RiskSource, risk:PolicyRisk ;
|
|
308
296
|
dct:source :PermDownloadLocalCopy ;
|
|
309
297
|
dct:description "Local download permitted; secure processing environment not required." .
|
|
310
298
|
|
|
311
|
-
|
|
299
|
+
_:riskH3 a dpv:Risk, risk:UnwantedDisclosureData ;
|
|
312
300
|
dct:source :PermDownloadLocalCopy ;
|
|
313
|
-
risk:hasRiskSource
|
|
301
|
+
risk:hasRiskSource _:srcH3 ;
|
|
314
302
|
dpv:hasConsequence risk:CustomerConfidenceLoss ;
|
|
315
303
|
dpv:hasImpact risk:FinancialLoss, risk:NonMaterialDamage ;
|
|
316
304
|
:aboutClause ?clause ;
|
|
@@ -318,11 +306,11 @@
|
|
|
318
306
|
:violatesNeed :Need_SecureProcessingEnvironment ;
|
|
319
307
|
dct:description ?why .
|
|
320
308
|
|
|
321
|
-
:ProcessContext1 dpv:hasRisk
|
|
309
|
+
:ProcessContext1 dpv:hasRisk _:riskH3 .
|
|
322
310
|
|
|
323
|
-
|
|
311
|
+
_:mH3_1 a dpv:RiskMitigationMeasure ;
|
|
324
312
|
dct:description "Require processing only within a secure processing environment (e.g., eu-dga:SecureProcessingEnvironment), and prohibit local downloads of raw datasets." ;
|
|
325
|
-
dpv:mitigatesRisk
|
|
313
|
+
dpv:mitigatesRisk _:riskH3 ;
|
|
326
314
|
:suggestAdd {
|
|
327
315
|
:ProhibitDownloadLocalCopy a odrl:Prohibition ;
|
|
328
316
|
odrl:assigner :HospitalA ;
|
|
@@ -333,7 +321,7 @@
|
|
|
333
321
|
:ProcessContext1 dpv:hasTechnicalOrganisationalMeasure eu-dga:SecureProcessingEnvironment .
|
|
334
322
|
} .
|
|
335
323
|
|
|
336
|
-
|
|
324
|
+
_:riskH3 dpv:isMitigatedByMeasure _:mH3_1 .
|
|
337
325
|
} .
|
|
338
326
|
|
|
339
327
|
# R4 (H4): Secondary use provided without requiring statistically anonymised data (EHDS HealthDataRequest)
|
|
@@ -357,22 +345,18 @@
|
|
|
357
345
|
?clause :clauseId ?cid ; :text ?txt .
|
|
358
346
|
|
|
359
347
|
(65 ?w) math:sum ?raw .
|
|
360
|
-
( :AgreementEHDS1 :PatientProfileExample :NotStatisticallyAnonymised ?cid ) log:skolem ?risk .
|
|
361
|
-
( :AgreementEHDS1 :PatientProfileExample :NotStatisticallyAnonymisedSource ?cid ) log:skolem ?src .
|
|
362
|
-
( ?risk :M1 ) log:skolem ?m1 .
|
|
363
|
-
|
|
364
348
|
( "Risk: secondary-use dataset is only described as pseudonymised, without a safeguard requiring statistically anonymised data for secondary use. Clause %s: %s"
|
|
365
349
|
?cid ?txt ) string:format ?why .
|
|
366
350
|
}
|
|
367
351
|
=>
|
|
368
352
|
{
|
|
369
|
-
|
|
353
|
+
_:srcH4 a risk:RiskSource, risk:PolicyRisk ;
|
|
370
354
|
dct:source :PermProvidePseudonymisedData ;
|
|
371
355
|
dct:description "Statistical anonymisation safeguard missing for secondary use." .
|
|
372
356
|
|
|
373
|
-
|
|
357
|
+
_:riskH4 a dpv:Risk, risk:UnwantedDisclosureData ;
|
|
374
358
|
dct:source :PermProvidePseudonymisedData ;
|
|
375
|
-
risk:hasRiskSource
|
|
359
|
+
risk:hasRiskSource _:srcH4 ;
|
|
376
360
|
dpv:hasConsequence risk:CustomerConfidenceLoss ;
|
|
377
361
|
dpv:hasImpact risk:NonMaterialDamage ;
|
|
378
362
|
:aboutClause ?clause ;
|
|
@@ -380,11 +364,11 @@
|
|
|
380
364
|
:violatesNeed :Need_StatisticallyAnonymisedSecondaryUse ;
|
|
381
365
|
dct:description ?why .
|
|
382
366
|
|
|
383
|
-
:ProcessContext1 dpv:hasRisk
|
|
367
|
+
:ProcessContext1 dpv:hasRisk _:riskH4 .
|
|
384
368
|
|
|
385
|
-
|
|
369
|
+
_:mH4_1 a dpv:RiskMitigationMeasure ;
|
|
386
370
|
dct:description "Require an EHDS Health Data Request for statistically anonymised data (eu-ehds:HealthDataRequest), and add a constraint that secondary-use data must be statistically anonymised." ;
|
|
387
|
-
dpv:mitigatesRisk
|
|
371
|
+
dpv:mitigatesRisk _:riskH4 ;
|
|
388
372
|
:suggestAdd {
|
|
389
373
|
:PermProvidePseudonymisedData odrl:constraint [
|
|
390
374
|
a odrl:Constraint ;
|
|
@@ -395,7 +379,7 @@
|
|
|
395
379
|
:ProcessContext1 dpv:hasOrganisationalMeasure eu-ehds:HealthDataRequest .
|
|
396
380
|
} .
|
|
397
381
|
|
|
398
|
-
|
|
382
|
+
_:riskH4 dpv:isMitigatedByMeasure _:mH4_1 .
|
|
399
383
|
} .
|
|
400
384
|
|
|
401
385
|
# ------------------------------------------------
|
|
@@ -418,7 +402,8 @@
|
|
|
418
402
|
=> { ?r dpv:hasSeverity risk:LowSeverity ; dpv:hasRiskLevel risk:LowRisk . } .
|
|
419
403
|
|
|
420
404
|
# -------------------------------------------------------------------
|
|
421
|
-
# 5) Ranked explainable output
|
|
405
|
+
# 5) Ranked explainable output via log:query (output selection)
|
|
406
|
+
# - Use `npx eyeling -r` (or `--strings`) to print the strings in key order.
|
|
422
407
|
# -------------------------------------------------------------------
|
|
423
408
|
|
|
424
409
|
# Header
|
|
@@ -428,10 +413,10 @@
|
|
|
428
413
|
( "\n=== Ranked DPV Risk Report (EHDS-aligned) ===\nAgreement: %s\nProfile: %s\n\n"
|
|
429
414
|
?alabel ?plabel ) string:format ?hdr .
|
|
430
415
|
}
|
|
431
|
-
|
|
416
|
+
log:query
|
|
432
417
|
{
|
|
433
418
|
( :AgreementEHDS1 :PatientProfileExample 0 ) log:outputString ?hdr .
|
|
434
|
-
}
|
|
419
|
+
}.
|
|
435
420
|
|
|
436
421
|
# Risk lines (key includes inverse score = 1000 - score)
|
|
437
422
|
{
|
|
@@ -442,16 +427,14 @@
|
|
|
442
427
|
:aboutClause ?clause ;
|
|
443
428
|
dct:description ?why .
|
|
444
429
|
?clause :clauseId ?cid .
|
|
445
|
-
|
|
446
430
|
( 1000 ?score ) math:difference ?inv .
|
|
447
|
-
|
|
448
|
-
( "score=%s (%s, %s) clause %s\n %s\n\n"
|
|
431
|
+
( "score=%s (%s, %s) clause %s\n %s\n\n"
|
|
449
432
|
?score ?lvl ?sev ?cid ?why ) string:format ?line .
|
|
450
433
|
}
|
|
451
|
-
|
|
434
|
+
log:query
|
|
452
435
|
{
|
|
453
436
|
( :AgreementEHDS1 :PatientProfileExample 1 ?inv ?cid 0 ?r ) log:outputString ?line .
|
|
454
|
-
}
|
|
437
|
+
}.
|
|
455
438
|
|
|
456
439
|
# Mitigation lines (same ordering as their risk)
|
|
457
440
|
{
|
|
@@ -461,13 +444,10 @@
|
|
|
461
444
|
:aboutClause ?clause .
|
|
462
445
|
?clause :clauseId ?cid .
|
|
463
446
|
?m dct:description ?md .
|
|
464
|
-
|
|
465
447
|
( 1000 ?score ) math:difference ?inv .
|
|
466
|
-
|
|
467
|
-
( " - mitigation for clause %s: %s\n"
|
|
468
|
-
?cid ?md ) string:format ?mline .
|
|
448
|
+
( " - mitigation for clause %s: %s\n" ?cid ?md ) string:format ?mline .
|
|
469
449
|
}
|
|
470
|
-
|
|
450
|
+
log:query
|
|
471
451
|
{
|
|
472
452
|
( :AgreementEHDS1 :PatientProfileExample 1 ?inv ?cid 1 ?r ?m ) log:outputString ?mline .
|
|
473
|
-
}
|
|
453
|
+
}.
|
|
@@ -164,23 +164,18 @@
|
|
|
164
164
|
?clause :clauseId ?cid ; :text ?txt .
|
|
165
165
|
|
|
166
166
|
(90 ?w) math:sum ?raw .
|
|
167
|
-
( :Agreement1 :ConsumerExample :DeleteAccountNoSafeguards ?cid ) log:skolem ?risk .
|
|
168
|
-
( :Agreement1 :ConsumerExample :DeleteAccountNoSafeguardsSource ?cid ) log:skolem ?src .
|
|
169
|
-
( ?risk :M1 ) log:skolem ?m1 .
|
|
170
|
-
( ?risk :M2 ) log:skolem ?m2 .
|
|
171
|
-
|
|
172
167
|
( "Risk: account/data removal is permitted without notice safeguards (no notice constraint and no duty to inform). Clause %s: %s"
|
|
173
168
|
?cid ?txt ) string:format ?why .
|
|
174
169
|
}
|
|
175
170
|
=>
|
|
176
171
|
{
|
|
177
|
-
|
|
172
|
+
_:src1 a risk:RiskSource, risk:LegalComplianceRisk ;
|
|
178
173
|
dct:source :PermDeleteAccount ;
|
|
179
174
|
dct:description "Account removal permitted without notice safeguards." .
|
|
180
175
|
|
|
181
|
-
|
|
176
|
+
_:risk1 a dpv:Risk, risk:UnwantedDataDeletion, risk:DataUnavailable, risk:DataErasureError, risk:DataLoss ;
|
|
182
177
|
dct:source :PermDeleteAccount ;
|
|
183
|
-
risk:hasRiskSource
|
|
178
|
+
risk:hasRiskSource _:src1 ;
|
|
184
179
|
dpv:hasConsequence risk:DataLoss, risk:DataUnavailable, risk:CustomerConfidenceLoss ;
|
|
185
180
|
dpv:hasImpact risk:FinancialLoss, risk:NonMaterialDamage ;
|
|
186
181
|
:aboutClause ?clause ;
|
|
@@ -188,12 +183,12 @@
|
|
|
188
183
|
:violatesNeed :Need_DataCannotBeRemoved ;
|
|
189
184
|
dct:description ?why .
|
|
190
185
|
|
|
191
|
-
:ProcessContext1 dpv:hasRisk
|
|
186
|
+
:ProcessContext1 dpv:hasRisk _:risk1 .
|
|
192
187
|
|
|
193
188
|
|
|
194
|
-
|
|
189
|
+
_:m11 a dpv:RiskMitigationMeasure ;
|
|
195
190
|
dct:description "Add a notice constraint (minimum noticeDays) before account removal." ;
|
|
196
|
-
dpv:mitigatesRisk
|
|
191
|
+
dpv:mitigatesRisk _:risk1 ;
|
|
197
192
|
:suggestAdd {
|
|
198
193
|
:PermDeleteAccount odrl:constraint [
|
|
199
194
|
a odrl:Constraint ;
|
|
@@ -203,9 +198,9 @@
|
|
|
203
198
|
] .
|
|
204
199
|
} .
|
|
205
200
|
|
|
206
|
-
|
|
201
|
+
_:m21 a dpv:RiskMitigationMeasure ;
|
|
207
202
|
dct:description "Add a duty to inform the consumer prior to account removal." ;
|
|
208
|
-
dpv:mitigatesRisk
|
|
203
|
+
dpv:mitigatesRisk _:risk1 ;
|
|
209
204
|
:suggestAdd {
|
|
210
205
|
:PermDeleteAccount odrl:duty [
|
|
211
206
|
a odrl:Duty ;
|
|
@@ -213,7 +208,7 @@
|
|
|
213
208
|
] .
|
|
214
209
|
} .
|
|
215
210
|
|
|
216
|
-
|
|
211
|
+
_:risk1 dpv:isMitigatedByMeasure _:m11, _:m21 .
|
|
217
212
|
} .
|
|
218
213
|
|
|
219
214
|
# R2: change terms noticeDays is below consumer requirement
|
|
@@ -239,22 +234,18 @@
|
|
|
239
234
|
?clause :clauseId ?cid ; :text ?txt .
|
|
240
235
|
|
|
241
236
|
(70 ?w) math:sum ?raw .
|
|
242
|
-
( :Agreement1 :ConsumerExample :NoticeTooShort ?cid ) log:skolem ?risk .
|
|
243
|
-
( :Agreement1 :ConsumerExample :NoticeTooShortSource ?cid ) log:skolem ?src .
|
|
244
|
-
( ?risk :M1 ) log:skolem ?m1 .
|
|
245
|
-
|
|
246
237
|
( "Risk: terms may change with notice (%s days) below consumer requirement (%s days). Clause %s: %s"
|
|
247
238
|
?days ?req ?cid ?txt ) string:format ?why .
|
|
248
239
|
}
|
|
249
240
|
=>
|
|
250
241
|
{
|
|
251
|
-
|
|
242
|
+
_:src2 a risk:RiskSource, risk:PolicyRisk ;
|
|
252
243
|
dct:source :PermChangeTerms ;
|
|
253
244
|
dct:description "Notice for changing terms is shorter than consumer requirement." .
|
|
254
245
|
|
|
255
|
-
|
|
246
|
+
_:risk2 a dpv:Risk, risk:PolicyRisk, risk:CustomerConfidenceLoss ;
|
|
256
247
|
dct:source :PermChangeTerms ;
|
|
257
|
-
risk:hasRiskSource
|
|
248
|
+
risk:hasRiskSource _:src2 ;
|
|
258
249
|
dpv:hasConsequence risk:CustomerConfidenceLoss ;
|
|
259
250
|
dpv:hasImpact risk:NonMaterialDamage ;
|
|
260
251
|
:aboutClause ?clause ;
|
|
@@ -262,11 +253,11 @@
|
|
|
262
253
|
:violatesNeed :Need_ChangeOnlyWithPriorNotice ;
|
|
263
254
|
dct:description ?why .
|
|
264
255
|
|
|
265
|
-
:ProcessContext1 dpv:hasRisk
|
|
256
|
+
:ProcessContext1 dpv:hasRisk _:risk2 .
|
|
266
257
|
|
|
267
|
-
|
|
258
|
+
_:m12 a dpv:RiskMitigationMeasure ;
|
|
268
259
|
dct:description "Increase minimum noticeDays in the inform duty to meet the consumer requirement." ;
|
|
269
|
-
dpv:mitigatesRisk
|
|
260
|
+
dpv:mitigatesRisk _:risk2 ;
|
|
270
261
|
:suggestAdd {
|
|
271
262
|
:PermChangeTerms odrl:duty [
|
|
272
263
|
a odrl:Duty ;
|
|
@@ -280,7 +271,7 @@
|
|
|
280
271
|
] .
|
|
281
272
|
} .
|
|
282
273
|
|
|
283
|
-
|
|
274
|
+
_:risk2 dpv:isMitigatedByMeasure _:m12 .
|
|
284
275
|
} .
|
|
285
276
|
|
|
286
277
|
# R3: share data WITHOUT explicit consent constraint
|
|
@@ -306,22 +297,18 @@
|
|
|
306
297
|
?clause :clauseId ?cid ; :text ?txt .
|
|
307
298
|
|
|
308
299
|
(85 ?w) math:sum ?raw .
|
|
309
|
-
( :Agreement1 :ConsumerExample :ShareNoConsent ?cid ) log:skolem ?risk .
|
|
310
|
-
( :Agreement1 :ConsumerExample :ShareNoConsentSource ?cid ) log:skolem ?src .
|
|
311
|
-
( ?risk :M1 ) log:skolem ?m1 .
|
|
312
|
-
|
|
313
300
|
( "Risk: user data sharing is permitted without an explicit consent constraint. Clause %s: %s"
|
|
314
301
|
?cid ?txt ) string:format ?why .
|
|
315
302
|
}
|
|
316
303
|
=>
|
|
317
304
|
{
|
|
318
|
-
|
|
305
|
+
_:src3 a risk:RiskSource, risk:PolicyRisk ;
|
|
319
306
|
dct:source :PermShareData ;
|
|
320
307
|
dct:description "Data sharing permitted without explicit consent constraint." .
|
|
321
308
|
|
|
322
|
-
|
|
309
|
+
_:risk3 a dpv:Risk, risk:UnwantedDisclosureData, risk:CustomerConfidenceLoss ;
|
|
323
310
|
dct:source :PermShareData ;
|
|
324
|
-
risk:hasRiskSource
|
|
311
|
+
risk:hasRiskSource _:src3 ;
|
|
325
312
|
dpv:hasConsequence risk:CustomerConfidenceLoss ;
|
|
326
313
|
dpv:hasImpact risk:NonMaterialDamage, risk:FinancialLoss ;
|
|
327
314
|
:aboutClause ?clause ;
|
|
@@ -329,11 +316,11 @@
|
|
|
329
316
|
:violatesNeed :Need_NoSharingWithoutConsent ;
|
|
330
317
|
dct:description ?why .
|
|
331
318
|
|
|
332
|
-
:ProcessContext1 dpv:hasRisk
|
|
319
|
+
:ProcessContext1 dpv:hasRisk _:risk3 .
|
|
333
320
|
|
|
334
|
-
|
|
321
|
+
_:m13 a dpv:RiskMitigationMeasure ;
|
|
335
322
|
dct:description "Add an explicit consent constraint before data sharing." ;
|
|
336
|
-
dpv:mitigatesRisk
|
|
323
|
+
dpv:mitigatesRisk _:risk3 ;
|
|
337
324
|
:suggestAdd {
|
|
338
325
|
:PermShareData odrl:constraint [
|
|
339
326
|
a odrl:Constraint ;
|
|
@@ -343,7 +330,7 @@
|
|
|
343
330
|
] .
|
|
344
331
|
} .
|
|
345
332
|
|
|
346
|
-
|
|
333
|
+
_:risk3 dpv:isMitigatedByMeasure _:m13 .
|
|
347
334
|
} .
|
|
348
335
|
|
|
349
336
|
# R4: prohibit export (no portability)
|
|
@@ -361,22 +348,18 @@
|
|
|
361
348
|
?clause :clauseId ?cid ; :text ?txt .
|
|
362
349
|
|
|
363
350
|
(60 ?w) math:sum ?raw .
|
|
364
|
-
( :Agreement1 :ConsumerExample :NoPortability ?cid ) log:skolem ?risk .
|
|
365
|
-
( :Agreement1 :ConsumerExample :NoPortabilitySource ?cid ) log:skolem ?src .
|
|
366
|
-
( ?risk :M1 ) log:skolem ?m1 .
|
|
367
|
-
|
|
368
351
|
( "Risk: portability is restricted because exporting user data is prohibited. Clause %s: %s"
|
|
369
352
|
?cid ?txt ) string:format ?why .
|
|
370
353
|
}
|
|
371
354
|
=>
|
|
372
355
|
{
|
|
373
|
-
|
|
356
|
+
_:src4 a risk:RiskSource, risk:PolicyRisk ;
|
|
374
357
|
dct:source :ProhibitExportData ;
|
|
375
358
|
dct:description "Data export is prohibited, reducing portability." .
|
|
376
359
|
|
|
377
|
-
|
|
360
|
+
_:risk4 a dpv:Risk, risk:PolicyRisk, risk:CustomerConfidenceLoss ;
|
|
378
361
|
dct:source :ProhibitExportData ;
|
|
379
|
-
risk:hasRiskSource
|
|
362
|
+
risk:hasRiskSource _:src4 ;
|
|
380
363
|
dpv:hasConsequence risk:CustomerConfidenceLoss ;
|
|
381
364
|
dpv:hasImpact risk:NonMaterialDamage ;
|
|
382
365
|
:aboutClause ?clause ;
|
|
@@ -384,11 +367,11 @@
|
|
|
384
367
|
:violatesNeed :Need_DataPortability ;
|
|
385
368
|
dct:description ?why .
|
|
386
369
|
|
|
387
|
-
:ProcessContext1 dpv:hasRisk
|
|
370
|
+
:ProcessContext1 dpv:hasRisk _:risk4 .
|
|
388
371
|
|
|
389
|
-
|
|
372
|
+
_:m14 a dpv:RiskMitigationMeasure ;
|
|
390
373
|
dct:description "Add a permission allowing data export (or remove the prohibition) to support portability." ;
|
|
391
|
-
dpv:mitigatesRisk
|
|
374
|
+
dpv:mitigatesRisk _:risk4 ;
|
|
392
375
|
:suggestAdd {
|
|
393
376
|
:Policy1 odrl:permission [
|
|
394
377
|
a odrl:Permission ;
|
|
@@ -399,7 +382,7 @@
|
|
|
399
382
|
] .
|
|
400
383
|
} .
|
|
401
384
|
|
|
402
|
-
|
|
385
|
+
_:risk4 dpv:isMitigatedByMeasure _:m14 .
|
|
403
386
|
} .
|
|
404
387
|
|
|
405
388
|
# ------------------------------------------------
|
|
@@ -422,7 +405,7 @@
|
|
|
422
405
|
=> { ?r dpv:hasSeverity risk:LowSeverity ; dpv:hasRiskLevel risk:LowRisk . } .
|
|
423
406
|
|
|
424
407
|
# ------------------------------------------------------------------------------
|
|
425
|
-
# 5) Ranked explainable output (Eyeling -r prints these in key order)
|
|
408
|
+
# 5) Ranked explainable output via log:query (Eyeling -r prints these in key order)
|
|
426
409
|
# ------------------------------------------------------------------------------
|
|
427
410
|
|
|
428
411
|
# Header
|
|
@@ -432,10 +415,10 @@
|
|
|
432
415
|
( "\n=== Ranked DPV Risk Report ===\nAgreement: %s\nProfile: %s\n\n"
|
|
433
416
|
?alabel ?plabel ) string:format ?hdr .
|
|
434
417
|
}
|
|
435
|
-
|
|
418
|
+
log:query
|
|
436
419
|
{
|
|
437
420
|
( :Agreement1 :ConsumerExample 0 ) log:outputString ?hdr .
|
|
438
|
-
}
|
|
421
|
+
}.
|
|
439
422
|
|
|
440
423
|
# Risk lines (key includes inverse score = 1000 - score)
|
|
441
424
|
{
|
|
@@ -452,10 +435,10 @@
|
|
|
452
435
|
( "score=%s (%s, %s) clause %s\n %s\n\n"
|
|
453
436
|
?score ?lvl ?sev ?cid ?why ) string:format ?line .
|
|
454
437
|
}
|
|
455
|
-
|
|
438
|
+
log:query
|
|
456
439
|
{
|
|
457
440
|
( :Agreement1 :ConsumerExample 1 ?inv ?cid 0 ?r ) log:outputString ?line .
|
|
458
|
-
}
|
|
441
|
+
}.
|
|
459
442
|
|
|
460
443
|
# Mitigation lines (same ordering as their risk)
|
|
461
444
|
{
|
|
@@ -471,8 +454,7 @@
|
|
|
471
454
|
( " - mitigation for clause %s: %s\n"
|
|
472
455
|
?cid ?md ) string:format ?mline .
|
|
473
456
|
}
|
|
474
|
-
|
|
457
|
+
log:query
|
|
475
458
|
{
|
|
476
459
|
( :Agreement1 :ConsumerExample 1 ?inv ?cid 1 ?r ?m ) log:outputString ?mline .
|
|
477
|
-
}
|
|
478
|
-
|
|
460
|
+
}.
|