nodeSolidServer/node-solid-server

Use relative URLs in account creation

Opened this issue · 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.

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.

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.

static templateSubstitutionsFor (userAccount) {
const substitutions = {
name: userAccount.displayName,
webId: userAccount.webId,
email: userAccount.email,
idp: userAccount.idp
}

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.

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.