RDFLib / rdflib

RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.
https://rdflib.readthedocs.org
BSD 3-Clause "New" or "Revised" License
2.18k stars 559 forks source link

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

Open mgberg opened 5 days ago

mgberg commented 5 days ago

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:

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

coveralls commented 5 days ago

Coverage Status

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