Skip to content

Commit

Permalink
feat: Create routing configs and partially clean up config structure
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimvh committed Nov 4, 2020
1 parent 892b5f5 commit f8542a2
Show file tree
Hide file tree
Showing 12 changed files with 184 additions and 14 deletions.
12 changes: 11 additions & 1 deletion config/config-default.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@
"files-scs:config/presets/logging.json",
"files-scs:config/presets/representation-conversion.json",
"files-scs:config/presets/setup.json",
"files-scs:config/presets/storage-backend/storage-memory.json",
"files-scs:config/presets/storage/backend/storage-memory.json",
"files-scs:config/presets/storage/routing/no-routing.json",
"files-scs:config/presets/storage-wrapper.json",
"files-scs:config/presets/cli-params.json"
],
"@graph": [
{
"comment": "Use a memory based store as backend with no additional routing.",
"@id": "urn:solid-server:default:RoutingResourceStore",
"PassthroughStore:_source": {
"@id": "urn:solid-server:default:MemoryResourceStore"
}
}
]
}
12 changes: 11 additions & 1 deletion config/config-file.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@
"files-scs:config/presets/logging.json",
"files-scs:config/presets/representation-conversion.json",
"files-scs:config/presets/setup.json",
"files-scs:config/presets/storage-backend/storage-filesystem.json",
"files-scs:config/presets/storage/backend/storage-filesystem.json",
"files-scs:config/presets/storage/routing/no-routing.json",
"files-scs:config/presets/storage-wrapper.json",
"files-scs:config/presets/cli-params.json"
],
"@graph": [
{
"comment": "Use a file based store as backend with no additional routing.",
"@id": "urn:solid-server:default:RoutingResourceStore",
"PassthroughStore:_source": {
"@id": "urn:solid-server:default:FileResourceStore"
}
}
]
}
49 changes: 49 additions & 0 deletions config/config-path-routing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/presets/acl.json",
"files-scs:config/presets/http.json",
"files-scs:config/presets/ldp.json",
"files-scs:config/presets/ldp/credentials-extractor.json",
"files-scs:config/presets/ldp/metadata-handler.json",
"files-scs:config/presets/ldp/operation-handler.json",
"files-scs:config/presets/ldp/permissions-extractor.json",
"files-scs:config/presets/ldp/request-parser.json",
"files-scs:config/presets/logging.json",
"files-scs:config/presets/representation-conversion.json",
"files-scs:config/presets/setup.json",
"files-scs:config/presets/storage/backend/storage-filesystem.json",
"files-scs:config/presets/storage/backend/storage-memory.json",
"files-scs:config/presets/storage/backend/storage-sparql-endpoint.json",
"files-scs:config/presets/storage/routing/regex-routing.json",
"files-scs:config/presets/storage-wrapper.json",
"files-scs:config/presets/cli-params.json"
],
"@graph": [
{
"comment": [
"Configure routing to send all requests containing /file/ to the file store, containing /memory/ to the memory store and /sparql/ to the sparql endpoint store.",
"The root .acl file will be stored in the sparql endpoint store."
],
"@id": "urn:solid-server:default:RegexRouterRule",
"RegexRouterRule:_storeMap": [
{
"RegexRouterRule:_storeMap_key": "^/\\.acl$",
"RegexRouterRule:_storeMap_value": { "@id": "urn:solid-server:default:SparqlResourceStore" }
},
{
"RegexRouterRule:_storeMap_key": "/file/",
"RegexRouterRule:_storeMap_value": { "@id": "urn:solid-server:default:FileResourceStore" }
},
{
"RegexRouterRule:_storeMap_key": "/memory/",
"RegexRouterRule:_storeMap_value": { "@id": "urn:solid-server:default:MemoryResourceStore" }
},
{
"RegexRouterRule:_storeMap_key": "/sparql/",
"RegexRouterRule:_storeMap_value": { "@id": "urn:solid-server:default:SparqlResourceStore" }
}
]
}
]
}
30 changes: 30 additions & 0 deletions config/config-rdf-to-sparql-endpoint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/presets/acl.json",
"files-scs:config/presets/http.json",
"files-scs:config/presets/ldp.json",
"files-scs:config/presets/ldp/credentials-extractor.json",
"files-scs:config/presets/ldp/metadata-handler.json",
"files-scs:config/presets/ldp/operation-handler.json",
"files-scs:config/presets/ldp/permissions-extractor.json",
"files-scs:config/presets/ldp/request-parser.json",
"files-scs:config/presets/logging.json",
"files-scs:config/presets/representation-conversion.json",
"files-scs:config/presets/setup.json",
"files-scs:config/presets/storage/backend/storage-filesystem.json",
"files-scs:config/presets/storage/backend/storage-sparql-endpoint.json",
"files-scs:config/presets/storage/routing/quad-type-routing.json",
"files-scs:config/presets/storage-wrapper.json",
"files-scs:config/presets/cli-params.json"
],
"@graph": [
{
"comment": "Sends all data that can be interpreted as RDF to the sparql endpoint store and all other data to the default store (file in this case).",
"@id": "urn:solid-server:default:ConvertingRouterRule",
"ConvertingRouterRule:_defaultStore": {
"@id": "urn:solid-server:default:FileResourceStore"
}
}
]
}
12 changes: 11 additions & 1 deletion config/config-sparql-endpoint.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@
"files-scs:config/presets/logging.json",
"files-scs:config/presets/representation-conversion.json",
"files-scs:config/presets/setup.json",
"files-scs:config/presets/storage-backend/storage-sparql-endpoint.json",
"files-scs:config/presets/storage/backend/storage-sparql-endpoint.json",
"files-scs:config/presets/storage/routing/no-routing.json",
"files-scs:config/presets/storage-wrapper.json",
"files-scs:config/presets/cli-params.json"
],
"@graph": [
{
"comment": "Use a SPARQL based store as backend with no additional routing.",
"@id": "urn:solid-server:default:RoutingResourceStore",
"PassthroughStore:_source": {
"@id": "urn:solid-server:default:SparqlResourceStore"
}
}
]
}
4 changes: 2 additions & 2 deletions config/presets/storage-wrapper.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@id": "urn:solid-server:default:ResourceStore_ToTurtle",
"@type": "RepresentationConvertingStore",
"RepresentationConvertingStore:_source": {
"@id": "urn:solid-server:default:ResourceStore"
"@id": "urn:solid-server:default:RoutingResourceStore"
},
"RepresentationConvertingStore:_outConverter": {
"@id": "urn:solid-server:default:RepresentationConverter"
Expand All @@ -43,7 +43,7 @@
"@id": "urn:solid-server:default:ResourceStore_Converting",
"@type": "RepresentationConvertingStore",
"RepresentationConvertingStore:_source": {
"@id": "urn:solid-server:default:ResourceStore"
"@id": "urn:solid-server:default:RoutingResourceStore"
},
"RepresentationConvertingStore:_outConverter": {
"@id": "urn:solid-server:default:RepresentationConverter"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"ExtensionBasedMapper:_meta": "text/turtle"
},
{
"@id": "urn:solid-server:default:DataAccessor",
"@id": "urn:solid-server:default:FileDataAccessor",
"@type": "FileDataAccessor",
"FileDataAccessor:_resourceMapper": {
"@id": "urn:solid-server:default:FileIdentifierMapper"
Expand All @@ -28,10 +28,10 @@
}
},
{
"@id": "urn:solid-server:default:ResourceStore",
"@id": "urn:solid-server:default:FileResourceStore",
"@type": "DataAccessorBasedStore",
"DataAccessorBasedStore:_accessor": {
"@id": "urn:solid-server:default:DataAccessor"
"@id": "urn:solid-server:default:FileDataAccessor"
},
"DataAccessorBasedStore:_base": {
"@id": "urn:solid-server:default:variable:base"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@type": "MetadataController"
},
{
"@id": "urn:solid-server:default:DataAccessor",
"@id": "urn:solid-server:default:MemoryDataAccessor",
"@type": "InMemoryDataAccessor",
"InMemoryDataAccessor:_base": {
"@id": "urn:solid-server:default:variable:base"
Expand All @@ -16,10 +16,10 @@
}
},
{
"@id": "urn:solid-server:default:ResourceStore",
"@id": "urn:solid-server:default:MemoryResourceStore",
"@type": "DataAccessorBasedStore",
"DataAccessorBasedStore:_accessor": {
"@id": "urn:solid-server:default:DataAccessor"
"@id": "urn:solid-server:default:MemoryDataAccessor"
},
"DataAccessorBasedStore:_base": {
"@id": "urn:solid-server:default:variable:base"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},

{
"@id": "urn:solid-server:default:DataAccessor",
"@id": "urn:solid-server:default:SparqlDataAccessor",
"@type": "SparqlDataAccessor",
"SparqlDataAccessor:_endpoint": {
"@id": "urn:solid-server:default:variable:sparqlEndpoint"
Expand All @@ -27,7 +27,7 @@
"@id": "urn:solid-server:default:DataAccessorBasedStore",
"@type": "DataAccessorBasedStore",
"DataAccessorBasedStore:_accessor": {
"@id": "urn:solid-server:default:DataAccessor"
"@id": "urn:solid-server:default:SparqlDataAccessor"
},
"DataAccessorBasedStore:_base": {
"@id": "urn:solid-server:default:variable:base"
Expand All @@ -41,7 +41,7 @@
},

{
"@id": "urn:solid-server:default:ResourceStore",
"@id": "urn:solid-server:default:SparqlResourceStore",
"@type": "RepresentationConvertingStore",
"RepresentationConvertingStore:_source": {
"@id": "urn:solid-server:default:DataAccessorBasedStore"
Expand Down
12 changes: 12 additions & 0 deletions config/presets/storage/routing/no-routing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"@graph": [
{
"@id": "urn:solid-server:default:RoutingResourceStore",
"@type": "PassthroughStore",
"PassthroughStore:_source": {
"@id": "urn:solid-server:default:BackendResourceStore"
}
}
]
}
30 changes: 30 additions & 0 deletions config/presets/storage/routing/quad-type-routing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"@graph": [
{
"@id": "urn:solid-server:default:PreferenceSupport",
"@type": "PreferenceSupport",
"PreferenceSupport:_type": "internal/quads",
"PreferenceSupport:_converter": {
"@id": "urn:solid-server:default:RepresentationConverter"
}
},
{
"@id": "urn:solid-server:default:ConvertingRouterRule",
"@type": "ConvertingRouterRule",
"ConvertingRouterRule:_store": {
"@id": "urn:solid-server:default:SparqlResourceStore"
},
"ConvertingRouterRule:_supportChecker": {
"@id": "urn:solid-server:default:PreferenceSupport"
}
},
{
"@id": "urn:solid-server:default:RoutingResourceStore",
"@type": "RoutingResourceStore",
"RoutingResourceStore:_rule": {
"@id": "urn:solid-server:default:ConvertingRouterRule"
}
}
]
}
19 changes: 19 additions & 0 deletions config/presets/storage/routing/regex-routing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"@graph": [
{
"@id": "urn:solid-server:default:RegexRouterRule",
"@type": "RegexRouterRule",
"RegexRouterRule:_base": {
"@id": "urn:solid-server:default:variable:base"
}
},
{
"@id": "urn:solid-server:default:RoutingResourceStore",
"@type": "RoutingResourceStore",
"RoutingResourceStore:_rule": {
"@id": "urn:solid-server:default:RegexRouterRule"
}
}
]
}

0 comments on commit f8542a2

Please sign in to comment.