-
Notifications
You must be signed in to change notification settings - Fork 15
Forms in LODSPeaKr
alangrafu edited this page Apr 22, 2013
·
4 revisions
#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 is not available in the master branch. Hence, after installing LODSPeaKr you need to switch to
`` git checkout devel-forms
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.
Also, it is necessary to define the endpoint to use (it is different from the SPARQL endpoint). In `settings.inc.php` we need to add:
$conf["update"]["local"] = "http://alia:3030/zxc/update";
or whatever the URL of the endpoint is.
## Creating a form
##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 %}
{%for i in models.main%} {%endfor%}{{i.pLabel.value}} | {{i.p.curie|LodspkTextInput}} |