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

Questions about shacl-form #28

Open
jsheunis opened this issue Nov 8, 2024 · 6 comments
Open

Questions about shacl-form #28

jsheunis opened this issue Nov 8, 2024 · 6 comments

Comments

@jsheunis
Copy link

jsheunis commented Nov 8, 2024

Hi there :)

shacl-forms looks like a very useful tool, thanks for developing it! I found your repo while exploring tools in the realm of schema-generated-UIs and linked data in the browser. Our team has been working on what seems to be a very similar goal at https://github.com/psychoinformatics-de/shacl-vue (somewhat outdated docs here), specifically using SHACL and VueJS to generate editors and viewers of RDF data. I'd rather reuse existing and well maintained open source tools than reinvent the wheel, so I thought it could be useful to see which aspects of shacl-form are reusable (and to which extent) so that it could be imported and manipulated by a different application. I've read the readme and explored the demo. I must still do some coding to get a real feel for it, but In the meantime I had some questions:

  1. Are all SHACL constraints supported or a subset?
  2. If a <shacl-form> element is populated with a shapes graph with multiple node shapes, I assume all of these and their properties find their way into the single form? I.e. there's no high-level separation of forms based on node shapes; would this have to be done by creating multiple <shacl-form> elements?
  3. The setClassInstanceProvider looks like a neat way to populate a dropdown list where instances of a specific class need to be selected from. Is it possible within your framework to get these instances from the same graph being populated by the form (or multiple forms)? Let's say a user is adding a Person as an author of some Publication (so the triples related to that Person becomes part of the resulting data graph), and let's say the user then wants to add the exact same Person under the Attribution section of a Dataset, it would be great if the user could just select the specific instance from a dropdown populated from the output graph. Or is this something that should be handled on a higher level outside of the <shacl-form> element, e.g. in some persistent store?
  4. Perhaps there are existing implementations with shacl-form as a dependency that address these questions already; if so, could you point me to implementations where I can inspect their code to see how they use your tool, or any additional documentation?

Perhaps an additional note: in shacl-vue I was busy trying to figure out how best to represent RDF data internally as javascript objects for the purpose of form field editing, when I discovered rdf-object, and from their dependents list on github I found your repo. I already had an internal representation for form data, derived from node shapes, and when a form was "saved" the entered data would be transformed into quads and go into an rdf.dataset() (import rdf from 'rdf-ext'), but the linkage to both existing nodes in the rdf.dataset() graph as well as entered form data that was still represented internally became a burden to handle. So I'm also looking for a hopefully existing library to handle this while I can then focus on a level higher in the application. Ideally shacl-form could be useful in this regard.

Thanks again!

@s-tittel
Copy link
Collaborator

Hi and thanks for the feedback! Its nice to see that shacl-form could be useful for others. To answer you questions:

  1. Definitely just a subset. Unsupported/unimplemented constraints are: sh:not, sh:xone, sh:qualifiedValueShape, sh:qualifiedMinCount, sh:qualifiedMaxCount, sh:equals, sh:disjoint, sh:lessThan, sh:lessThanOrEquals, sh:closed, sh:ignoredProperties. The rest should work.
  2. You can use the attribute data-shape-subject to pick the "root" shape from the shapes graph for form rendering.
  3. We are currently working on this, so linking existing resources will be possible in the (near?) future.
  4. We are not aware of any documented use of shacl-form. One of our own use cases is this (but still undocumented): https://gitlab.ulb.tu-darmstadt.de/rokit/rdf-store

@jsheunis
Copy link
Author

Thanks for the responses and the link to your use case. It looks like we have very similar goals. Regarding my comment:

Perhaps an additional note: in shacl-vue I was busy trying to figure out how best to represent RDF data internally as javascript objects for the purpose of form field editing, when I discovered rdf-object, and from their dependents list on github I found your repo. I already had an internal representation for form data, derived from node shapes, and when a form was "saved" the entered data would be transformed into quads and go into an rdf.dataset() (import rdf from 'rdf-ext'), but the linkage to both existing nodes in the rdf.dataset() graph as well as entered form data that was still represented internally became a burden to handle. So I'm also looking for a hopefully existing library to handle this while I can then focus on a level higher in the application. Ideally shacl-form could be useful in this regard.

Do you think it would be possible to use shacl-form internals as the API for data entry, editing, and in-browser store, while building a UI layer on top of it? I.e. UI components would just bind their values to the shacl-form internals. Or do you have too much of a direct link between a data value and its relevant web component that would prevent such separation?

@s-tittel
Copy link
Collaborator

From what I understand, that should be possible, we do somewhat like this in the linked project (rdf-store). But it's not like a two-way binding (as e.g. in react), since it requires serializing/deserializing values to/from RDF. So binding is not on JavaScript object level, if this is what you mean.

@jsheunis
Copy link
Author

Thanks for the reference, that clarifies it 👍

@Certiman
Copy link
Contributor

Certiman commented Dec 6, 2024

Hi @jsheunis , I have implemented a solid pod based research app in this branch, but in order to test it you need a SHACL shape file for the form in the solid pod itself. The idea was to provide these shapefiles as part of a process with tasks and steps (all expressed as RDF) and store the form result in the user's solid pod. This idea will now be elaborated further, and we will be using shacl-forms for sure.

@jsheunis
Copy link
Author

Thanks @Certiman I'll definitely look into that!

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

No branches or pull requests

3 participants