Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Non-deterministic prefix creation #1168

Closed
nicholascar opened this issue Sep 17, 2020 · 3 comments
Closed

Non-deterministic prefix creation #1168

nicholascar opened this issue Sep 17, 2020 · 3 comments

Comments

@nicholascar
Copy link
Member

Currently RDFib serializes using all bound prefixes - both those that are set automatically like RDF ("rdf") and OWL etc., as well as those you set manually (g.bind(...)) but also invents some, ns, ns2 etc. This invention is problematic as those prefixes are not in the Namespace Manager and won't always be the same between serializations.

We should remove the auto-creation of prefixes.

We should also perhaps provide prefixes for all Namespaces/ClosedNamesapces/DefinedNamespaces given that many are well known. If we do, they should be default but able to be overridden manually.

While we are at it: remove the ability to import some Namespaces ("RDF", "RDFS") from rdflib and only use rdflib.namespace.

@nicholascar nicholascar changed the title Non-determenistic prefix creation Non-deterministic prefix creation Sep 17, 2020
@tgbugs
Copy link
Contributor

tgbugs commented Oct 20, 2020

It is not possible to remove the auto-creation of prefixes because predicates must be qnamed for xml formats.

@nicholascar
Copy link
Member Author

Since raising this issue I've come to realise this...

I might make a PR that does remove the auto0binding but then re-applies just-in-time it for XML serlialisation (RDF/XML, TRIX etc). This would be better than what we have now: prefixes as-needed only.

@sa-bpelakh
Copy link
Contributor

There is a related issue, not sure if it is in scope for this particular effort - if serialize the results.graph of a CONSTRUCT query, it does not have the prefixes defined in the query itself, and will use inconsistent nsX: temporary names. It would be good to transfer any prefix bindings defined in the query itself into the results graph for better serialization.

@ghost ghost locked and limited conversation to collaborators Dec 27, 2021
@ghost ghost converted this issue into discussion #1618 Dec 27, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants