-
Notifications
You must be signed in to change notification settings - Fork 0
/
privacyCompetencyQuestions.sparql
338 lines (261 loc) · 10.6 KB
/
privacyCompetencyQuestions.sparql
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
## 1. Privacy Namespace
#Competency Question 1.1 - WHAT are the different types of privacy
SELECT ?PrivType WHERE {?PrivType rdfs:subClassOf privacy:PrivacyType}
#Competency Question 1.2 - WHAT are the different interrogatives?
SELECT ?Interrogatives WHERE {?Interrogatives rdfs:subClassOf privacy:InterrogativeDimensions}
#Competency Question 1.3 - WHAT are all the unique relationships between Privacy Types and Interrogatives?
SELECT ?Type ?Relationship ?Interrogative WHERE {?Relationship rdfs:range ?Type . ?Relationship rdfs:domain ?Interrogative
FILTER(isURI(?Relationship) && STRSTARTS(STR(?Relationship), STR(privacy:)))} #filter gets rid of non-privacy namespaces
#Competency Question 1.4 - For a given Interrogative, WHAT are the related privacy types?
SELECT ?Relationship ?Type WHERE {?Relationship rdfs:domain privacy:Identity . ?Relationship rdfs:range ?Type}
#Competency Question 1.5 - For a given Privacy Type, WHAT are the related Interrogatives?
SELECT ?Relationship ?Interrogative WHERE {?Relationship rdfs:range privacy:PersonalPrivacy . ?Relationship rdfs:domain ?Interrogative}
##2. Sense Namespace
#Competency Question 2.1 - WHAT are the collection vectors?
SELECT ?Vector WHERE {?Vector rdfs:subClassOf sense:CollectionVector}
#Competencey Question 2.2 - WHAT are the collection vectors of a given device?
SELECT ?Vector WHERE {?Device sense:collects ?Vector} #not proven until instantiated with a KB specifying a given device.
#Competency Question 2.3 - For a given COLLECTION VECTOR, WHICH DEVICES are capable of collecting it?
SELECT ?Device WHERE {?Device sense:collects ?Vector} # Not proven until instantiated with a KB specifying a given vector.
##3. Portkey (ontology bridge) Relationships:
# Competency Question 3.1 - WHAT is the Sensory Dimension assosciated with a given Collection Vector
SELECT ?Vector ?Rel ?Dim WHERE {?Rel rdfs:domain sense:CollectionVector .
?Rel rdfs:range privacy:InterrogativeDimensions} #Returns only the Relationships
SELECT ?Vector ?Rel ?Dim WHERE {?Rel rdfs:domain ?Vector .
?Rel rdfs:range ?Dim
FILTER(isURI(?Rel) && STRSTARTS(STR(?Rel), STR(sense:))) #show only the sense namespace relationships
FILTER(isURI(?Vector) && STRSTARTS(STR(?Vector), STR(sense:))) #show only the sense namespace CVs
FILTER(isURI(?Dim) && STRSTARTS(STR(?Dim), STR(privacy:))) #show only the privacy namespace Dimensions
} #Returns all parent & Child Classes (doubles up)
### For the Testing of the Usecase:
#Comptency Questions:
# What privacy risks is an individual vulnerable to?
SELECT ?Name ?PrivacyRisk
WHERE{
?Persona privacy:threatens ?PrivacyRisk .
?Persona privacy:personaName ?Name
}
# Determine who has the most privacy Violations
SELECT ?Name (COUNT (?PrivacyRisk) as ?RiskCount)
WHERE{
?Persona privacy:threatens ?PrivacyRisk .
?Persona privacy:personaName ?Name
}
GROUP BY ?Name
ORDER BY DESC(?RiskCount)
# Determine which type of privacy violation is the most common.
SELECT ?PrivacyRisk (COUNT (?Name) as ?NameCount)
WHERE{
?Persona privacy:threatens ?PrivacyRisk .
?Persona privacy:personaName ?Name
}
GROUP BY ?PrivacyRisk
ORDER BY DESC(?NameCount)
# Determine what device type is most prolific
SELECT ?DeviceType (COUNT(?Name) as ?UserCount)
WHERE{
?Device sense:deviceType ?DeviceType .
?Device sense:deviceUser ?UID .
?Persona privacy:personaID ?UID .
?Persona privacy:personaName ?Name
}
GROUP BY ?DeviceType
ORDER BY DESC(?UserCount)
# Determine which Privacy type has the most associated devices (note: many users have more than one device)
SELECT ?PrivacyRisk (COUNT(?DeviceType) as ?DeviceCount)
WHERE{
?Device sense:deviceType ?DeviceType .
?Device sense:deviceUser ?UID .
?Persona privacy:personaID ?UID .
?Persona privacy:threatens ?PrivacyRisk
}
GROUP BY ?PrivacyRisk
ORDER BY DESC(?DeviceCount)
# Determine which Device type has the most associated PrivacyImpacts (Note: one device may pose multiple risks)
SELECT ?DeviceType (COUNT(?PrivacyRisk ) as ?RiskCount)
WHERE{
?Device sense:deviceType ?DeviceType .
?Device sense:deviceUser ?UID .
?Persona privacy:personaID ?UID .
?Persona privacy:threatens ?PrivacyRisk
}
GROUP BY ?DeviceType
ORDER BY DESC(?RiskCount)
# Determine how Many Devices have Cameras
SELECT ?DeviceType (COUNT(?Device) as ?DeviceCount)
WHERE{
?Device sense:deviceType ?DeviceType .
?Device sense:collects sense:Sight
}
GROUP BY ?DeviceType
ORDER BY DESC(?DeviceCount)
# Determine what kinds of devices have cameras
SELECT DISTINCT ?DeviceType
WHERE{
?Device sense:deviceType ?DeviceType .
?Device sense:collects sense:Sight
}
# Determine who is vulnerable to a given privacy violation
SELECT DISTINCT ?Name
WHERE{
?Device sense:deviceUser ?UID .
?Persona privacy:personaID ?UID .
?Persona privacy:personaName ?Name .
?Persona privacy:threatens privacy:PersonalPrivacy
}
# Determine how many vectors each person is vulnerable to
SELECT (COUNT(?Vector) as ?VectorCount) ?Name
WHERE{
?Persona privacy:personaID ?UID .
?Device sense:deviceUser ?UID .
?Persona privacy:personaName ?Name .
?Device sense:collects ?Vector
}
GROUP BY ?Name
ORDER BY DESC(?VectorCount)
# Determine how many vectors each person is vulnerable to, and how many of each vector they are at risk to
SELECT ?Name ?NumberofDevices ?CollectionVectors ?SightVectors ?SoundVectors ?TimeVectors ?LocationVectors
WHERE{
{
SELECT (COUNT(sense:Sight) as ?SightVectors) ?Name
WHERE{
?Persona privacy:personaID ?UID .
?Device sense:deviceUser ?UID .
?Persona privacy:personaName ?Name .
?Device sense:collects sense:Sight
}
GROUP BY ?Name
}
{
SELECT (COUNT(sense:Sound) as ?SoundVectors) ?Name
WHERE{
?Persona privacy:personaID ?UID .
?Device sense:deviceUser ?UID .
?Persona privacy:personaName ?Name .
?Device sense:collects sense:Sound
}
GROUP BY ?Name
}
{
SELECT (COUNT(sense:Time) as ?TimeVectors) ?Name
WHERE{
?Persona privacy:personaID ?UID .
?Device sense:deviceUser ?UID .
?Persona privacy:personaName ?Name .
?Device sense:collects sense:Time
}
GROUP BY ?Name
}
{
SELECT (COUNT(sense:Location) as ?LocationVectors) ?Name
WHERE{
?Persona privacy:personaID ?UID .
?Device sense:deviceUser ?UID .
?Persona privacy:personaName ?Name .
?Device sense:collects sense:Location
}
GROUP BY ?Name
}
{
SELECT (COUNT(?Vector) as ?CollectionVectors) ?Name
WHERE{
?Persona privacy:personaID ?UID .
?Device sense:deviceUser ?UID .
?Persona privacy:personaName ?Name .
?Device sense:collects ?Vector
}
GROUP BY ?Name
ORDER BY DESC(?CollectionVectors)
}
{
SELECT (COUNT(?Device) as ?NumberofDevices) ?Name
WHERE{
?Persona privacy:personaID ?UID .
?Device sense:deviceUser ?UID .
?Persona privacy:personaName ?Name .
}
GROUP BY ?Name
}
}
# Determine how many Vulnerabilites each person is exposing, and how many of each type
SELECT ?Name ?NumberofDevices ?CompromiseVulnerabilities ?IdentityVulnerabilites ?ActionVulnerabilites ?TimeVulnerabilities ?LocationVulnerabilities ?MotiveVulnerabilities
WHERE{
{
SELECT (COUNT(?Persona) as ?CompromiseVulnerabilities) ?Name
WHERE{
?Persona privacy:personaID ?UID .
?Device sense:deviceUser ?UID .
?Persona privacy:personaName ?Name .
{?Persona privacy:exposesIdentity true}
UNION
{?Persona privacy:exposesAction true}
UNION
{?Persona privacy:exposesTime true}
UNION
{?Persona privacy:exposesLocation true}
UNION
{?Persona privacy:exposesMotive true}
}
GROUP BY ?Name
ORDER BY DESC(?CompromiseVulnerabilities)
}
{
SELECT (COUNT(privacy:exposesIdentity) as ?IdentityVulnerabilites) ?Name
WHERE{
?Persona privacy:personaID ?UID .
?Device sense:deviceUser ?UID .
?Persona privacy:personaName ?Name .
?Persona privacy:exposesIdentity true
}
GROUP BY ?Name
}
{
SELECT (COUNT(privacy:exposesAction) as ?ActionVulnerabilites) ?Name
WHERE{
?Persona privacy:personaID ?UID .
?Device sense:deviceUser ?UID .
?Persona privacy:personaName ?Name .
?Persona privacy:exposesAction true
}
GROUP BY ?Name
}
{
SELECT (COUNT(privacy:exposesTime) as ?TimeVulnerabilities) ?Name
WHERE{
?Persona privacy:personaID ?UID .
?Device sense:deviceUser ?UID .
?Persona privacy:personaName ?Name .
?Persona privacy:exposesTime true
}
GROUP BY ?Name
}
{
SELECT (COUNT(privacy:exposesLocation) as ?LocationVulnerabilities) ?Name
WHERE{
?Persona privacy:personaID ?UID .
?Device sense:deviceUser ?UID .
?Persona privacy:personaName ?Name .
?Persona privacy:exposesLocation true
}
GROUP BY ?Name
}
{
SELECT (COUNT(privacy:exposesMotive) as ?MotiveVulnerabilities) ?Name
WHERE{
?Persona privacy:personaID ?UID .
?Device sense:deviceUser ?UID .
?Persona privacy:personaName ?Name .
?Persona privacy:exposesMotive true
}
GROUP BY ?Name
}
{
SELECT (COUNT(?Device) as ?NumberofDevices) ?Name
WHERE{
?Persona privacy:personaID ?UID .
?Device sense:deviceUser ?UID .
?Persona privacy:personaName ?Name .
}
GROUP BY ?Name
}
}