node-solid-server icon indicating copy to clipboard operation
node-solid-server copied to clipboard

Use relative URLs in account creation

Open jeff-zucker opened this issue 1 year ago • 4 comments

The current account creation script uses absolute URLs in all profiles, .meta files, and preference files so we have things like

<http://localhost:8444/profile/card#me>  
    <http://www.w3.org/ns/solid/terms#account>
        </>.

Note that the root folder URL is relative and the WebID is absolute. Logically, it would mean the same thing to use a relative URL for the WebID - </profile/card#me>.

This makes the pod more portable and also means that if a user changes the port of their local NSS install, they don't have to rewrite all the URLs. It also makes install of Data-Kitchen easier.

jeff-zucker avatar Apr 29 '24 17:04 jeff-zucker

Hey Jeff,

I'll take a look at your suggestion by updating the templates and seeing what breaks. I'm not sure all of the cascading effects of updating the default templates, but it should be fine to figure out now. My immediate concern is if this would affect multi-user mode in anyway.

zg009 avatar May 03 '24 07:05 zg009

In general we should use relative URL in parameters.

Interesting idea, but not so simple to resolve. NSS was created with the idea that you could use an external webId (not pod related to current pod). This should not break the code structure even if it is not currently possible.

https://github.com/nodeSolidServer/node-solid-server/blob/565c35444e0b97075e23df210118dea4f52d3ed0/lib/models/account-template.js#L74-L80

bourgeoa avatar May 03 '24 16:05 bourgeoa

Interesting idea, but not so simple to resolve. NSS was created with the idea that you could use an external webId (not pod related to current pod).

This can be resolved with a simple if statement or replacement action in the account script. It is not complicated to say "if the WebID is on the same host as the server, use a relative address, otherwise use the full address".

I don't really see that this would impact anything but the account-creation script. We are talking about RDF and the relative or absolute form of the URI is about the turtle representation. Whichever turtle representation is chosen, the RDF will be the same.

jeff-zucker avatar May 03 '24 16:05 jeff-zucker

This can be resolved with a simple if statement or replacement action in the account script. It is not complicated to say "if the WebID is on the same host as the server, use a relative address, otherwise use the full address".

Yes it all about WebID is on the same host as the server.

bourgeoa avatar May 03 '24 16:05 bourgeoa