danielbeeke / rdf-form

RDF form provides rendered forms via a form definition provided in RDF turtle format.
http://rdf-form.danielbeeke.nl/
MIT License
15 stars 1 forks source link

Options only work with syntactic sugar for blank nodes - not with named nodes #20

Open smessie opened 2 years ago

smessie commented 2 years ago

It looks like RDF with named nodes for the options in a dropdown does not work.

RDF with named nodes:

RDF with blank nodes (syntactic sugar)

danielbeeke commented 2 years ago

Interesting,

I think the JSONLdProxy might not nest the values.I have written a nester before: I created a gist of it:

https://gist.github.com/danielbeeke/77bcfd565322e9509588a337c204d217

It might be an option to nest the JSON before it is put into the Proxy.

smessie commented 2 years ago

I'm not sure if I understand you correctly, is that something to do on my side, or on the side of ref-form?

Anyways, in the meantime I have investigated it further and came to the conclusion that I was actually not generating rdf:List RDF, so I've changed my code and now I have RDF with rdf:List for the options.

However, I still get an error Uncaught (in promise) Error: The prefix form was not found in the form definition., but I can't seem to find the issue, is there still something wrong with my generated RDF (I can't find any mistakes) or is there a problem with rdf-form? The error is thrown here https://github.com/danielbeeke/rdf-form/blob/7fcfe16754589127a875989bdb9ee61ce877641b/src/core/FormDefinition.ts#L57

smessie commented 2 years ago

When I add @prefix form: <http://rdf.danielbeeke.nl/form/form-dev.ttl#> . to my RDF, then the above error Uncaught (in promise) Error: The prefix form was not found in the form definition. is gone, but the first error Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0') is there again.

  1. Uncaught (in promise) Error: The prefix form was not found in the form definition. I think we should not check if this prefix exists, right? Because I'm not using prefixes in my RDF, I write all URI's absolute. That shouldn't make it invalid RDF.

  2. Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0') You are reading option['form:value'] here, maybe you are also expecting the predicates to be defined with prefixes?