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=""
 3:    xmlns:xsd=""
 4:    xmlns:rdf=""
 5:    xmlns:rdfs=""
 6:    xmlns:dcterms="">
 8:    <title>New Resource</title>
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>

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.