@Smag0 wrote:
Well, well, related to my old post about shex shapes and forms, i’ve got some news…
Let’s say you want to build a Todo app with a simple form (note that what I say here could apply to bigger forms too )
What you only do is to define your form as a shexy shape using ShEx language
Let’s take a look !You need first a Start point that you naturally name start & must write like
start = <Todo>
then you can describe the fields of your form using
<Todo>{ ... ... # property of first field & type of the value of the first field in ttl format ... ... # property of second field & type of the value of the first field in ttl format ... ... # property of third field & type of the value of the first field in ttl format }
for example, our definition could be something like that :
<Todo>{ schema:name xsd:string ; schema:dateCreated xsd:date? ; schema:text LITERAL ; }
You see that we use schema & xsd vocabulary, and adding a “hola:” prefix (used to store data until I finish with foorprint) so the complete definition is something like
PREFIX schema: <https://schema.org/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX hola: <https://holacratie.solid.community/public/> start = hola:Todo hola:Todo{ # A Todo has: schema:name xsd:string ; schema:dateCreated xsd:date? ; schema:text LITERAL ; }
That’s all !
What the F??? and then ??? what to do with that definition???
nothing more than put the url it in a .shex file on a POD or at an accessible url…
(be sure to use .shex & not .ttl extension)I’ve put mine at https://holacratie.solid.community/public/Schema/todo_basic.shex
And then ???
Open it with a magic app putting its url as a ?shape_url= parameter…
Something like that, for example Image may be NSFW.
Clik here to view.
https://scenaristeur.github.io/holon/?shape_url=https://holacratie.solid.community/public/Schema/todo_basic.shexAnd you should see something like that…
Could it be more simple ??? I don’t think…
The write data to the POD, and footprint are in progress, but I couldn’t wait to share it …
So ?
Do you think this could be usefull ?If you find some interest, there are more complex examples
Posts: 4
Participants: 3