Description

A create template is an HTML 5 form that determines how RDF resources are created. Each create template is associated with a Callimachus class, and developers may script create templates by applying these patterns.

Initial create template code

Here is the default code generated for a new create template.

 1:<?xml version="1.0" encoding="UTF-8" ?>
 2:<html xmlns="http://www.w3.org/1999/xhtml"
 3:    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
 4:    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 5:    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
 6:    xmlns:dcterms="http://purl.org/dc/terms/">
 7:<head>
 8:    <title>New Resource</title>
 9:</head>
10:<body>
11:    <div class="container">
12:        <hgroup class="page-header">
13:            <h1>New Resource</h1>
14:        </hgroup>
15:        <form role="form" method="POST" action="" enctype="text/turtle" resource="" typeof="" class="row"
16:                onsubmit="calli.submitTurtle(event,calli.slugify($('#label').val()))">
17:            <fieldset class="col-sm-4">
18:                <div class="form-group">
19:                    <label for="label">Label</label>
20:                    <input type="text" class="form-control" id="label" value="{rdfs:label}" required="required" autofocus="autofocus"
                           onchange="calli.updateProperty(event, 'rdfs:label')" />
21:                </div>
22:                <div class="form-group">
23:                    <label for="comment">Comment</label>
24:                    <textarea id="comment" class="form-control"
                           onchange="calli.updateProperty(event, 'rdfs:comment')">{rdfs:comment}</textarea>
25:                </div>
26:                <div class="form-group">
27:                    <button type="submit" class="btn btn-success">Create</button>
28:                </div>
29:            </fieldset>
30:        </form>
31:    </div>
32:</body>
33:</html>

Code Analysis

Lines Element Purpose
1 xml Specifies the character encoding to be UTF-8.
2-6 html element Declares the namespaces used to identify resources in this page.
8,13 title, h1 Contains placeholders for the name of the type of resources being created.
15 form HTML form that will update the RDF database when the user presses the submit button.
17-29 input field classes Placeholders for input fields.
27 button Create button submits the data.