Skip to content

Commit dea13c7

Browse files
committed
feat: functionality shape validation works again
1 parent edf1f54 commit dea13c7

File tree

12 files changed

+519
-10
lines changed

12 files changed

+519
-10
lines changed

.gitignore

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1-
.data
2-
dist
3-
node_modules
1+
2+
/.acl
3+
/.eslintcache
4+
/componentsjs-error-state.json
5+
/coverage
6+
/data
7+
/dist
8+
/docs
9+
/node_modules
10+
/test/tmp
11+
/.idea

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## TODOs
44

5-
- [ ] make https://github.com/woutslabbinck/community-server/tree/feat/shape-support work in this directory
6-
- [ ] override link header attempt 1
5+
- [x] make https://github.com/woutslabbinck/community-server/tree/feat/shape-support work in this directory
6+
- [x] override link header attempt
77
- [ ] make the tests work
88
- [ ] check everything at https://trello.com/c/JzMVInXw/81-shape-support-pr-after-metadata-editing
99
- [ ] ask feedback Joachim (zal pas na Januari zijn)

config/shape-validation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/shape-validation-component/^5.0.0/components/context.jsonld",
33
"import": [
4-
"shape-validation:config/ldp/metadata-writer/default.json"
4+
"shape-validation:config/ldp/metadata-writer/default.json",
5+
"shape-validation:config/storage/middleware/default.json"
56
]
67
}
78

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"@context":[
3+
"https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^5.0.0/components/context.jsonld",
4+
"https://linkedsoftwaredependencies.org/bundles/npm/shape-validation-component/^5.0.0/components/context.jsonld"
5+
],
6+
"@graph": [
7+
{
8+
"@type": "Override",
9+
"overrideInstance": { "@id": "urn:solid-server:default:ResourceStore_Patching" },
10+
"overrideParameters": {
11+
"@type": "PatchingStore",
12+
"source": { "@id": "urn:shape-validation:default:ResourceStore_Shape" },
13+
"patchHandler": { "@id": "urn:solid-server:default:PatchHandler" }
14+
}
15+
},
16+
{
17+
"comment": "Validates resources when the parent container has ldp:constrainedBy in its metadata",
18+
"@id": "urn:shape-validation:default:ResourceStore_Shape",
19+
"@type": "ShapeValidationStore",
20+
"identifierStrategy": { "@id": "urn:solid-server:default:IdentifierStrategy" },
21+
"metadataStrategy":{ "@id": "urn:solid-server:default:MetadataStrategy" },
22+
"converter": { "@id": "urn:solid-server:default:RepresentationConverter" },
23+
"source": { "@id": "urn:solid-server:default:ResourceStore_Converting" },
24+
"validator": {
25+
"@id": "urn:shape-validation:default:ShaclValidator",
26+
"@type": "ShaclValidator",
27+
"converter": { "@id": "urn:solid-server:default:RepresentationConverter" },
28+
"auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" }
29+
}
30+
}
31+
]
32+
}
33+

package-lock.json

Lines changed: 187 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"https://linkedsoftwaredependencies.org/bundles/npm/shape-validation-component/^5.0.0/dist/": "dist/"
1717
},
1818
"scripts": {
19-
"start": "community-solid-server -c shape-default.json -p 3456 -m .",
19+
"start": "community-solid-server -c shape-default.json -p 3123 -m .",
2020
"build": "npm run build:ts && npm run build:components",
2121
"build:components": "componentsjs-generator -s src -c dist/components -i .componentsignore -r shape-validation",
2222
"build:ts": "tsc",
@@ -28,7 +28,9 @@
2828
"config"
2929
],
3030
"dependencies": {
31-
"@solid/community-server": "^5.0.0"
31+
"@solid/community-server": "^5.1.0",
32+
"@types/rdf-validate-shacl": "^0.2.4",
33+
"rdf-validate-shacl": "^0.3.2"
3234
},
3335
"devDependencies": {
3436
"@tsconfig/node14": "^1.0.3",

shape-default.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
],
4040
"@graph": [
4141
{
42-
"comment": "A single-pod server that stores its resources on disk."
42+
"comment": "A single-pod server that stores its resources in memory."
4343
}
4444
]
4545
}

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export * from './storage/ShapeValidationStore';
2+
export * from './storage/validators/ShaclValidator';
3+
export * from './storage/validators/ShapeValidator';
4+
5+
export * from './util/Vocabularies';

0 commit comments

Comments
 (0)