SPARQL Endpoint for CSS Pod Provider

So after a year ish of running my solid pod against the file system, I’m finding it’s causing some issues and the .ttl files are not robust enough for some of my use cases.

So I’m back to trying to set up my Community Solid server to be backed by a triplestore via SPARQL! And it doesn’t work!

{
  "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^7.0.0/components/context.jsonld",
  "import": [
    "css:config/app/init/static-root.json",
    "css:config/app/main/default.json",
    "css:config/app/variables/default.json",
    "css:config/http/handler/default.json",
    "css:config/http/middleware/default.json",
    "css:config/http/notifications/all.json",
    "css:config/http/server-factory/http.json",
    "css:config/http/static/default.json",
    "css:config/identity/access/public.json",
    "css:config/identity/email/example.json",
    "css:config/identity/handler/default.json",
    "css:config/identity/oidc/default.json",
    "css:config/identity/ownership/token.json",
    "css:config/identity/pod/static.json",
    "css:config/ldp/authentication/dpop-bearer.json",
    "css:config/ldp/authorization/acp.json",
    "css:config/ldp/handler/default.json",
    "css:config/ldp/metadata-parser/default.json",
    "css:config/ldp/metadata-writer/default.json",
    "css:config/ldp/modes/default.json",
    "css:config/storage/key-value/resource-store.json",
    "css:config/storage/location/pod.json",
    "css:config/storage/middleware/default.json",
    "css:config/util/auxiliary/acr.json",
    "css:config/util/identifiers/subdomain.json",
    "css:config/util/index/default.json",
    "css:config/util/logging/winston.json",
    "css:config/util/representation-conversion/default.json",
    "css:config/util/resource-locker/file.json",
    "css:config/util/variables/default.json",
    "css:config/storage/backend/sparql.json",
  ]
}
```

It just hangs when trying to fetch from my sparql endpoint:

2025-11-13T22:31:29.751Z [SparqlDataAccessor] {Primary} error: SPARQL endpoint http://localhost:5173 error: fetch failed

I’m not seeing any requests come in to my sparql endpoint at all. In the source code for the SPARQL data accessor, it says “quad streaming only” – is that the issue I see here? Its trying to ws stream request to my triplestore that doesnt support that?

If I set the internal files to go on the file system, it kinda works but throws an error when I try and make pods with a subdomain url. Is that a known thing?

Basically I’m going for the horizontally scalable docker deployment – get all persistent resources in an external store like redis or a triplestore. Having a hard time with it!

You would probably want to look at the CSS github issues. I think someone made a redis backend but I’m unsure of where to find it and how functional it is.

I would be interested in knowing these use cases.

You would probably want to look at the CSS github issues.

The CSS maintainers are also fairly responsive on the following channels should you need support:

CSS uses GitHub - rubensworks/fetch-sparql-endpoint.js: A simple, lightweight module to send queries to SPARQL endpoints and retrieve their results in a streaming fashion.

You could try it directly with your sparql endpoint. I’m using oxigraph and had to put it behind reverse proxy to handle content negotiation.

Specific part of CSS code is here CommunitySolidServer/src/storage/accessors/SparqlDataAccessor.ts at 212aeebde4a51e0c3aa33f193f068bceba487ecb · CommunitySolidServer/CommunitySolidServer · GitHub

Another great tool which could help is https://www.mitmproxy.org/
You would need to run CSS with `NODE_USE_ENV_PROXY=1 HTTP_PROXY=http://localhost:8080`

1 Like

Yeah! Website analytics. After about 30,000 triples the files get pretty big (2.5mb) and queries get slow, and eventually a triple gets written wrong, leaving behind a trailing . which completely breaks my ability to query it at all. After that, I can’t write any more triples to the file.

I could split the files, but that introduces a lot of “where the URLs at for what” accounting that I don’t want to do, and I don’t want to ask developers to do. So moving to a triple-store solves the issue of a any single graph getting extremely large.

Oh, I bet that’s why I’m having trouble! Can you share your reverse proxy if it’s working with CSS & Oxigraph? I have a really simple NGINX thing running now but it’s not doing any content negotiation whatsoever.

I also might just stand up an apache jena/fuseki server and use that Im sure it’s fine?

At this moment I have it on this branch sai-js/packages/css-storage-fixture/oxigraph.nginx.conf at quadstore · elf-pavlik/sai-js · GitHub
There’s also a docker-compose.yaml at the root of that repo which uses that config.

My setup uses 3 CSS instances, the one using sparql is currently started here: sai-js/packages/css-storage-fixture/package.json at quadstore · elf-pavlik/sai-js · GitHub

I’m replacing those CLI params with env variables that will be set in docker compose. It’s still WIP

Oh awesome! Extremely useful! Thank you, I think I can drop this NGINX config in and be off to the races!

1 Like