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

Convert ShEx to SHACL #114

Open
labra opened this issue Aug 11, 2018 · 2 comments
Open

Convert ShEx to SHACL #114

labra opened this issue Aug 11, 2018 · 2 comments

Comments

@labra
Copy link
Member

labra commented Aug 11, 2018

Implement a converter between ShEx to SHACL.

The converter was already started although some features were not implemented. We will keep this issue open to keep track of the features implemented.

@vemonet
Copy link

vemonet commented Nov 9, 2020

Hi, is there any update on it?

Apparently SHACL can express the integrality of ShEx shapes: https://www.w3.org/2014/data-shapes/wiki/SHACL-ShEx-Comparison

What can be expressed in ShEx, but not in SHACL Core

  • SHACL Core doesn't define TotalDigits and FractionDigits constraint components. These can be defined using SHACL SPARQL or implemented using sh:pattern, sh:minLength etc.

So there is no point in continuing developing any ShEx validation tools, all that is needed is a conversion from ShEx to SHACL and then a performant SHACL validation (Ontotext GraphDB triplestore already implemented automated SHACL validation in their triplestore, so you just need to load the RDF of the SHACL shapes to the write graph and it will only accept graph comforming to the shape)

ShEx would be useful as a subset of SHACL, easier to write than SHACL, but the tooling developed should not be restricted to ShEx or use ShEx. It should always first convert the ShEx to SHACL then do everything on the SHACL model.

This way the community will be able to make use of the SHACL standardization (which allows loading shapes as RDF instead of relying on the development of hadoc tools for ShEx) and extra possibilities

@labra
Copy link
Member Author

labra commented Nov 9, 2020

Hi, is there any update on it?

Thanks for your interest.

We are working on it, although we also have other projects and priorities so we didn't finnish it yet.

Apparently SHACL can express the integrality of ShEx shapes: https://www.w3.org/2014/data-shapes/wiki/SHACL-ShEx-Comparison

I don't agree with that document. Some of the claims made there reflect the opinion of the creators, which you can identify looking at it's history:

https://www.w3.org/2014/data-shapes/wiki/index.php?title=SHACL-ShEx-Comparison&action=history

For a more in-depth comparison I recommend you to read chapter 7 of "Validating RDF data" book: http://book.validatingrdf.com/bookHtml013.html

I also gave recently a tutorial which contains a more updated comparison between them. The slides and video-recording are here: http://www.validatingrdf.com/tutorial/iswc2020/

What can be expressed in ShEx, but not in SHACL Core

  • SHACL Core doesn't define TotalDigits and FractionDigits constraint components. These can be defined using SHACL SPARQL or implemented using sh:pattern, sh:minLength etc.

There are more things that can be expressed in ShEx and not in SHACL. One of the biggest one is the well-founded support for recursion, but there are others like the support for CLOSED that in SHACL is not complete.

So there is no point in continuing developing any ShEx validation tools, all that is needed is a conversion from ShEx to SHACL and then a performant SHACL validation (Ontotext GraphDB triplestore already implemented automated SHACL validation in their triplestore, so you just need to load the RDF of the SHACL shapes to the write graph and it will only accept graph comforming to the shape)

In my opinion, ShEx is a different language to SHACL and has its own merits. There is some underlying phylosophical difference on the motivation to use ShEx or SHACL, which has to do with the goal, if you just one to validate data adding some constraints, SHACL can be enough, but if you want to define an RDF data model for your domain that describes your data, I think ShEx is better suited.

ShEx would be useful as a subset of SHACL, easier to write than SHACL, but the tooling developed should not be restricted to ShEx or use ShEx. It should always first convert the ShEx to SHACL then do everything on the SHACL model.

If it were a subset, maybe, but it isn't. As I said, ShEx supports recursion ,while SHACL doesn't.

This way the community will be able to make use of the SHACL standardization (which allows loading shapes as RDF instead of relying on the development of hadoc tools for ShEx) and extra possibilities

ShEx can also be expressed in RDF. There is a syntax for ShEx called ShExR which also allows to convert between compact syntax to the RDF syntax and the other way around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants