-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPodPat.trig
512 lines (428 loc) · 19.3 KB
/
PodPat.trig
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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
prefix me: <https://pat.best-pod-provider.com/profile/card#me>
prefix my-profile: <https://pat.example.com/profile/card>
prefix my-storage: <https://pat.best-pod-provider.com/storage/>
prefix my-storage-ACP: <https://pat.best-pod-provider.com/storage/?meta=ACP>
prefix webIdAlice: <https://alice-provider.com/profile/card#me>
prefix webIdBob: <https://bob-provider.com/profile/card#me>
prefix webIdCarol: <https://carol-provider.com/profile/card#me>
prefix webIdDee: <https://dee-provider.com/profile/card#me>
prefix webIdErik: <https://erik-provider.com/profile/card#me>
prefix webIdFiona: <https://fiona-provider.com/profile/card#me>
prefix webIdGreg: <https://greg-provider.com/profile/card#me>
prefix webIdHarry: <https://harry-provider.com/profile/card#me>
prefix webIdIvanna: <https://ivanna-provider.com/profile/card#me>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix foaf: <http://xmlns.com/foaf/0.1/>
prefix vcard: <http://www.w3.org/2006/vcard/ns#>
prefix ws: <http://www.w3.org/ns/pim/space#>
prefix ldp: <http://www.w3.org/ns/ldp#>
prefix dbpedia: <http://dbpedia.org/resource/>
prefix httph: <http://www.w3.org/2007/ont/httph#>
prefix schema: <https://schema.org/>
prefix odrl: <http://www.w3.org/ns/odrl/2/>
prefix dpv: <http://www.w3.org/ns/dpv#>
prefix gconsent: <https://w3id.org/GConsent#>
prefix sioc: <http://rdfs.org/sioc/ns#>
prefix solid: <http://www.w3.org/ns/solid/terms#>
prefix solid-ext: <http://www.w3.org/ns/solid/terms/experimental-or-extension#>
prefix acp: <http://www.w3.org/ns/solid/acp#>
# This 'Product Ontology' is useful for real world 'products'...
prefix pto: <http://www.productontology.org/id/>
prefix wikidata: <https://www.wikidata.org/wiki/>
# Just made up this visualization vocab to allow us easily size nodes in GraphDB visualizations!
prefix viz: <https://viz.example.com#>
#
# Create a Named Graph for this entire Pod.
# Inside here we actually define the Agent, and their Profile document.
#
my-storage: {
#
# Describe the Agent using it's WebID as the RDF Subject (e.g., often 'me', as a human being).
# Points to the Agent's Solid Pod (i.e., back to this Named Graph!).
#
me:
a schema:Person ;
# We could also type as FOAF:Person too, if we wanted...
# a foaf:Person ;
rdfs:label "#Me"@en ;
rdfs:comment "Pat is a human 'agent' from Dublin, Ireland - and he has a Solid Pod!"@en ;
vcard:fn "Pat McB"@en, "Padraig MacB"@ga ;
schema:name "Pat McB"@en, "Padraig MacB"@ga ;
foaf:name "Pat McB"@en, "Padraig MacB"@ga ;
solid:oidcIssuer <https://login.inrupt.com/> ;
# solid:account my-storage: ; # NSS might do it, but we have no need for 2 references to storage!
# solid:account my-storage: ; # Or is this really the root, i.e., just up to the domain?
ws:storage my-storage: ;
viz:nodeSize 1 .
#
# Describe my profile card - links back to the Agent's WebID, e.g., 'me', as a human being.
#
my-profile: a foaf:PersonalProfileDocument ;
rdfs:label "Profile document"@en ;
rdfs:comment "Personal profile document, references user preferences and public contact details. Points to its 'maker' and 'primary topic'."@en ;
rdfs:comment "Documento de perfil personal, hace referencia a las preferencias del usuario y datos de contacto públicos. Señala su 'creador' y 'tema principal'."@es ;
rdfs:comment "Persönliches Profildokument, verweist auf Benutzereinstellungen und öffentliche Kontaktdaten. Weist auf seinen „Hersteller“ und sein „Hauptthema“ hin"@de ;
rdfs:comment "Doiciméad próifíle pearsanta, tagairt do roghanna úsáideora agus sonraí teagmhála poiblí. Pointí dá ‘déantóir’ agus don ‘bhunscoil’"@ga ;
# Just a made-up predicate, or illustration - who provided this Solid Pod?
# solid:podProvider "Inrupt, Inc." ;
# Usually we'd have 'foaf:maker' here too, but removed to un-clutter visualizations...
# foaf:maker me: ;
foaf:primaryTopic me: ;
schema:dateCreated "2020/06/10"^^xsd:date ;
schema:gender "male" ;
schema:birthDate "2001/01/01"^^xsd:date ;
schema:email "[email protected]" ;
viz:nodeSize 0.55 .
#
# This vocab term meta-data really belongs in the vocab itself - just
# duplicated here to provide easy documentation in visualizations...
#
ws:Storage a rdfs:Class ;
rdfs:comment "The class of Pod storage - this can be any Solid-compliant server, storing any user data."@en ;
rdfs:comment "La clase de almacenamiento de Pod: puede ser cualquier servidor compatible con Solid que almacene los datos del usuario."@es .
#
# Describe this Pod instance (is this allowed to add meta-data for the Named Graph itself?!)
#
my-storage: a ws:Storage ;
rdfs:label "Solid Pod"@en ;
rdfs:comment "An example Solid Pod hosted (for free!) by Inrupt."@en ;
rdfs:comment "Un ejemplo de Solid Pod alojado (¡gratis!) Por Inrupt."@es ;
solid-ext:hasServiceManager my-storage:Service-Manager ;
viz:nodeSize 0.45 .
#
# My homes or houses (e.g., vacation home, rental properties, etc.)...
#
my-storage:House-Phibsboro a schema:House ;
rdfs:comment "Lovely end-of-terrace Victorian redbrick overlooking pitch-and-putt course."@en ;
schema:numberOfRooms "8"^^xsd:integer ;
schema:address "Phibsboro, Dublin 7"@en .
#
# My bikes...
#
my-storage:Bike-Cannondale-EVO a pto:Bicycle ;
rdfs:comment "Wow! I really love this amazing bike - super light, super responsive, and superb for climbing."@en ;
rdfs:comment "¡Guau! Realmente amo esta increíble bicicleta: súper liviana, súper sensible y excelente para escalar."@es ;
schema:mileageFromOdometer "983km" ;
schema:purchaseDate "2021/01/01"^^xsd:date ;
schema:size "54cm" ;
schema:price "Don't ask!" .
my-storage:Bike-Felt-Commuter a pto:Bicycle ;
rdfs:comment "My trusty commuter - but NOT a bike I particularly like, as it's so heavy."@en ;
schema:mileageFromOdometer "63,000km" ;
schema:purchaseDate "2014/01/01"^^xsd:date ;
schema:price "900.0"^^xsd:decimal ;
schema:currency "EUR" .
#
# My pets...
#
my-storage:Pet-Dog a pto:Dog ;
rdfs:seeAlso <https://en.wikipedia.org/wiki/Jack_Russell_Terrier> ;
schema:name "Bobby"@en, "Bobik"@sk ;
schema:comment "Bobby the wonder dog!"@en ;
schema:birthDate "2011/04/04"^^xsd:date ;
# Wikidata provides a simple 'breed' property:
wikidata:Q38829 "Jack Russell"@en .
#
# My Service Manager.
#
my-storage:Service-Manager a solid-ext:ServiceManager ;
rdfs:comment "Service manager (e.g., for managing my views, transactions, access control, contacts, etc.)."@en ;
ldp:contains
my-storage:Service-Notification ,
my-storage:Service-Consent ,
my-storage:Service-ThingsIOwn ,
my-storage:Service-ViewMyData ,
my-storage:Service-Transactions ;
viz:nodeSize 0.5 .
#
# My Notification service...
#
my-storage:Service-Notification a solid-ext:Service ;
rdfs:comment "Service to help us manage notifications and events across an entire Pod, and even multiple Pods."@en ;
viz:nodeSize 0.3 .
#
# My Consent service...
#
my-storage:Service-Consent a solid-ext:Service ;
rdfs:comment "Service handling Consent (granting, revoking, receipts, etc.)."@en ;
viz:nodeSize 0.3 .
#
# My Owning service...
#
my-storage:Service-ThingsIOwn a solid-ext:Service ;
rdfs:comment "Service to manage things I 'own'."@en ;
ldp:contains
my-storage:Bike-Cannondale-EVO ,
my-storage:Bike-Felt-Commuter ,
my-storage:Pet-Dog ,
my-storage:House-Phibsboro ;
viz:nodeSize 0.3 .
#
# My Transaction service...
#
my-storage:Service-Transactions a solid-ext:Service ;
rdfs:comment "Service to manage transactions in a Pod, e.g., credit card purchases, house purchases, etc."@en ;
ldp:contains
my-storage:Txn-CreditCard-1 ,
my-storage:Txn-DebitCard-1 ,
my-storage:Txn-CreditCard-2 ,
my-storage:Txn-Creditcard-3-EVO ;
viz:nodeSize 0.3 .
my-storage:Txn-CreditCard-1 a schema:BuyAction ;
rdfs:comment "Dinner in restaurant on vacation in Mexico."@en ;
schema:amount "800.00"^^xsd:decimal ;
schema:currency "MXN" ;
schema:seller "Pujol, Mexico City" .
my-storage:Txn-DebitCard-1 a schema:BuyAction ;
rdfs:comment "Bought shoes for kids."@en ;
schema:amount "30.00"^^xsd:decimal ;
schema:currency "EUR" ;
schema:seller "Kiddies Feet, Liffey Street, Dublin" .
my-storage:Txn-CreditCard-2 a schema:BuyAction ;
rdfs:comment "Booked holiday with Ryanair."@en ;
schema:amount "9.99"^^xsd:decimal ;
schema:currency "EUR" ;
schema:seller <https://www.ryanair.com> .
my-storage:Txn-Creditcard-3-EVO a schema:BuyAction ;
rdfs:comment "Bought Cannondale EVO bicycle."@en ;
schema:item my-storage:Bike-Cannondale-EVO ;
schema:amount "LOTS!!" ;
schema:currency "EUR" ;
schema:seller <https://www.cyclesuperstore.ie/> .
#
# My blog...
#
my-storage:Blog a schema:Blog, solid-ext:Resource;
rdfs:label "My Blog"@en ;
ldp:contains
my-storage:Blog-Entry-2 ,
my-storage:Blog-Entry-1 .
#
# A single blog entry - but it's a 'complex' entity, with a 'structure' made up of a 'Header' and
# 'Footer' and attachments, etc.
#
my-storage:Blog-Entry-2 a schema:BlogPosting ;
rdfs:comment "This blog entry has a more complex structure, with header, body, and footer sections..."@en ;
schema:hasPart
my-storage:Blog-Entry-2-Structure-Header ,
my-storage:Blog-Entry-2-Structure-Body ,
my-storage:Blog-Entry-2-Structure-Footer .
my-storage:Blog-Entry-2-Structure-Header rdfs:comment "Arbitrary header contents..."@en .
my-storage:Blog-Entry-2-Structure-Body
schema:title "Ya gotta love the Simpsons - blog about the 'How to Cook for Forty Humans' episode"@en ;
schema:articleBody "Lisa Simpson - 'Truly there were monsters on that ship, and truly we were them.'"@en ;
schema:messageAttachment <https://simpsonswiki.com/wiki/How_to_Cook_for_Forty_Humans> .
my-storage:Blog-Entry-2-Structure-Footer
rdfs:comment "This blog entry has, for no particular reason(!), a footer section that mentions my favorite bike..."@en ;
schema:mentions my-storage:Bike-Cannondale-EVO .
# Loops are totally fine, SPARQL property paths will not infinitely recurse!
# schema:hasPart my-storage:Blog-Entry-2 ;
# ldp:contains my-storage:Blog-Entry-2 .
my-storage:Blog-Entry-1 a schema:BlogPosting ;
schema:title "Blog about the new house that we just bought...!"@en ;
schema:articleBody "It was a long, drawn out saga, but we finally managed to secure our dream house, in Phibsboro. But then COVID happened... (We mention the house itself via a link!)"@en ;
schema:mentions my-storage:House-Phibsboro .
#
# My View service...
#
my-storage:Service-ViewMyData a solid-ext:Service ;
rdfs:comment "Service to manage all my views over my Pod, e.g., hierarchical, tag-based, etc."@en ;
ldp:contains
my-storage:View-Hierarchy-By-Files ,
my-storage:View-Hierarchy-By-Sensitivity ,
my-storage:View-Tagged ;
viz:nodeSize 0.3 .
#
# Hierarchical by folder...
#
my-storage:View-Hierarchy-By-Files a solid-ext:View ;
rdfs:comment "Legacy Solid hierarchy view - folders and files."@en ;
ldp:contains
my-storage:Public-Folder,
my-storage:Private-Folder ,
my-storage:Photo-Folder .
my-storage:Public-Folder # (FOR NOW) a ldp:BasicContainer ;
ldp:contains
# my-storage:Photo-Dog-1 , # REMOVE FOR NOW - It's contained in 'Photo-Folder' too
my-storage:Photo-Dog-21 ,
my-storage:Blog .
my-storage:Private-Folder # (FOR NOW) a ldp:BasicContainer ;
ldp:contains
my-storage:My-Current-Location,
my-storage:Photo-Heart-Scan .
my-storage:Photo-Folder # (FOR NOW) a ldp:BasicContainer ;
ldp:contains
my-storage:Photo-Dog-1 ,
my-storage:Photo-Dog-2 ,
my-storage:Photo-Dog-21 ,
my-storage:Photo-Folder-Friends .
my-storage:Photo-Folder-Friends # (FOR NOW) a ldp:BasicContainer ;
ldp:contains my-storage:Photo-Graduation-43 .
my-storage:Photo-Dog-1 a schema:Photo ;
rdfs:seeAlso my-storage:Pet-Dog.
my-storage:Photo-Dog-2 a schema:Photo ;
rdfs:seeAlso <https://musicart.xboxlive.com/6/cfa9c6d7-0000-0000-0000-000000000009/504/image.jpg?w=1920&h=1080>.
my-storage:Photo-Dog-21 a schema:Photo ;
schema:mentions my-storage:Pet-Dog ;
rdfs:seeAlso my-storage:Pet-Dog .
my-storage:Photo-Graduation-43 a schema:Photo ;
rdfs:comment "Group photo, such as this graduation photo, might be an opportunity to cross-link to classmates, or university, or qualification, or alumni..."@en .
my-storage:Photo-Heart-Scan a schema:Photo ;
rdfs:comment "Professional sportspeople can suffer serious contractual repercussions from *ANY* medical data leaking..."@en .
my-storage:My-Current-Location a schema:Place ;
rdfs:comment "At home in Dublin, Ireland."@en ;
schema:longitude "53.3493° N" ;
schema:latitude "6.2607° W" ;
schema:location my-storage:House-Phibsboro .
#
# Hierarchical by data-sensitivity...
#
my-storage:View-Hierarchy-By-Sensitivity a solid-ext:View ;
rdfs:comment "Hierarchy view by sensitivity."@en ;
ldp:contains
# my-storage:Public-Folder , # REMOVE FOR NOW - Cross-references are initially confusing!
my-storage:Published-Folder ,
my-storage:Secret-Folder ,
my-storage:Confidential-Folder .
my-storage:Published-Folder # (FOR NOW) a ldp:BasicContainer ;
ldp:contains
my-storage:Blog .
my-storage:Secret-Folder # (FOR NOW) a ldp:BasicContainer ;
ldp:contains
my-storage:Photo-Heart-Scan ,
my-storage:My-Current-Location .
my-storage:Confidential-Folder # (FOR NOW) a ldp:BasicContainer ;
ldp:contains my-storage:Photo-X-Ray-32 .
my-storage:Photo-X-Ray-32 a schema:Photo ;
rdfs:comment "This might be a 'confidential' X-ray, but from childhood, and so not 'secret' (i.e., it wouldn't affect a professional sportsperson's contract negotiations), but might be relevant to a local family doctor perhaps...)"@en ;
schema:dateCreated "2005/06/10"^^xsd:date .
#
# My Tagged View...
#
my-storage:View-Tagged a solid-ext:View ;
rdfs:comment "Manages references to resources I wish to view by tags I've created."@en ;
ldp:contains my-storage:tag-bike, my-storage:tag-mortgage, my-storage:tag-i-like .
my-storage:tag-bike a solid-ext:Tag ; # (FOR NOW) , ldp:BasicContainer ;
rdfs:comment "Resources I've tagged as being bikes."@en ;
solid-ext:tagValue "bike"@en ;
ldp:contains my-storage:Bike-Cannondale-EVO, my-storage:Bike-Felt-Commuter .
my-storage:tag-mortgage a solid-ext:Tag ; # (FOR NOW) , ldp:BasicContainer ;
rdfs:comment "Resources I've tagged as being mortgages."@en ;
solid-ext:tagValue "mortgage"@en ;
ldp:contains my-storage:House-Phibsboro.
my-storage:tag-i-like a solid-ext:Tag ; # (FOR NOW) , ldp:BasicContainer ;
rdfs:comment "Resources I've tagged as being things I like!"@en ;
solid-ext:tagValue "like"@en ;
ldp:contains
my-storage:Bike-Cannondale-EVO ,
my-storage:Pet-Dog .
#
# I still like a Named Graph of '<my-pod>/resource/<path>?meta=http', but that's just for
# 'Resources' - what about 'normal' RDF Subjects (i.e., nodes) (what about Objects that are IRIs?)?
#
# Let's say I POST arbitrary RDF payload to '<my-pod>/ingest':
<https://www.justinbiebermusic.com/profile/card#me> rdfs:label "Justin Bieber" ;
sioc:likes dbpedia:Mickey_Mouse .
dbpedia:Michael_Jackson schema:birthDate "1958-08-29" ;
schema:height "213cm" .
# That should return a 'Location:' header with information about that POST:
# Location: <my-pod>/query?subject=my-storage:event-ingest-999
my-storage:event-ingest-999 a solid-ext:EventIngestRdf ;
httph:method "POST" ;
httph:content-type "application/trig" ;
schema:startTime "10:32am April 1st 2021" ;
# solid-ext:authUser me: ; # This is correct, but clutters up graph initially...
solid-ext:receivedRawPayload my-storage:blob-store-1 ;
# How can we link this POST request to the nodes now in our graph that were contained in it's
# payload...?
solid-ext:ingestSubject <https://www.justinbiebermusic.com/profile/card#me>,
dbpedia:Michael_Jackson .
#
# POST /resourceX
#
# dbpedia:Michael_Jackson sioc:likes dbpedia:Mickey_Mouse .
#
# It would seem that the node 'dbpedia:Michael_Jackson' is now orphaned, and that /resourceX is a
# completely meaningless IRI too - i.e., to handle it at all, we need to force a node into our
# graph, which is fine too I guess...
#
# But also to post a 'ldp:contains' triple to it's 'parent resource'
#
# GET /resourceX
#
# Access control for my Blog...
#
my-storage:Blog acp:accessControl my-storage:acrForBlog .
# ACR for Blog - friends can read, controllers can read/write/append.
my-storage:acrForBlog a acp:AccessControlResource ;
acp:apply my-storage:policyFriendNotNeighbour ;
acp:access my-storage:myAccountControllerPolicy.
my-storage:Blog-Entry-2 acp:accessControl [
a acp:AccessControlResource ;
acp:apply my-storage:policyFriendsFromCollegeAndSchoolInWork
] .
#
# Policies.
#
my-storage:myAccountControllerPolicy a acp:AccessControlPolicy ;
acp:allow acp:Read, acp:Write, acp:Append ;
acp:allOf my-storage:myMatcherTrusted .
my-storage:policyFriend a acp:AccessControlPolicy ;
acp:allow acp:Read ;
acp:anyOf my-storage:myMatcherFriendCollege, my-storage:myMatcherFriendWork .
my-storage:policyFriendsFromCollegeInWork a acp:AccessControlPolicy ;
acp:allow acp:Read ;
acp:allOf my-storage:myMatcherFriendCollege, my-storage:myMatcherFriendWork .
my-storage:policyFriendsFromCollegeAndSchoolInWork a acp:AccessControlPolicy ;
acp:allow acp:Read ;
acp:allOf
my-storage:myMatcherFriendCollege ,
my-storage:myMatcherFriendSchool ,
my-storage:myMatcherFriendWork ;
acp:noneOf my-storage:myMatcherNeighbour .
my-storage:policyFriendNotNeighbour a acp:AccessControlPolicy ;
acp:allow acp:Read ;
acp:allOf my-storage:myMatcherFriendCollege, my-storage:myMatcherFriendWork ;
acp:noneOf my-storage:myMatcherNeighbour .
#
# Matchers (all entries are OR'ed - any one match means the Matcher matches).
#
my-storage:myMatcherTrusted a acp:Matcher ;
acp:agent
webIdHarry: ,
webIdIvanna: .
my-storage:myMatcherNeighbour a acp:Matcher ;
acp:agent
webIdAlice: ,
webIdBob: .
my-storage:myMatcherFriendCollege a acp:Matcher ;
acp:agent
webIdAlice: ,
webIdBob: ,
webIdCarol: ,
webIdGreg: .
my-storage:myMatcherFriendSchool a acp:Matcher ;
acp:agent
webIdAlice: ,
webIdCarol: .
my-storage:myMatcherFriendWork a acp:Matcher ;
acp:agent
webIdAlice: ,
webIdCarol: ,
webIdDee: ,
webIdErik: ,
webIdFiona: ,
webIdGreg: .
}
#
# ACP in a separate Named Graph (separation of data and ACP).
#
my-storage-ACP: {
my-storage:Blog acp:accessControl my-storage:acrForBlog .
# ACR for Blog - friends can read, controllers can read/write/append.
my-storage:acrForBlog a acp:AccessControlResource ;
acp:apply my-storage:policyFriendNotNeighbour ;
acp:access my-storage:myAccountControllerPolicy.
}