-
Notifications
You must be signed in to change notification settings - Fork 15
Forms in LODSPeaKr
#THIS IS AN EXPERIMENTAL FEATURE, DO NO USE IT IN PRODUCTION ENVIRONMENTS
LODSPeaKr provides a semiautomatic system for creating forms to simplify the process of creating and editing entities in a triple store.
The Form module comes disabled by default (See Modules). In order to activate it, it is necessary to execute:
utils/lodspk.sh enable module forms 0
0
can be replaced with any other non-negative number.
##Note: not implemented yet
utils/lodspk.sh create form myform
this will create a directory structure under components/forms
similar to the existing ones in a service
component. The default teplate will include a query called main.query
similar to
SELECT DISTINCT ?p ?pLabel WHERE{
[] a foaf:Person;
?p [] .
OPTIONAL{
?p rdfs:label ?pLabel
}
}
By default html.template
will be similar to:
{%include "../../includes/header.inc"%}
{% LodspkForm %}
<table>
{%for i in models.main%}
<tr><td>{{i.pLabel.value}}</td><td> {{i.p.curie|LodspkTextInput}} </td></tr> {%endfor%}
</table>
{%endLodspkForm%}
</body>
</html>
The tag LodspkForm
will generate the necessary <form>
element. The LodspkTextInput
will generate the <input>
element based on the curie given.