Skip to content

Commit 30a0355

Browse files
committed
feat: initial demo setup
Signed-off-by: Wouter Termont <wouter.termont@ugent.be>
1 parent 61d1de1 commit 30a0355

File tree

15 files changed

+1450
-1089
lines changed

15 files changed

+1450
-1089
lines changed

packages/css/config/demo.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"@context": [
3+
"https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^7.0.0/components/context.jsonld",
4+
"https://linkedsoftwaredependencies.org/bundles/npm/@solidlab/derived-resources-component/^1.0.0/components/context.jsonld"
5+
],
6+
"@graph": [
7+
{
8+
"@id": "urn:solid-server:derived:PodResourcesOverride",
9+
"@type": "Override",
10+
"overrideInstance": {
11+
"@id": "urn:solid-server:default:PodResourcesGenerator"
12+
},
13+
"overrideParameters": {
14+
"@type": "StaticFolderGenerator",
15+
"templateFolder": "templates/pod",
16+
"resourcesGenerator": {
17+
"@id": "urn:solid-server:default:TemplatedResourcesGenerator"
18+
}
19+
}
20+
}
21+
]
22+
}

packages/css/config/derived.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"@context": [
3+
"https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^7.0.0/components/context.jsonld",
4+
"https://linkedsoftwaredependencies.org/bundles/npm/@solidlab/derived-resources-component/^1.0.0/components/context.jsonld"
5+
],
6+
"@graph": [
7+
{
8+
"comment": "We need to disable the index store as it might accidentally return derived template resources.",
9+
"@id": "urn:solid-server:default:ResourceStore_Index",
10+
"@type": "IndexRepresentationStore",
11+
"mediaRange": ""
12+
},
13+
{
14+
"comment": "A second converting store",
15+
"@id": "urn:solid-server:derived:RepresentationConvertingStore",
16+
"@type": "RepresentationConvertingStore",
17+
"metadataStrategy": { "@id": "urn:solid-server:default:MetadataStrategy" },
18+
"options_inConverter": { "@id": "urn:solid-server:default:RepresentationConverter" },
19+
"options_outConverter": { "@id": "urn:solid-server:default:UiEnabledConverter" },
20+
"source": { "@id": "urn:solid-server:derived:DerivedResourceStore" }
21+
},
22+
{
23+
"comment": "The store responsible for generating derived resources.",
24+
"@id": "urn:solid-server:derived:DerivedResourceStore",
25+
"@type": "DerivedResourceStore",
26+
"manager": {
27+
"@id": "urn:solid-server:derived:DerivationManager",
28+
"@type": "MetadataDerivationManager",
29+
"identifierStrategy": { "@id": "urn:solid-server:default:IdentifierStrategy" },
30+
"store": { "@id": "urn:solid-server:default:ResourceStore_Patching" },
31+
"derivationMatcher": {
32+
"@type": "PresetDerivationMatcher",
33+
"source": { "@type": "TemplateDerivationMatcher" }
34+
},
35+
"selectorHandler": {
36+
"@id": "urn:solid-server:default:SelectorHandler",
37+
"@type": "GlobSelectorHandler",
38+
"store": { "@id": "urn:solid-server:default:ResourceStore_Patching" }
39+
},
40+
"filterHandler": {
41+
"@id": "urn:solid-server:default:FilterHandler",
42+
"@type": "SparqlFilterHandler",
43+
"store": { "@id": "urn:solid-server:default:ResourceStore_Patching" }
44+
}
45+
},
46+
"source": { "@id": "urn:solid-server:default:ResourceStore_Patching" }
47+
},
48+
{
49+
"comment": "Insert our new stores in front of the original converting store.",
50+
"@id": "urn:solid-server:derived:PatchOverride",
51+
"@type": "Override",
52+
"overrideInstance": { "@id": "urn:solid-server:default:ResourceStore_Locking" },
53+
"overrideParameters": {
54+
"@type": "PatchingStore",
55+
"source": { "@id": "urn:solid-server:derived:RepresentationConvertingStore" }
56+
}
57+
},
58+
{
59+
"comment": [
60+
"Keep query parameters in identifiers.",
61+
"This makes it so that any query parameters can cause issues with normal resources so we might want a more robust solution."
62+
],
63+
"@id": "urn:solid-server:derived:TargetExtractorOverride",
64+
"@type": "Override",
65+
"overrideInstance": { "@id": "urn:solid-server:default:TargetExtractor" },
66+
"overrideParameters": {
67+
"@type": "OriginalUrlExtractor",
68+
"includeQueryString": true
69+
}
70+
}
71+
]
72+
}

packages/css/config/seed.json

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,44 @@
55
"authz": {
66
"server": "http://localhost:4000/uma"
77
},
8-
"pods": [ { "name": "alice" } ]
8+
"pods": [{
9+
"name": "alice",
10+
"settings": {
11+
"name": "Alice",
12+
"umaServer": "http://localhost:4000/uma"
13+
}
14+
}]
915
},
1016
{
1117
"email": "bob@example.org",
1218
"password": "abc123",
1319
"authz": {
1420
"server": "http://localhost:4000/uma"
1521
},
16-
"pods": [ { "name": "bob" } ]
22+
"pods": [
23+
{
24+
"name": "bob",
25+
"settings": {
26+
"name": "Bob",
27+
"umaServer": "http://localhost:4000/uma"
28+
}
29+
}
30+
]
31+
},
32+
{
33+
"email": "demo@example.org",
34+
"password": "abc123",
35+
"authz": {
36+
"server": "http://localhost:4000/uma"
37+
},
38+
"pods": [
39+
{
40+
"name": "demo",
41+
"settings": {
42+
"name": "Demo",
43+
"umaServer": "http://localhost:4000/uma"
44+
}
45+
}
46+
]
1747
}
1848
]

packages/css/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@
6060
"build:ts": "yarn run -T tsc",
6161
"build:components": "yarn run -T componentsjs-generator -r uma-css -s src/ -c dist/components -i .componentsignore --lenient",
6262
"test": "yarn run -T jest --coverage",
63-
"start": "yarn run community-solid-server -m . -c ./config/default.json --seedConfig ./config/seed.json"
63+
"start": "yarn run community-solid-server -m . -c ./config/default.json ./config/derived.json ./config/demo.json --seedConfig ./config/seed.json"
6464
},
6565
"dependencies": {
6666
"@solid/community-server": "^7.0.2",
67-
"@solidlab/derived-resources-component": "^1.0.0",
67+
"@solidlab/derived-resources-component": "^1.0.1",
6868
"@solidlab/uma": "workspace:^",
6969
"componentsjs": "^5.4.2",
7070
"cross-fetch": "^4.0.0",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@prefix pim: <http://www.w3.org/ns/pim/space#>.
2+
3+
<> a pim:Storage.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Welcome to your pod
2+
3+
## A place to store your data
4+
Your pod is a **secure storage space** for your documents and data.
5+
<br>
6+
You can choose to share those with other people and apps.
7+
8+
As the owner of this pod,
9+
identified by <a href="{{webId}}">{{webId}}</a>,
10+
you have access to all of your documents.
11+
12+
## Working with your pod
13+
The easiest way to interact with pods
14+
is through Solid apps.
15+
<br>
16+
For example,
17+
you can open your pod in [Databrowser](https://solidos.github.io/mashlib/dist/browse.html?uri={{base.path}}).
18+
19+
## Accessing your account
20+
To keep track of your pods, webIDs and any other resources,
21+
you can [log in]({{oidcIssuer}}.account/) to your account.
22+
There you can, for example, update the owners of this pod.
23+
24+
## Learn more
25+
The [Solid website](https://solidproject.org/)
26+
and the people on its [forum](https://forum.solidproject.org/)
27+
will be glad to help you on your journey.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@prefix derived: <urn:npm:solid:derived-resources:> .
2+
3+
<>
4+
derived:derivedResource [
5+
derived:template "derived/bday";
6+
derived:selector <./data>;
7+
derived:filter <../public/filters/bday>
8+
].
9+
10+
<>
11+
derived:derivedResource [
12+
derived:template "derived/age";
13+
derived:selector <./data>;
14+
derived:filter <../public/filters/age>
15+
].
16+
17+
# <>
18+
# derived:derivedResource [
19+
# derived:template "query{?var}";
20+
# derived:selector <selectors/data>;
21+
# derived:filter <filters/var>
22+
# ].
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@prefix ruben: <https://ruben.verborgh.org/profile/#me>.
2+
@prefix con: <http://www.w3.org/2000/10/swap/pim/contact#>.
3+
@prefix dbo: <http://dbpedia.org/ontology/>.
4+
@prefix dbp: <http://dbpedia.org/resource/>.
5+
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
6+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
7+
@prefix vcard: <http://www.w3.org/2006/vcard/ns#>.
8+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
9+
10+
ruben: a foaf:Person;
11+
foaf:name "Ruben Verborgh"@en, "Ruben Verborgh"@nl;
12+
rdfs:label "Ruben Verborgh"@en, "Ruben Verborgh"@nl;
13+
vcard:fn "Ruben Verborgh"@en, "Ruben Verborgh"@nl;
14+
con:preferredURI "https://ruben.verborgh.org/profile/#me";
15+
foaf:givenName "Ruben"@en, "Ruben"@nl;
16+
foaf:familyName "Verborgh"@en, "Verborgh"@nl;
17+
rdfs:label "Ruben Verborgh"@en, "Ruben Verborgh"@nl;
18+
dbo:birthPlace dbp:Ostend;
19+
dbo:birthDate "1987-02-28"^^xsd:date;
20+
foaf:gender "male"@en.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
2+
@prefix solid: <http://www.w3.org/ns/solid/terms#>.
3+
4+
<>
5+
a foaf:PersonalProfileDocument;
6+
foaf:maker <{{webId}}>;
7+
foaf:primaryTopic <{{webId}}>.
8+
9+
<{{webId}}>
10+
{{#if name}}foaf:name "{{name}}";{{/if}}
11+
{{#if umaServer}}solid:umaServer "{{umaServer}}";{{/if}}
12+
{{#if oidcIssuer}}solid:oidcIssuer <{{oidcIssuer}}>;{{/if}}
13+
a foaf:Person.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#
2+
# THIS IS A COPY OF ../private/.meta
3+
4+
@prefix derived: <urn:npm:solid:derived-resources:> .
5+
6+
<>
7+
derived:derivedResource [
8+
derived:template "derived/bday";
9+
derived:selector <./data>;
10+
derived:filter <filters/bday>
11+
].
12+
13+
<>
14+
derived:derivedResource [
15+
derived:template "derived/age";
16+
derived:selector <./data>;
17+
derived:filter <filters/age>
18+
].
19+
20+
# <>
21+
# derived:derivedResource [
22+
# derived:template "query{?var}";
23+
# derived:selector <selectors/data>;
24+
# derived:filter <filters/var>
25+
# ].

0 commit comments

Comments
 (0)