rdflib.js
rdflib.js copied to clipboard
Impossible to set a namespace prefix in serializer
It is not possible to set namespace prefixes in the serializer; only to suggest them, meaning they cannot override the default prefixes.
As a generic RDF lib, it should be possible to forcefully set any namespace prefix.
As a concrete example, I have a usecase where the schema.org URIs are expressed in the HTTPS scheme. The default schema
prefix targets http://schema.org
. I cannot redefine it.
Here's a PR for this : https://github.com/linkeddata/rdflib.js/pull/534
Note that the default prefix now targets http://schema.org/
(note terminating slash), not http://schema.org
, and the new target you want for them should be https://schema.org/
(again, terminating slash). I cannot make substantive comment on the PR.
Indeed, typo on my part.
@timbl does seem a good idea.
@timbl Related issue : solid-ui demands http://www.w3.org/ns/ui and will fail with https.
Well the policy in Solid has so far to leave all the historical namespaces at http://www.w3.org/
and Dublin Core etc http:
space, and just to actually fetch the ontology from https:
space, either by being redirected at fetch time, or by having code which just adds the s
before the fetch for any ontology. This has worked fine, and all the RDF terms match correctly. Yes, in RDF if you add an 's' to the identifier then it is a different thing and won't work. So don't! :-)
The same had applied to schema.org .
But now schema.org is changing its human-readable documentation at least to use https
. This breaks everything, as it fills the world with a mixture of the two, which will break code and query and data. We need to decide what to do. For example,
- Persuade the schema.org folks to go back to using
http:
uniquely - Persuade them to switch to using
https:
consistently and add special-case conversion of old data - Decide we will violate RDF's tradition of not looking at URIs and build systems which treat the two as the same, for schema.org and anything else. Canonicalize and 'https:
identifier to be always
http(or always
https` ).
rdflib already has some canonicalization code, for example when one uri is redirected 'moved' to another, just using the second.
If we added the ability to switch out old versions of terms for new ones, them also we could use it for moving between old and new ontologies: when you patched a file, the server could switch out the old terms in it. Could be useful. But RDF purists would maybe not like it at all, and systems which did not canonicalize internally would have to be protected by having canonicalizing adapters upstream of them.
Need to move this to a different issue.