Sparnatural icon indicating copy to clipboard operation
Sparnatural copied to clipboard

Idea : SHACL-based configuration

Open tfrancart opened this issue 2 years ago • 4 comments

Use SHACL instead of OWL to configure Sparnatural, with SHACL property paths.

tfrancart avatar Aug 16 '22 08:08 tfrancart

@tfrancart have you considered the possibility of configuring using ShEx?

I do not know much about the pros and cons of each of them, but they seem to be different approaches that can (to some extent) specify the same things (here are some details: https://www.weso.es/RDFValidation_ESWC16/slides/ShEx_vs_Shacl.pdf)

The use of ShEx on Wikidata is expanding (https://www.wikidata.org/wiki/Wikidata:WikiProject_Schemas); maybe it could be more familiar to some end users.

anyways, just sharing some thoughts, maybe @labra has something to add?

lubianat avatar Sep 01 '22 19:09 lubianat

SHEX has 2 drawbacks : it is not expressed in triples, and cannot be extended (although we don't really need that for Sparnatural). As Sparnatural already knows how to parse triples for its configuration (currently OWL), relying on SHACL would be easier. Besides, there could be synergies with SHACL Play, another project of mine (https://shacl-play.sparna.fr/play/). This "competition" between SHACL and ShEX is really a pitty and a waste of energy for everyone.

tfrancart avatar Sep 02 '22 21:09 tfrancart

@tfrancart thanks for the explanation! SHACL Play looks really good too. It would be great to have SHACL configs in Sparnatural. (also +1 selfish motive: it would be a good motivation for me to learn more about SHACL)

lubianat avatar Sep 02 '22 21:09 lubianat

As you have referenced me on this issue, I just want to say that ShEx can indeed be expressed in Triples. ShEx has a compact one and a JSON-LD one, and indeed ShEx processors can convert between one to the other easily. You can play with the conversion here: https://rdfshape.weso.es/link/16623616936

About extending ShEx, it has also several way to be extended, like semantic actions, and we have recently added an "extends" keyword to support inheritance betwen shapes.

Anyway, I don't have enough information about your project and use case and maybe there are also some other concerns that you want to take into account for your decision and adoption of SHACL.

labra avatar Sep 05 '22 07:09 labra

In this context, see #377 to separate UI widget from SPARQL code generation, to deal with e.g. time search using xsd:gYear, date range queries, etc.

tfrancart avatar Dec 21 '22 15:12 tfrancart