researchspace / researchspace

ResearchSpace Platform
Other
118 stars 36 forks source link

Wrong LDP container IRI when deleting an entity with LDP persistence #269

Open gspinaci opened 2 years ago

gspinaci commented 2 years ago

We must keep data about the provenance, so using the SPARQL solution does not seem a solution for us. Therefore, we have decided to use LDP.

When I create an entity using the Semantic Forms, the system automatically creates its LDP container with trailing /container in its IRI.

At this point, we have:

## Subject
https://archipelago.itatti.harvard.edu/resource/vocabulary/2adfb93c-d6da-4082-8b2f-2698b106728b

## Container
https://archipelago.itatti.harvard.edu/resource/vocabulary/2adfb93c-d6da-4082-8b2f-2698b106728b/container

## Named Graph
https://archipelago.itatti.harvard.edu/resource/vocabulary/2adfb93c-d6da-4082-8b2f-2698b106728b/container/context

The issue is raised when I try to remove this entity. The system calls the LDP APIs and tries to delete the element with the IRI equals to the subject (in the example above, it is the first element, i.e. the element we have just created)

In this image there is the DELETE request which returns a 404 Error, because no container with this IRI exists

image
gspinaci commented 2 years ago

I have investigated different solutions, but probably the best one would be to inject the trailing /container when deleting an LDP resource (line 106)

https://github.com/researchspace/researchspace/blob/8231baa9c64bb4e883901e034986597ef342988e/src/main/web/api/services/ldp.ts#L105-L108

lklic commented 2 years ago

@aindlq can you share your CIDOC-based SPARQL solution for tracking contributions from multiple researchers?