ShEx and Shacl representations of VF
Moving parts of a discussion started in gitter here, for more permanence. OK to continue here?
@elf-pavlik : In Solid Interoperability Panel we use data shapes quite heavily (one of the participants actually leads https://shex.io/ effort) I think writing up some data shapes might help implementations a lot. While RDFS definitions, for example rdfs:domain and rdfs:range, don't restrict anything only lead to additional statements being inferred. ShEx Triple Constaints provide a clear way to define valid set of values. One could think of it as JSON Schema for RDF.
@hoijui : automatic translation is preferable in my eyes, because defining the same thing manually in two different formats, leads to problems, same like copy&pasting code files and then changing minimal parts of them.
@lynnfoster : yes absolutely if we can do an automatic translation, that would be great! The problem I see is that a reason to use ShEx is to add cardenalities and other constraints that aren't in the turtle file. Unless we decide to use some OWL 2 elements maybe? But, yes, if there is a translator available, let's try it out - at least it would get us 90% of the way there, or something like that.
@hoijui : Having slept over it, I though, as we are auto generating, we can do both formats, which fits what you wrote ("... should support any format anyone wants."). they should both be quite easy, though as Shacl is RDF too, it could be a bit easier even -> use an RDF library, read the ontology, translate/map RDF to Shacl properties, write to Shacl file using the same RDF library. for ShEx, if there is no library, we will have to write code that writes the correct syntax ourselfs, but that should be doable in a few lines of code as well.
Here is an (almost) Open Source tool for OWL->Shacl: https://astrea.linkeddata.es/ source: https://github.com/oeg-upm/Astrea I did not find anythign for OWL->ShEx, nor Shacl->ShEx. (except weso/shaclex#113) ... I would not claim that my search was extensive though.
@elf-pavlik : I think whichever one you choose you probably would want to write your shapes yourself. At least I wouldn't rely on what you can get given OWL as input.
One of the reason we start with ShEx in solid is simply that one of main authors is an active group participant, this way we can clarify any doubts related to our usage of ShEx very easily. BTW ShEx also can be expresed as RDF https://shex.io/shex-semantics/#shexj In the end I think it would be good to have both ShEx and SHACL shapes. In that case we might want to have some sample data which will pass and fail consistently across both shape formats.
@hoijui : my idea then would be, to add the OWL 2 things to the ontology, run the auto conversion to Shacl, and .. then you could maybe have a look at that outcome, and indicate the issues. then we could adapt the ontology, think about improving the conversion tool, asking upsteam to do so, write a post-proccesing script, or in the worst case, just use that generated result as a base and fixing it manually (though if one can do it manually, one can also do it by script).