-
Notifications
You must be signed in to change notification settings - Fork 560
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
Namespaces improvements #1000
Namespaces improvements #1000
Conversation
Possibly of interest here https://github.com/tgbugs/pyontutils/blob/master/pyontutils/closed_namespaces.py. Generates the closed namespaces from their source document when main is run, otherwise just acts as a library. |
Thanks @tgbugs for the script! I've only timidly added ClosedNamespaces for a couple of very well known and long-term stable ontologies but we could perhaps use the script for all onts listed here (including schema.org??) since you've made it fast to re-run. I see no reason why we wouldn't add lots of ontologies to rdflib since they aren't large and in doing so we accord with the "batteries included" Python philosophy. This is only due for 6.0.0 (failing Python 2 tests and I won't fix that, just remove Py2 testing soon after 5.0.0). |
FWIW, I think (Related would be something like a |
Agreed, hence I've not done anything with schema.org other than just declare the namespace.
I'd like to get a many common namespaces in to rdflib and then pick off those that could be It might be worth putting out the call to rdflib-dev to ask for namespace contributions - the declarations and the CloseNamespace declaration - for their favourite ontologies. |
My take is that the ClosedNamespace was a way of detecting typos. I would suggest that we consider some variant of |
Failing errors on typos is the primary use case for ClosedNamespace, so that functionality needs to be retained. OpenNamespace (or similar) could be created to support the non-failing case where we also want to provide values for auto-complete but don't want to fail on mismatches. In theory could also add an option to OpenNamespace to warn on mismatch rather than fail. |
@tgbugs @hsolbrig these comments indicate one of both of you might lead this particular (I think small) piece of work?? Looks like we are talking about a new Class - Open/Cached Namespace with a couple of methods and perhaps a one-time processing of a bunch of ontologies into either Open- or ClosedNamespace objects, using the above script. Could one or other of you please champion this for the planning meeting (whether in personal attendance or just by adding to the agenda with your name next to it). Note that there is this difficult issue that is somewhat related: #597. We don't have to solve this in order to progress this Open- ClosedNamespace work but since we're all looking at |
New work is about to start on reevaluating |
Added QB to namespaces, fixed XMLNS (incorrectly declared), ensured all namespaces listed in
namespaces.py.__all__
so can be found, blackednamespaces.py
&__init__.py
.This PR is failing the Py2 tests and this is ok: we'll likely be removing the py2 tests soon after the 5.0.0 release and this PR is aimed at the 6.0.0 release.