shexSpec / shex

ShEx language issues, including new features for e.g. ShEx2.1
23 stars 8 forks source link

ShEx to SPARQL converter #75

Open jimkont opened 6 years ago

jimkont commented 6 years ago

@ericprud had something similar at the early ShEx days but would be nice to have a converter that translates a ShEx schema to [a set of conjuctive] SPARQL queries. Recursive shapes definitions would be ignored in this case.

ericprud commented 6 years ago

There are a few kinds of results we might want from such queries:

  1. matching nodes
    1. result ShapeMap
    2. supporting triples (or (s, o) tuples)
  2. failing nodes
    1. result ShapeMap
    2. reasons for failure
    3. failing triples

The ShEx1 FancyShExDemo made and attempt at some of these (see the validating query, remaining triples, value dump links). I believe this will work for repeated properties. I'm not sure how to do CLOSED shapes.

rwst commented 3 years ago

To produce useful failure reports it might be better to have multiple queries, also to optimize query performance and query server load. In general the result of the converter could be a data structure containing a set of (queries plus associated failure message), and would need for execution a final step that collects the outcome for each tested node in each of the queries.

ericprud commented 3 years ago

One place where multiple queries costs you is when you have to recover some unique way to fix a BNode. That said, something that exists and works for URLs is way better than a fanciful figment which works for everything.