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.
- package/HANDBOOK.md +2 -0
- package/examples/allen-interval-calculus.n3 +180 -0
- package/examples/deck/odrl-dpv-risk-ranked.md +251 -0
- package/examples/dining-philosophers.n3 +383 -0
- package/examples/input/annotation.ttl +3 -1
- package/examples/input/reifies.ttl +2 -0
- package/examples/input/triple-term.ttl +3 -2
- package/examples/kaprekar.n3 +205 -0
- package/examples/odrl-dpv-ehds-risk-ranked.n3 +473 -0
- package/examples/odrl-dpv-healthcare-risk-ranked.n3 +575 -0
- package/examples/odrl-dpv-risk-ranked.n3 +30 -31
- package/examples/output/allen-interval-calculus.n3 +157 -0
- package/examples/output/dining-philosophers.n3 +808 -0
- package/examples/output/kaprekar.n3 +9992 -0
- package/examples/output/odrl-dpv-ehds-risk-ranked.n3 +144 -0
- package/examples/output/odrl-dpv-healthcare-risk-ranked.n3 +117 -0
- package/examples/output/odrl-dpv-risk-ranked.n3 +70 -6
- package/examples/output/wind-turbine.n3 +6 -0
- package/examples/reifies.n3 +1 -2
- package/examples/triple-term.n3 +3 -3
- package/examples/wind-turbine.n3 +63 -0
- package/eyeling.js +7 -2
- package/lib/cli.js +4 -1
- package/lib/engine.js +3 -1
- package/package.json +1 -1
- package/test/api.test.js +11 -0
- package/tools/n3gen.js +36 -7
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
# ============================================================================================
|
|
2
|
+
# ODRL + DPV risk assessment example aligned with the DPV EU-EHDS extension.
|
|
3
|
+
#
|
|
4
|
+
# Scenario (EHDS secondary use)
|
|
5
|
+
# - A hospital (Health Data Holder) makes electronic health data available to a university lab
|
|
6
|
+
# (Health Data User) for secondary use (research / training health-related algorithms).
|
|
7
|
+
# - The agreement is intentionally missing EHDS-aligned safeguards so risks can be detected,
|
|
8
|
+
# scored, ranked, and explained.
|
|
9
|
+
#
|
|
10
|
+
# Notes on vocabularies used
|
|
11
|
+
# - ODRL terms use: http://www.w3.org/ns/odrl/2/
|
|
12
|
+
# - DPV core uses: https://w3id.org/dpv#
|
|
13
|
+
# - DPV-RISK uses: https://w3id.org/dpv/risk#
|
|
14
|
+
# - EU-EHDS draft uses: https://w3id.org/dpv/legal/eu/ehds#
|
|
15
|
+
# - EU-DGA uses: https://w3id.org/dpv/legal/eu/dga#
|
|
16
|
+
# ============================================================================================
|
|
17
|
+
|
|
18
|
+
@prefix : <https://example.org/odrl-dpv-ehds-risk-ranked#> .
|
|
19
|
+
@prefix odrl: <http://www.w3.org/ns/odrl/2/> .
|
|
20
|
+
@prefix dpv: <https://w3id.org/dpv#> .
|
|
21
|
+
@prefix risk: <https://w3id.org/dpv/risk#> .
|
|
22
|
+
@prefix eu-ehds: <https://w3id.org/dpv/legal/eu/ehds#> .
|
|
23
|
+
@prefix eu-dga: <https://w3id.org/dpv/legal/eu/dga#> .
|
|
24
|
+
@prefix dct: <http://purl.org/dc/terms/> .
|
|
25
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
26
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
27
|
+
@prefix math: <http://www.w3.org/2000/10/swap/math#> .
|
|
28
|
+
@prefix string: <http://www.w3.org/2000/10/swap/string#> .
|
|
29
|
+
|
|
30
|
+
# ----------------------------------------------------------------------------
|
|
31
|
+
# 1) A “patient expectations” profile expressed as needs (weights for scoring)
|
|
32
|
+
# ----------------------------------------------------------------------------
|
|
33
|
+
|
|
34
|
+
:PatientProfileExample a :PatientProfile, odrl:Party ;
|
|
35
|
+
dct:title "Example patient profile (EHDS rights expectations)" ;
|
|
36
|
+
:hasNeed :Need_RequireDataPermit,
|
|
37
|
+
:Need_RespectOptOutSecondaryUse,
|
|
38
|
+
:Need_SecureProcessingEnvironment,
|
|
39
|
+
:Need_StatisticallyAnonymisedSecondaryUse .
|
|
40
|
+
|
|
41
|
+
:Need_RequireDataPermit a :Need ;
|
|
42
|
+
:importance 20 ;
|
|
43
|
+
dct:description "Secondary use should be authorised via an EHDS Data Permit issued by a Health Data Access Body." .
|
|
44
|
+
|
|
45
|
+
:Need_RespectOptOutSecondaryUse a :Need ;
|
|
46
|
+
:importance 25 ;
|
|
47
|
+
:relatedRight eu-ehds:A71 ;
|
|
48
|
+
dct:description "Respect the EHDS right to opt out from secondary use." .
|
|
49
|
+
|
|
50
|
+
:Need_SecureProcessingEnvironment a :Need ;
|
|
51
|
+
:importance 18 ;
|
|
52
|
+
:relatedRight eu-ehds:A68-11 ;
|
|
53
|
+
dct:description "Secondary-use processing must occur within a secure processing environment (and not via local downloads)." .
|
|
54
|
+
|
|
55
|
+
:Need_StatisticallyAnonymisedSecondaryUse a :Need ;
|
|
56
|
+
:importance 15 ;
|
|
57
|
+
dct:description "Secondary use should use statistically anonymised electronic health data (e.g., via an EHDS Health Data Request)." .
|
|
58
|
+
|
|
59
|
+
# -----------------------------------------------------------------
|
|
60
|
+
# 2) Parties, datasets, and agreement (ODRL policy graph + clauses)
|
|
61
|
+
# -----------------------------------------------------------------
|
|
62
|
+
|
|
63
|
+
:HospitalA a odrl:Party, eu-ehds:HealthDataHolder ;
|
|
64
|
+
dct:title "St. Example Hospital (Health Data Holder)" .
|
|
65
|
+
|
|
66
|
+
:AccessBodyBE a odrl:Party, eu-ehds:HealthDataAccessBody ;
|
|
67
|
+
dct:title "Example Health Data Access Body (BE)" .
|
|
68
|
+
|
|
69
|
+
:UniLab a odrl:Party, eu-ehds:HealthDataUser ;
|
|
70
|
+
dct:title "Example University Lab (Health Data User)" .
|
|
71
|
+
|
|
72
|
+
:EHDSRegulation a dpv:Law ;
|
|
73
|
+
dct:title "EU European Health Data Space (EHDS) regulation (draft vocabulary alignment)" ;
|
|
74
|
+
rdfs:seeAlso <https://w3id.org/dpv/legal/eu/ehds> .
|
|
75
|
+
|
|
76
|
+
:ProcessContext1 a dpv:Process ;
|
|
77
|
+
dct:source :AgreementEHDS1 ;
|
|
78
|
+
dct:title "Secondary use under AgreementEHDS1" ;
|
|
79
|
+
dpv:hasApplicableLaw :EHDSRegulation .
|
|
80
|
+
|
|
81
|
+
:Dataset1 a odrl:Asset ;
|
|
82
|
+
dct:title "Combined dataset (EHR + genomics + clinical trials data)" ;
|
|
83
|
+
dpv:hasPersonalData eu-ehds:EHRData, eu-ehds:GenomicData, eu-ehds:ClinicalTrialsData .
|
|
84
|
+
|
|
85
|
+
:AgreementEHDS1 a odrl:Agreement ;
|
|
86
|
+
dct:title "EHDS Secondary Use Agreement (example)" ;
|
|
87
|
+
:policyGraph {
|
|
88
|
+
:PolicyEHDS1 a odrl:Policy ;
|
|
89
|
+
odrl:permission :PermSecondaryUseDUA,
|
|
90
|
+
:PermSecondaryUseAllPatients,
|
|
91
|
+
:PermDownloadLocalCopy,
|
|
92
|
+
:PermProvidePseudonymisedData .
|
|
93
|
+
|
|
94
|
+
# Clause H1: Secondary use permitted based on a bilateral DUA only (no EHDS data permit)
|
|
95
|
+
:PermSecondaryUseDUA a odrl:Permission ;
|
|
96
|
+
odrl:assigner :HospitalA ;
|
|
97
|
+
odrl:assignee :UniLab ;
|
|
98
|
+
odrl:action :provideSecondaryUseData ;
|
|
99
|
+
odrl:target :Dataset1 ;
|
|
100
|
+
odrl:constraint [
|
|
101
|
+
a odrl:Constraint ;
|
|
102
|
+
odrl:leftOperand odrl:purpose ;
|
|
103
|
+
odrl:operator odrl:eq ;
|
|
104
|
+
odrl:rightOperandReference eu-ehds:HealthcareScientificResearch
|
|
105
|
+
] ;
|
|
106
|
+
:clause :ClauseH1 .
|
|
107
|
+
|
|
108
|
+
# Clause H2: Secondary use covers all patients (no explicit opt-out safeguard)
|
|
109
|
+
:PermSecondaryUseAllPatients a odrl:Permission ;
|
|
110
|
+
odrl:assigner :HospitalA ;
|
|
111
|
+
odrl:assignee :UniLab ;
|
|
112
|
+
odrl:action :provideSecondaryUseData ;
|
|
113
|
+
odrl:target :Dataset1 ;
|
|
114
|
+
odrl:constraint [
|
|
115
|
+
a odrl:Constraint ;
|
|
116
|
+
odrl:leftOperand odrl:purpose ;
|
|
117
|
+
odrl:operator odrl:eq ;
|
|
118
|
+
odrl:rightOperandReference eu-ehds:TrainTestAndEvaluateHealthAlgorithms
|
|
119
|
+
] ;
|
|
120
|
+
:clause :ClauseH2 .
|
|
121
|
+
|
|
122
|
+
# Clause H3: Lab may download a full local copy (conflicts with secure processing environment expectation)
|
|
123
|
+
:PermDownloadLocalCopy a odrl:Permission ;
|
|
124
|
+
odrl:assigner :HospitalA ;
|
|
125
|
+
odrl:assignee :UniLab ;
|
|
126
|
+
odrl:action :download ;
|
|
127
|
+
odrl:target :Dataset1 ;
|
|
128
|
+
:clause :ClauseH3 .
|
|
129
|
+
|
|
130
|
+
# Clause H4: Data provided only “pseudonymised” (no constraint requiring statistically anonymised secondary use)
|
|
131
|
+
:PermProvidePseudonymisedData a odrl:Permission ;
|
|
132
|
+
odrl:assigner :HospitalA ;
|
|
133
|
+
odrl:assignee :UniLab ;
|
|
134
|
+
odrl:action :provideSecondaryUseData ;
|
|
135
|
+
odrl:target :Dataset1 ;
|
|
136
|
+
odrl:duty [
|
|
137
|
+
a odrl:Duty ;
|
|
138
|
+
odrl:action :removeDirectIdentifiers
|
|
139
|
+
] ;
|
|
140
|
+
:clause :ClauseH4 .
|
|
141
|
+
} .
|
|
142
|
+
|
|
143
|
+
:ClauseH1 a :Clause ; :clauseId "H1" ; :text "Hospital may provide electronic health data for secondary use based on a bilateral data use agreement with the applicant." .
|
|
144
|
+
:ClauseH2 a :Clause ; :clauseId "H2" ; :text "Secondary use may include all patient records for training and evaluating health-related algorithms." .
|
|
145
|
+
:ClauseH3 a :Clause ; :clauseId "H3" ; :text "The applicant may download a complete local copy of the dataset to its own infrastructure for analysis." .
|
|
146
|
+
:ClauseH4 a :Clause ; :clauseId "H4" ; :text "The dataset will be provided in pseudonymised form by removing direct identifiers." .
|
|
147
|
+
|
|
148
|
+
# ---------------------------------------------------------------------
|
|
149
|
+
# 3) Risk rules (ODRL -> DPV/DPV-RISK) + mitigations
|
|
150
|
+
# (Only match ODRL structure inside log:includes / log:notIncludes.)
|
|
151
|
+
# ---------------------------------------------------------------------
|
|
152
|
+
|
|
153
|
+
# R1 (H1): Secondary use allowed WITHOUT an EHDS Data Permit constraint
|
|
154
|
+
{
|
|
155
|
+
:AgreementEHDS1 :policyGraph ?G .
|
|
156
|
+
:PatientProfileExample :hasNeed :Need_RequireDataPermit .
|
|
157
|
+
:Need_RequireDataPermit :importance ?w .
|
|
158
|
+
|
|
159
|
+
?G log:includes {
|
|
160
|
+
:PermSecondaryUseDUA a odrl:Permission ;
|
|
161
|
+
odrl:action :provideSecondaryUseData ;
|
|
162
|
+
:clause ?clause .
|
|
163
|
+
} .
|
|
164
|
+
|
|
165
|
+
?G log:notIncludes {
|
|
166
|
+
:PermSecondaryUseDUA odrl:constraint [
|
|
167
|
+
odrl:leftOperand :hasDataPermit
|
|
168
|
+
] .
|
|
169
|
+
} .
|
|
170
|
+
|
|
171
|
+
?clause :clauseId ?cid ; :text ?txt .
|
|
172
|
+
|
|
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
|
+
( "Risk: secondary use is permitted without an EHDS Data Permit safeguard. Clause %s: %s"
|
|
179
|
+
?cid ?txt ) string:format ?why .
|
|
180
|
+
}
|
|
181
|
+
=>
|
|
182
|
+
{
|
|
183
|
+
?src a risk:RiskSource, risk:LegalComplianceRisk ;
|
|
184
|
+
dct:source :PermSecondaryUseDUA ;
|
|
185
|
+
dct:description "Secondary use permitted without EHDS Data Permit." .
|
|
186
|
+
|
|
187
|
+
?risk a dpv:Risk, risk:PolicyRisk ;
|
|
188
|
+
dct:source :PermSecondaryUseDUA ;
|
|
189
|
+
risk:hasRiskSource ?src ;
|
|
190
|
+
dpv:hasConsequence risk:CustomerConfidenceLoss ;
|
|
191
|
+
dpv:hasImpact risk:FinancialLoss, risk:NonMaterialDamage ;
|
|
192
|
+
:aboutClause ?clause ;
|
|
193
|
+
:scoreRaw ?raw ;
|
|
194
|
+
:violatesNeed :Need_RequireDataPermit ;
|
|
195
|
+
dct:description ?why .
|
|
196
|
+
|
|
197
|
+
:ProcessContext1 dpv:hasRisk ?risk .
|
|
198
|
+
|
|
199
|
+
?m1 a dpv:RiskMitigationMeasure ;
|
|
200
|
+
dct:description "Require an EHDS Data Permit (eu-ehds:DataPermit) issued by a Health Data Access Body prior to secondary use." ;
|
|
201
|
+
dpv:mitigatesRisk ?risk ;
|
|
202
|
+
:suggestAdd {
|
|
203
|
+
:PermSecondaryUseDUA odrl:constraint [
|
|
204
|
+
a odrl:Constraint ;
|
|
205
|
+
odrl:leftOperand :hasDataPermit ;
|
|
206
|
+
odrl:operator odrl:eq ;
|
|
207
|
+
odrl:rightOperand true
|
|
208
|
+
] .
|
|
209
|
+
:PermitExample a eu-ehds:DataPermit ;
|
|
210
|
+
dct:description "Example placeholder for an issued data permit." .
|
|
211
|
+
} .
|
|
212
|
+
|
|
213
|
+
?risk dpv:isMitigatedByMeasure ?m1 .
|
|
214
|
+
} .
|
|
215
|
+
|
|
216
|
+
# R2 (H2): Secondary use allowed WITHOUT an explicit opt-out safeguard (EHDS Art.71 right A71)
|
|
217
|
+
{
|
|
218
|
+
:AgreementEHDS1 :policyGraph ?G .
|
|
219
|
+
:PatientProfileExample :hasNeed :Need_RespectOptOutSecondaryUse .
|
|
220
|
+
:Need_RespectOptOutSecondaryUse :importance ?w .
|
|
221
|
+
|
|
222
|
+
?G log:includes {
|
|
223
|
+
:PermSecondaryUseAllPatients a odrl:Permission ;
|
|
224
|
+
odrl:action :provideSecondaryUseData ;
|
|
225
|
+
:clause ?clause .
|
|
226
|
+
} .
|
|
227
|
+
|
|
228
|
+
?G log:notIncludes {
|
|
229
|
+
:PermSecondaryUseAllPatients odrl:constraint [
|
|
230
|
+
odrl:leftOperand :respectOptOutSecondaryUse
|
|
231
|
+
] .
|
|
232
|
+
} .
|
|
233
|
+
|
|
234
|
+
?clause :clauseId ?cid ; :text ?txt .
|
|
235
|
+
|
|
236
|
+
(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
|
+
( "Risk: secondary use may include patients who opted out (EHDS A71). Clause %s: %s"
|
|
242
|
+
?cid ?txt ) string:format ?why .
|
|
243
|
+
}
|
|
244
|
+
=>
|
|
245
|
+
{
|
|
246
|
+
?src a risk:RiskSource, risk:LegalComplianceRisk ;
|
|
247
|
+
dct:source :PermSecondaryUseAllPatients ;
|
|
248
|
+
dct:description "Opt-out from secondary use not explicitly respected." .
|
|
249
|
+
|
|
250
|
+
?risk a dpv:Risk, risk:PolicyRisk, risk:UnwantedDisclosureData ;
|
|
251
|
+
dct:source :PermSecondaryUseAllPatients ;
|
|
252
|
+
risk:hasRiskSource ?src ;
|
|
253
|
+
dpv:hasConsequence risk:CustomerConfidenceLoss ;
|
|
254
|
+
dpv:hasImpact risk:NonMaterialDamage ;
|
|
255
|
+
:aboutClause ?clause ;
|
|
256
|
+
:scoreRaw ?raw ;
|
|
257
|
+
:violatesNeed :Need_RespectOptOutSecondaryUse ;
|
|
258
|
+
dct:description ?why .
|
|
259
|
+
|
|
260
|
+
:ProcessContext1 dpv:hasRisk ?risk .
|
|
261
|
+
|
|
262
|
+
?m1 a dpv:RiskMitigationMeasure ;
|
|
263
|
+
dct:description "Add an explicit safeguard to exclude records of persons who exercised the EHDS opt-out from secondary use (A71)." ;
|
|
264
|
+
dpv:mitigatesRisk ?risk ;
|
|
265
|
+
:suggestAdd {
|
|
266
|
+
:PermSecondaryUseAllPatients odrl:constraint [
|
|
267
|
+
a odrl:Constraint ;
|
|
268
|
+
odrl:leftOperand :respectOptOutSecondaryUse ;
|
|
269
|
+
odrl:operator odrl:eq ;
|
|
270
|
+
odrl:rightOperand true
|
|
271
|
+
] .
|
|
272
|
+
} .
|
|
273
|
+
|
|
274
|
+
?risk dpv:isMitigatedByMeasure ?m1 .
|
|
275
|
+
} .
|
|
276
|
+
|
|
277
|
+
# R3 (H3): Local download permitted (no secure processing environment safeguard)
|
|
278
|
+
{
|
|
279
|
+
:AgreementEHDS1 :policyGraph ?G .
|
|
280
|
+
:PatientProfileExample :hasNeed :Need_SecureProcessingEnvironment .
|
|
281
|
+
:Need_SecureProcessingEnvironment :importance ?w .
|
|
282
|
+
|
|
283
|
+
?G log:includes {
|
|
284
|
+
:PermDownloadLocalCopy a odrl:Permission ;
|
|
285
|
+
odrl:action :download ;
|
|
286
|
+
:clause ?clause .
|
|
287
|
+
} .
|
|
288
|
+
|
|
289
|
+
?G log:notIncludes {
|
|
290
|
+
:PermDownloadLocalCopy odrl:duty [
|
|
291
|
+
odrl:action :processOnlyInSecureEnvironment
|
|
292
|
+
] .
|
|
293
|
+
} .
|
|
294
|
+
|
|
295
|
+
?clause :clauseId ?cid ; :text ?txt .
|
|
296
|
+
|
|
297
|
+
(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
|
+
( "Risk: the agreement permits local downloads rather than processing within a secure processing environment. Clause %s: %s"
|
|
303
|
+
?cid ?txt ) string:format ?why .
|
|
304
|
+
}
|
|
305
|
+
=>
|
|
306
|
+
{
|
|
307
|
+
?src a risk:RiskSource, risk:PolicyRisk ;
|
|
308
|
+
dct:source :PermDownloadLocalCopy ;
|
|
309
|
+
dct:description "Local download permitted; secure processing environment not required." .
|
|
310
|
+
|
|
311
|
+
?risk a dpv:Risk, risk:UnwantedDisclosureData ;
|
|
312
|
+
dct:source :PermDownloadLocalCopy ;
|
|
313
|
+
risk:hasRiskSource ?src ;
|
|
314
|
+
dpv:hasConsequence risk:CustomerConfidenceLoss ;
|
|
315
|
+
dpv:hasImpact risk:FinancialLoss, risk:NonMaterialDamage ;
|
|
316
|
+
:aboutClause ?clause ;
|
|
317
|
+
:scoreRaw ?raw ;
|
|
318
|
+
:violatesNeed :Need_SecureProcessingEnvironment ;
|
|
319
|
+
dct:description ?why .
|
|
320
|
+
|
|
321
|
+
:ProcessContext1 dpv:hasRisk ?risk .
|
|
322
|
+
|
|
323
|
+
?m1 a dpv:RiskMitigationMeasure ;
|
|
324
|
+
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 ?risk ;
|
|
326
|
+
:suggestAdd {
|
|
327
|
+
:ProhibitDownloadLocalCopy a odrl:Prohibition ;
|
|
328
|
+
odrl:assigner :HospitalA ;
|
|
329
|
+
odrl:assignee :UniLab ;
|
|
330
|
+
odrl:action :download ;
|
|
331
|
+
odrl:target :Dataset1 ;
|
|
332
|
+
:clause :ClauseH3 .
|
|
333
|
+
:ProcessContext1 dpv:hasTechnicalOrganisationalMeasure eu-dga:SecureProcessingEnvironment .
|
|
334
|
+
} .
|
|
335
|
+
|
|
336
|
+
?risk dpv:isMitigatedByMeasure ?m1 .
|
|
337
|
+
} .
|
|
338
|
+
|
|
339
|
+
# R4 (H4): Secondary use provided without requiring statistically anonymised data (EHDS HealthDataRequest)
|
|
340
|
+
{
|
|
341
|
+
:AgreementEHDS1 :policyGraph ?G .
|
|
342
|
+
:PatientProfileExample :hasNeed :Need_StatisticallyAnonymisedSecondaryUse .
|
|
343
|
+
:Need_StatisticallyAnonymisedSecondaryUse :importance ?w .
|
|
344
|
+
|
|
345
|
+
?G log:includes {
|
|
346
|
+
:PermProvidePseudonymisedData a odrl:Permission ;
|
|
347
|
+
odrl:action :provideSecondaryUseData ;
|
|
348
|
+
:clause ?clause .
|
|
349
|
+
} .
|
|
350
|
+
|
|
351
|
+
?G log:notIncludes {
|
|
352
|
+
:PermProvidePseudonymisedData odrl:constraint [
|
|
353
|
+
odrl:leftOperand :statisticallyAnonymised
|
|
354
|
+
] .
|
|
355
|
+
} .
|
|
356
|
+
|
|
357
|
+
?clause :clauseId ?cid ; :text ?txt .
|
|
358
|
+
|
|
359
|
+
(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
|
+
( "Risk: secondary-use dataset is only described as pseudonymised, without a safeguard requiring statistically anonymised data for secondary use. Clause %s: %s"
|
|
365
|
+
?cid ?txt ) string:format ?why .
|
|
366
|
+
}
|
|
367
|
+
=>
|
|
368
|
+
{
|
|
369
|
+
?src a risk:RiskSource, risk:PolicyRisk ;
|
|
370
|
+
dct:source :PermProvidePseudonymisedData ;
|
|
371
|
+
dct:description "Statistical anonymisation safeguard missing for secondary use." .
|
|
372
|
+
|
|
373
|
+
?risk a dpv:Risk, risk:UnwantedDisclosureData ;
|
|
374
|
+
dct:source :PermProvidePseudonymisedData ;
|
|
375
|
+
risk:hasRiskSource ?src ;
|
|
376
|
+
dpv:hasConsequence risk:CustomerConfidenceLoss ;
|
|
377
|
+
dpv:hasImpact risk:NonMaterialDamage ;
|
|
378
|
+
:aboutClause ?clause ;
|
|
379
|
+
:scoreRaw ?raw ;
|
|
380
|
+
:violatesNeed :Need_StatisticallyAnonymisedSecondaryUse ;
|
|
381
|
+
dct:description ?why .
|
|
382
|
+
|
|
383
|
+
:ProcessContext1 dpv:hasRisk ?risk .
|
|
384
|
+
|
|
385
|
+
?m1 a dpv:RiskMitigationMeasure ;
|
|
386
|
+
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 ?risk ;
|
|
388
|
+
:suggestAdd {
|
|
389
|
+
:PermProvidePseudonymisedData odrl:constraint [
|
|
390
|
+
a odrl:Constraint ;
|
|
391
|
+
odrl:leftOperand :statisticallyAnonymised ;
|
|
392
|
+
odrl:operator odrl:eq ;
|
|
393
|
+
odrl:rightOperand true
|
|
394
|
+
] .
|
|
395
|
+
:ProcessContext1 dpv:hasOrganisationalMeasure eu-ehds:HealthDataRequest .
|
|
396
|
+
} .
|
|
397
|
+
|
|
398
|
+
?risk dpv:isMitigatedByMeasure ?m1 .
|
|
399
|
+
} .
|
|
400
|
+
|
|
401
|
+
# ------------------------------------------------
|
|
402
|
+
# 4) Score normalization + DPV-RISK severity/level
|
|
403
|
+
# ------------------------------------------------
|
|
404
|
+
|
|
405
|
+
{ ?r a dpv:Risk ; :scoreRaw ?raw . ?raw math:greaterThan 100 . }
|
|
406
|
+
=> { ?r :score 100 . } .
|
|
407
|
+
|
|
408
|
+
{ ?r a dpv:Risk ; :scoreRaw ?raw . 100 math:notLessThan ?raw . }
|
|
409
|
+
=> { ?r :score ?raw . } .
|
|
410
|
+
|
|
411
|
+
{ ?r a dpv:Risk ; :score ?s . ?s math:greaterThan 79 . }
|
|
412
|
+
=> { ?r dpv:hasSeverity risk:HighSeverity ; dpv:hasRiskLevel risk:HighRisk . } .
|
|
413
|
+
|
|
414
|
+
{ ?r a dpv:Risk ; :score ?s . ?s math:lessThan 80 . ?s math:greaterThan 49 . }
|
|
415
|
+
=> { ?r dpv:hasSeverity risk:ModerateSeverity ; dpv:hasRiskLevel risk:ModerateRisk . } .
|
|
416
|
+
|
|
417
|
+
{ ?r a dpv:Risk ; :score ?s . ?s math:lessThan 50 . }
|
|
418
|
+
=> { ?r dpv:hasSeverity risk:LowSeverity ; dpv:hasRiskLevel risk:LowRisk . } .
|
|
419
|
+
|
|
420
|
+
# -------------------------------------------------------------------
|
|
421
|
+
# 5) Ranked explainable output (Eyeling -r prints these in key order)
|
|
422
|
+
# -------------------------------------------------------------------
|
|
423
|
+
|
|
424
|
+
# Header
|
|
425
|
+
{
|
|
426
|
+
:AgreementEHDS1 dct:title ?alabel .
|
|
427
|
+
:PatientProfileExample dct:title ?plabel .
|
|
428
|
+
( "\n=== Ranked DPV Risk Report (EHDS-aligned) ===\nAgreement: %s\nProfile: %s\n\n"
|
|
429
|
+
?alabel ?plabel ) string:format ?hdr .
|
|
430
|
+
}
|
|
431
|
+
=>
|
|
432
|
+
{
|
|
433
|
+
( :AgreementEHDS1 :PatientProfileExample 0 ) log:outputString ?hdr .
|
|
434
|
+
} .
|
|
435
|
+
|
|
436
|
+
# Risk lines (key includes inverse score = 1000 - score)
|
|
437
|
+
{
|
|
438
|
+
?r a dpv:Risk ;
|
|
439
|
+
:score ?score ;
|
|
440
|
+
dpv:hasRiskLevel ?lvl ;
|
|
441
|
+
dpv:hasSeverity ?sev ;
|
|
442
|
+
:aboutClause ?clause ;
|
|
443
|
+
dct:description ?why .
|
|
444
|
+
?clause :clauseId ?cid .
|
|
445
|
+
|
|
446
|
+
( 1000 ?score ) math:difference ?inv .
|
|
447
|
+
|
|
448
|
+
( "score=%s (%s, %s) clause %s\n %s\n\n"
|
|
449
|
+
?score ?lvl ?sev ?cid ?why ) string:format ?line .
|
|
450
|
+
}
|
|
451
|
+
=>
|
|
452
|
+
{
|
|
453
|
+
( :AgreementEHDS1 :PatientProfileExample 1 ?inv ?cid 0 ?r ) log:outputString ?line .
|
|
454
|
+
} .
|
|
455
|
+
|
|
456
|
+
# Mitigation lines (same ordering as their risk)
|
|
457
|
+
{
|
|
458
|
+
?r a dpv:Risk ;
|
|
459
|
+
:score ?score ;
|
|
460
|
+
dpv:isMitigatedByMeasure ?m ;
|
|
461
|
+
:aboutClause ?clause .
|
|
462
|
+
?clause :clauseId ?cid .
|
|
463
|
+
?m dct:description ?md .
|
|
464
|
+
|
|
465
|
+
( 1000 ?score ) math:difference ?inv .
|
|
466
|
+
|
|
467
|
+
( " - mitigation for clause %s: %s\n"
|
|
468
|
+
?cid ?md ) string:format ?mline .
|
|
469
|
+
}
|
|
470
|
+
=>
|
|
471
|
+
{
|
|
472
|
+
( :AgreementEHDS1 :PatientProfileExample 1 ?inv ?cid 1 ?r ?m ) log:outputString ?mline .
|
|
473
|
+
} .
|