Skip to content
alangrafu edited this page Apr 10, 2013 · 4 revisions

Introduction

#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.

Enabling 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.

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  %}
<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.

Clone this wiki locally