Skip to content

Commit

Permalink
docs: Add routing config for sparql endpoint and storage
Browse files Browse the repository at this point in the history
Due to key/value stores using JSON objects,
the SPARQL resource store can not be used to store them,
meaning the only out of the box solution that works is memory storage.
This config makes it so file storage can be used for internal storage
while still having a SPARQL backend.
  • Loading branch information
joachimvh committed Oct 8, 2021
1 parent 13c4904 commit 20c62f4
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions config/sparql-file-storage.json
@@ -0,0 +1,87 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/default.json",
"files-scs:config/app/setup/required.json",
"files-scs:config/http/handler/default.json",
"files-scs:config/http/middleware/websockets.json",
"files-scs:config/http/server-factory/websockets.json",
"files-scs:config/http/static/default.json",
"files-scs:config/identity/access/public.json",
"files-scs:config/identity/email/default.json",
"files-scs:config/identity/handler/default.json",
"files-scs:config/identity/ownership/token.json",
"files-scs:config/identity/pod/static.json",
"files-scs:config/identity/registration/enabled.json",
"files-scs:config/ldp/authentication/dpop-bearer.json",
"files-scs:config/ldp/authorization/webacl.json",
"files-scs:config/ldp/handler/default.json",
"files-scs:config/ldp/metadata-parser/default.json",
"files-scs:config/ldp/metadata-writer/default.json",
"files-scs:config/ldp/modes/default.json",

"files-scs:config/storage/key-value/resource-store.json",
"files-scs:config/storage/middleware/default.json",
"files-scs:config/util/auxiliary/acl.json",
"files-scs:config/util/identifiers/suffix.json",
"files-scs:config/util/index/default.json",
"files-scs:config/util/logging/winston.json",
"files-scs:config/util/representation-conversion/default.json",
"files-scs:config/util/resource-locker/memory.json",
"files-scs:config/util/variables/default.json",

"files-scs:config/storage/backend/data-accessors/file.json",
"files-scs:config/storage/backend/data-accessors/sparql-endpoint.json"
],
"@graph": [
{
"comment": "This store will be used to route internal storage to the file system and all other data to the SPARQL endpoint."
},

{
"@id": "urn:solid-server:default:ResourceStore_Backend",
"@type": "RoutingResourceStore",
"rule": { "@id": "urn:solid-server:default:RouterRule" }
},

{
"comment": "Configure routing to send internal data to file system and all other data to sparql store.",
"@id": "urn:solid-server:default:RouterRule",
"@type": "RegexRouterRule",
"base": { "@id": "urn:solid-server:default:variable:baseUrl" },
"storeMap": [
{
"comment": "Internal storage data",
"RegexRouterRule:_storeMap_key": "^/\\.internal/",
"RegexRouterRule:_storeMap_value": { "@id": "urn:solid-server:default:FileResourceStore" }
},
{
"comment": "Send everything else to the SPARQL store.",
"RegexRouterRule:_storeMap_key": "^/(?!\\.internal/).*",
"RegexRouterRule:_storeMap_value": { "@id": "urn:solid-server:default:SparqlResourceStore" }
}
]
},

{
"@id": "urn:solid-server:default:FileResourceStore",
"@type": "DataAccessorBasedStore",
"identifierStrategy": { "@id": "urn:solid-server:default:IdentifierStrategy" },
"auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" },
"accessor": { "@id": "urn:solid-server:default:FileDataAccessor" }
},
{
"@id": "urn:solid-server:default:SparqlResourceStore",
"@type": "RepresentationConvertingStore",
"options_inConverter": { "@id": "urn:solid-server:default:RepresentationConverter" },
"options_inType": "internal/quads",
"source": {
"@type": "DataAccessorBasedStore",
"identifierStrategy": { "@id": "urn:solid-server:default:IdentifierStrategy" },
"auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" },
"accessor": { "@id": "urn:solid-server:default:SparqlDataAccessor" }
}
}
]
}

0 comments on commit 20c62f4

Please sign in to comment.