assemblee-virtuelle / assemblee-virtuelle/semapps

Remove triplestore -> jsonld dependency

Open
#1,348 1 comment 0 reactions 0 assignees View on GitHub
docs middleware
Dominant language
TypeScript
Stars
103
Forks
14
Avg merge
1m
Merged PRs (30d)
2

Description

Hello,

I'd want to start a Moleculer Semapps instance with just the `triplestore` service (just accessing database to do queries), but the triplestore service has an **undocumented** dependency to `jsonld` service, which has recursively dependencies to `api` service, and `ontologies` service. It would be nice to be able to start a database adapter without having to declare 3 others services, with api and port required.

The only reference to jsonld inside triplestore service is here: https://github.com/assemblee-virtuelle/semapps/blob/master/src/middleware/packages/triplestore/actions/insert.js#L35-L40

If I understand well, this serves to format RDF query from provided json object, and adding correctly prefixes from ontologies.

I don't know how we can manage to remove this dependency without breaking the feature, except make the jsonld service dependency optional and throw an error if we try to call it if not defined, or otherwise we can try to reimplement the logic of RDF conversion from jsonld service inside the triplestore service (but it's not so easy, as [it also manages a local cache](https://github.com/assemblee-virtuelle/semapps/blob/master/src/middleware/packages/jsonld/services/document-loader/index.js#L26-L46) and so...).

What do you think?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with src/middleware/packages/triplestore/actions/insert.js, especially the referenced jsonld call, and inspect src/middleware/packages/jsonld/services/document-loader/index.js for the cache behavior. Determine how the triplestore can run without the jsonld, api, and ontologies services while preserving RDF conversion and prefix handling; done means the dependency is removed or made safely optional without breaking existing queries.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
backend, databases
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.