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

Add RDFLib Path to SHACL path utility and corresponding tests #2990

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mgberg
Copy link
Contributor

@mgberg mgberg commented Nov 21, 2024

Summary of changes

This adds a utility to take an RDFLib-friendly representation of a property path and build the corresponding SHACL Path representation in RDF (e.g. the objects of triples with predicate sh:path). The provided path object could either be:

  • A URIRef, when the path is simply a predicate
  • A Path, when the path is complex (e.g. a/rdfs:subClassOf*)

This makes it easy to create complex SHACL paths from RDFLib without needing to remember the details about how to construct the RDF representations of those paths correctly.

This is sort of a follow-up to #2699 which added the opposite functionality.

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:
  • Considered granting push permissions to the PR branch,
    so maintainers can fix minor issues and keep your PR up to date.

@mgberg mgberg force-pushed the build-shacl-path branch 2 times, most recently from abbac56 to be63e5a Compare November 21, 2024 14:13
@coveralls
Copy link

Coverage Status

coverage: 90.256% (+0.009%) from 90.247%
when pulling 2163692 on mgberg:build-shacl-path
into a9e30d3 on RDFLib:main.

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.

2 participants