feat: hextuple parser and serializer now supports anonymous graph names by edmondchuc · Pull Request #2815 · RDFLib/rdflib (original) (raw)
Summary of changes
Add support for the handling of anonymous graph names in the hextuple parser and serializer.
The previous behaviour always treated the sixth value in the tuple as the IRI of the graph name. However, as per the hextuples spec,
If the graph is a blank node (i.e. anonymous), use an underscore as the URI scheme: _:myNode. (ontola/hextuples#2). Parsers SHOULD interpret these as blank graphs, but MAY discard these if they have no support for them.
This new behaviour now inspects the start of the value and, if it sees _:
, it will treat it as a blank node.
Tests have been added and updated to adjust for this change, including the testing of roundtripping the hextuple format.
Checklist
- Checked that there aren't other open pull requests for
the same change. - Checked that all tests and type checking passes.
- If the change adds new features or changes the RDFLib public API:
- Created an issue to discuss the change and get in-principle agreement.
- Considered adding an example in
./examples
.
- If the change has a potential impact on users of this project:
- Added or updated tests that fail without the change.
- Updated relevant documentation to avoid inaccuracies.
- Considered adding additional documentation.
- Considered granting push permissions to the PR branch,
so maintainers can fix minor issues and keep your PR up to date.