Turtle file prefixes are lost when updating solid community-server

I am trying to patch a turtle file in solid community-server via a mobile app which contains prefixes. The patch works, but the resulting turtle file does not contain the prefixes it had earlier.

Is there some sort of configuration in the server that I need to set in order to keep the turtle prefixes when patching?

The ontologies are missing or the names of the prefixes have changed?

For instance, if I have the following in a turtle file:

@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix vcard: <http://www.w3.org/2006/vcard/ns#>.

foaf:Person vcard:role "Administrator".
foaf:Person vcard:Email "abc@gmail.com".

after patching it will be:

<http://xmlns.com/foaf/0.1/Person> <http://www.w3.org/2006/vcard/ns#role> "Administrator".
<http://xmlns.com/foaf/0.1/Person> <http://www.w3.org/2006/vcard/ns#Email> "abcd@gmail.com".

That is dependent on the client library that does the patch. Generally there isn’t a way to ensure that the Turtle in the document is in a specific format other than directly writing the Turtle. There is some discussion on a similar issue here : Compression: Possible or preferable to use prefix / aliases with javascript Solid Dataset?.

1 Like

Indeed; there is an open functionality request to preserve prefixes: Maintain prefixes when PATCHing a Turtle representation · Issue #126 · solid/community-server · GitHub
It’s not implemented yet, but should not be too hard.

2 Likes

Thanks @jeffz and @RubenVerborgh. This makes sense. Will see if I can get around this somehow for now.