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 minimal documentation on using SHACL and ShEx for Validation #3484

Open
mfhepp opened this issue Mar 17, 2024 · 0 comments
Open

Add minimal documentation on using SHACL and ShEx for Validation #3484

mfhepp opened this issue Mar 17, 2024 · 0 comments
Labels
guidelines docs examples Work on our supporting materials rather than on schema definitions site tools + python code Infrastructural issues around schema.org site. Most can ignore this! Validator Issues related to Schema Markup Validator

Comments

@mfhepp
Copy link
Contributor

mfhepp commented Mar 17, 2024

I just realized that there are now regularly updated SHACL and ShEx shape definitions for validating data included in each release, like

plus

It would be great if anybody could provide a super-short how-to on how these are meant to be used, e.g. with pySHACL.

  1. Which degree of inferencing is needed (RDFS, OWL2-RL)?
  2. Assuming we have two RDFlib graph objects, data and shapes, what is the intended workflow?

I envision something like this:

import rdflib
from pyshacl import validate

# Which parts should go into the shape graph?
shape_components = [] # List of URLS
rules = rdflib.Graph()
for uri in shape_components:
    rules.parse(url, format="turtle")
# Which parts beside my data should go into the data graph?
data_components = [] # List of URLS or files
data  = rdflib.Graph()
for uri in data_components:
    data.parse(url, format="turtle")
# Which level of inferencing is expected? 
# none, rdfs, or owlrl?
status, results, text = validate(data, shacl_graph=rules, inference='none', serialize_report_graph=False)

But since the shape definitions reference schema-specific types, this leads to lots of violations. The http/https issue adds complexity, too.

So any help will be very much appreciated ;-)!

I am pretty sure many others would benefit.

/CC @danbri @ericprud @ashleysommer

@mfhepp mfhepp added guidelines docs examples Work on our supporting materials rather than on schema definitions Validator Issues related to Schema Markup Validator site tools + python code Infrastructural issues around schema.org site. Most can ignore this! labels Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidelines docs examples Work on our supporting materials rather than on schema definitions site tools + python code Infrastructural issues around schema.org site. Most can ignore this! Validator Issues related to Schema Markup Validator
Projects
None yet
Development

No branches or pull requests

1 participant