Skip to content
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

feat: hextuple parser and serializer now supports anonymous graph names #2815

Merged
merged 6 commits into from
Jul 24, 2024

Conversation

edmondchuc
Copy link
Contributor

@edmondchuc edmondchuc commented Jul 2, 2024

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.

@edmondchuc
Copy link
Contributor Author

This is some precursor work on parsers to support skolemization at parse time.

@edmondchuc
Copy link
Contributor Author

pre-commit.ci autofix

@coveralls
Copy link

Coverage Status

coverage: 91.044% (+0.01%) from 91.03%
when pulling ef1a229 on edmond/fix-hextuple-graph-handling
into 0ecc400 on main.

@edmondchuc
Copy link
Contributor Author

There seems to be some linting/styling differences with the precommit autofix and the gha:lint rules for ruff.

@coveralls
Copy link

Coverage Status

coverage: 91.034% (+0.004%) from 91.03%
when pulling 68f8cf3 on edmond/fix-hextuple-graph-handling
into 0ecc400 on main.

@coveralls
Copy link

coveralls commented Jul 15, 2024

Coverage Status

coverage: 91.046%. first build
when pulling eb2556a on edmond/fix-hextuple-graph-handling
into 5537d23 on main.

@ashleysommer
Copy link
Contributor

This looks good, tests are fine and tests are passing.

@ashleysommer ashleysommer merged commit bca2567 into main Jul 24, 2024
23 checks passed
@ashleysommer ashleysommer deleted the edmond/fix-hextuple-graph-handling branch July 24, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants