rdfjs / shacl-ui

SHACL-driven UIs
https://rdf.js.org/shacl-ui/
11 stars 2 forks source link

Use-case : specify query builder configuration using shapes #16

Open tfrancart opened 1 year ago

tfrancart commented 1 year ago

I am specifying which classes and properties from a model should be presented in a query builder, using shapes.

HolgerKnublauch commented 1 year ago

These all make sense, but may deserve individual tickets for modularity.

danielbeeke commented 1 year ago

@tfrancart could you give an example of what such a shape would look? And could you maybe give an example of what he user interface looks like? And what is the output of using this? Is it outputting triples?

tfrancart commented 1 year ago

These all make sense, but may deserve individual tickets for modularity.

I like to keep the "story" as one, in order not to lose the full picture, but I am OK to split them in separate issues if the need arises.

@tfrancart could you give an example of what such a shape would look? And could you maybe give an example of what he user interface looks like? And what is the output of using this? Is it outputting triples?

Yes, the formal specification for this, of course done in SHACL, is documented at http://docs.sparnatural.eu/SHACL-based-configuration.html, the tool is at https://sparnatural.eu/, and it is not outputting triples, but SPARQL queries.

bergos commented 1 year ago

@tfrancart could you give an example of what such a shape would look? And could you maybe give an example of what he user interface looks like? And what is the output of using this? Is it outputting triples?

Yes, the formal specification for this, of course done in SHACL, is documented at http://docs.sparnatural.eu/SHACL-based-configuration.html, the tool is at https://sparnatural.eu/, and it is not outputting triples, but SPARQL queries.

@tfrancart Did you consider using a shape with SHACL Advanced Features as an intermediate format? Some use cases, like simple min/max ranges, could be covered with plain SHACL. That would remove the requirement for a full SPARQL engine for such simple use cases.

tfrancart commented 1 year ago

@tfrancart Did you consider using a shape with SHACL Advanced Features as an intermediate format? Some use cases, like simple min/max ranges, could be covered with plain SHACL. That would remove the requirement for a full SPARQL engine for such simple use cases.

I don't understand your comment; the tool is a SPARQL query builder to navigate a knowledge graph. Its output is SPARQL, that is its very purpose. SHACL is used to configure its UI, but the tool itself does not output SHACL. Maybe I misunderstood your comment.

bergos commented 1 year ago

SHACL-AF extends SHACL to express a SPARQL query in SHACL triples. SPARQL grammar elements like FILTER, MIN, or LIMIT can be expressed in a triple data structure. I see four main benefits of using the SHACL triples over a plain string:

tpluscode commented 1 year ago

SHACL-AF extends SHACL to express a SPARQL query in SHACL triples

I think it's only half true. The relation to SPARQL is not mandated and you may implement SHACL-AF without SPARQL and even entirely on in-memory data, as could be the case of ordering a resultset (re https://github.com/rdfjs/shacl-ui/issues/15#issuecomment-1704381598)

tfrancart commented 1 year ago

I see four main benefits of using the SHACL triples over a plain string: It's easier to manipulate further the query generated by the component.

This is a pure software engineering consideration. We have our own query data structure for this. That data structure is UI-targeted (it is tied to how the UI behaves)

It's easier to populate the widget from a shape representing a SPARQL query than parsing a SPARQL string. It could be useful to persist a search form and load it later.

We do persist queries and populate the widget from the above-mentionned, UI-targeted, data-structure.

There is no other well-documented standard for a SPARQL query data structure.

From a software engineering perspective, SPARQL.js is largely sufficient. This is what we are using to serialize SPARQL strings. This is as close as you can get from a "well-documented standard for a SPARQL query data structure".

It would be possible to use the shape directly for filtering. For example, a table component could use the generated shape to filter rows client-side.

Indeed.

I don't see much benefits in using this SHACL-oriented-SPARQL-representation in our case. We certainly don't want to use it as an internal data structure. One long-term benefit, mentionned in your 4th point, could be interoperability with other compatible component, but for the moment this seems very far away. If we do anything in this direction we would probably produce the SHACL-AF from our own query representation.

bergos commented 1 year ago

@tfrancart can you please split this issue into smaller issues?