Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove triplestore -> jsonld dependency #1348

Open
mguihal opened this issue Dec 27, 2024 · 1 comment
Open

Remove triplestore -> jsonld dependency #1348

mguihal opened this issue Dec 27, 2024 · 1 comment

Comments

@mguihal
Copy link
Contributor

mguihal commented Dec 27, 2024

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 and so...).

What do you think?

@mguihal mguihal changed the title Remove triplestore dependency to jsonld Remove jsonld dependency to triplestore Dec 30, 2024
@mguihal mguihal changed the title Remove jsonld dependency to triplestore Remove triplestore -> jsonld dependency Dec 30, 2024
@srosset81
Copy link
Contributor

When we start managing all content negociation on the API services, the triplestore service will always receive JSON-LD data so it will always need to call this toRDF method. We thus cannot make it optional.

The jsonld.parser service is very lightweight, it's a simple interface to the JSONLD.js tool with local cache. What is heavy is the jsonld.context service, which itself require the jsonld.api, ontologies and api services. Maybe we could make it optional, with a simple contextService param to the jsonld service that default to true ? (it is needed by the LDP service)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants