assemblee-virtuelle / assemblee-virtuelle/semapps

`ldp.resource.patch`: detect if triples are really added or removed

Open
#1,244 0 comments 0 reactions 0 assignees View on GitHub
ldp
Dominant language
TypeScript
Stars
103
Forks
14
Avg merge
1m
Merged PRs (30d)
2

Description

## Problem

If `ldp.resource.patch` is called but the some of the `triplesToAdd` already exist, it will have no impact on the dataset. But in this case, we should not send these triples (as `triplesAdded`) in the `ldp.resource.patched` event.

Similarly, if some of `triplesToRemove` don't exist, they should not be sent (as `triplesRemoved`) in the `ldp.resource.patched` event.

## Proposed solution

First filter triples that are already added or removed.

If no triples are added or removed:
- Don't throw an error (this is OK)
- Don't do the SPARQL update
- Do not send the `ldp.resource.patched` event

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the ldp.resource.patch entry point and trace how triplesToAdd and triplesToRemove are checked before the update and patched event. Verify against the current dataset that existing additions and missing removals are omitted, and that empty effective sets cause no update, error, or event.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
api, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.