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

Avoid BlankNodes inside PATCHes #390

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

michielbdejong
Copy link
Contributor

@michielbdejong michielbdejong commented Nov 26, 2024

The spec prohibits BlankNodes inside N3 PATCH entries, so let's use a NamedNode here?

Hopefully this can fix solid-contrib/pivot#31

I haven't tested this code yet.

The spec https://solidproject.org/TR/protocol#server-patch-n3-blank-nodes BlankNodes inside N3 PATCH entries, so let's use a NamedNode here?

Hopefully this can fix solid-contrib/pivot#31
@michielbdejong
Copy link
Contributor Author

Ah, and the unit tests are already failing :) NamedNode IRI "mock_app_id" must be absolute.

@michielbdejong
Copy link
Contributor Author

Unit tests fixed. I'll see if I can test it manually in a development setup too.

@michielbdejong
Copy link
Contributor Author

I tried testing these changes by loading the basicPreferencePane into the Solid Pane Tester, but didn't get past this screen:
Screenshot 2024-11-26 at 16 31 10
Can someone else maybe test if this PR works as desired?

@bourgeoa
Copy link
Contributor

I'm wondering if other panes have the same issue like contacts ...
It can happen in every updater.update where text/N3 patch is required

Isn't this is basically a rdflib issue
https://github.com/linkeddata/rdflib.js/blob/82f693dc10d5b915f97eedeab5351cf831c3611e/src/update-manager.ts#L815

@michielbdejong
Copy link
Contributor Author

I searched for occurrences of updater.update across Solid OS and at first glance it looks like this was the only place where we were including triples with blank nodes.

Apart from the unit tests passing, thanks to @bourgeoa I was able to test this on http://solidcommunity.net:8443 and update my trusted applications successfully. The request it makes now contains a named node instead of a blank node, and CSS accepts it:

curl 'https://michielbdejong.solidcommunity.net:8443/profile/card' \
  -X 'PATCH' \
  -H '...'\
  -H 'content-type: text/n3' \
  --data-raw $'\n@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n@prefix ex: <http://www.example.org/terms#>.\n\n_:patch\n\n      solid:inserts {\n        <https://michielbdejong.solidcommunity.net:8443/profile/card#me> <http://www.w3.org/ns/auth/acl#trustedApp> <https://michielbdejong.solidcommunity.net:8443/profile/card#nd3xr> .\n        <https://michielbdejong.solidcommunity.net:8443/profile/card#nd3xr> <http://www.w3.org/ns/auth/acl#origin> <http://localhost:3000> .\n        <https://michielbdejong.solidcommunity.net:8443/profile/card#nd3xr> <http://www.w3.org/ns/auth/acl#mode> <http://www.w3.org/ns/auth/acl#Read> .\n      };   a solid:InsertDeletePatch .\n'

@bourgeoa
Copy link
Contributor

I opened a question to CSS CommunitySolidServer/CommunitySolidServer#1968

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

Successfully merging this pull request may close these issues.

CSS cannot PATCH lists [ ]
2 participants