rdflib.js icon indicating copy to clipboard operation
rdflib.js copied to clipboard

deleteDocument() : Error : Statement to be removed is not on store

Open bourgeoa opened this issue 2 years ago • 3 comments

For example trying to edit with the source-pane https://bourgeoa.solidcommunity.net:8443/public/

Statement to be removed is not on store: _:n185 <http://www.w3.org/2007/ont/link#status> _:186 .

_:186 object is the term.value of Collection

The issue occurs only at the st.object being an (object) Collection in the metadata status part. It looks like if st.object do not get the Collection elements.

removeMatches() calls removeMany() that calls remove() that fails on that object Collection.

bourgeoa avatar Jan 15 '24 20:01 bourgeoa

This must be better explained : This is the serialization of the metadata for https://bob.localhost:8443/profile/card

    @prefix : <#>.
    @prefix http: <http://www.w3.org/2007/ont/http#>.
    @prefix httph: <http://www.w3.org/2007/ont/httph#>.
    @prefix tabont: <http://www.w3.org/2007/ont/link#>.
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
    @prefix pro: <https://bob.localhost:8443/profile/>.
    @prefix tur: <http://www.w3.org/ns/iana/media-types/text/turtle#>.
    
    pro:card a tabont:Document, tabont:RDFDocument, tur:Resource.
    [
      rdfs:label "[0:16:34]  Request for https://bob.localhost:8443/profile/card";
      tabont:requestedURI "https://bob.localhost:8443/profile/card";
      tabont:response
              [
                  http:status 200;
                  http:statusText "OK";
                  httph:accept-patch
                      "text/n3, application/sparql-update, application/sparql-update-single-match";
                  httph:accept-post "*/*";
                  httph:accept-put "*/*";
                  httph:access-control-allow-credentials "true";
                  httph:access-control-expose-headers
                      "Authorization, User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Accept-Post, Accept-Put, Updates-Via, Allow, WAC-Allow, Content-Length, WWW-Authenticate, MS-Author-Via, X-Powered-By";
                  httph:allow "OPTIONS, HEAD, GET, PATCH, POST, PUT, DELETE";
                  httph:connection "keep-alive";
                  httph:content-type "text/turtle";
                  httph:date "Thu, 08 Feb 2024 23:16:35 GMT";
                  httph:keep-alive "timeout=5";
                  httph:link
                    '<card.acl>; rel=\"acl\", <card.meta>; rel=\"describedBy\", <http://www.w3.org/ns/ldp#Resource>; rel=\"type\"';
                  httph:ms-author-via "SPARQL";
                  httph:transfer-encoding "chunked";
                  httph:updates-via "wss://bob.localhost:8443";
                  httph:vary "Accept, Authorization, Origin";
                  httph:wac-allow 'user=\"read write append control\",public=\"read\"';
                  httph:x-powered-by "solid-server/5.7.9-beta"
              ];
      tabont:status
              ( "[0:16:35.259] N3 parsed: 13 triples in 26 lines."
              "[0:16:35.259] Done." )
  ].

The issue is with the last object Collection

  [
     .......
     tabont:status
              ( "[0:16:35.259] N3 parsed: 13 triples in 26 lines."
              "[0:16:35.259] Done." )
  ].

bourgeoa avatar Feb 10 '24 10:02 bourgeoa

@angelo @timbl I have prepared 2 working solutions (tested on NSS)

  • PR #633 that remove the use of removeMatches in removeMetadata
  • PR #636 that remove the use of Collection in fetcher to create metadata

bourgeoa avatar Feb 10 '24 19:02 bourgeoa

@timbl The collection issue on store.removeMetadata() is not resolved One way to HACK the issue is to replace the status collection with simple triples

A hack has been implemented in source-pane to move the error to a console.log()

bourgeoa avatar Mar 25 '24 18:03 bourgeoa