Git Product home page Git Product logo

tgforms's Introduction

tgForms

Generate HTML forms from RDF/Turtle

tgForms is a JavaScript library to generate HTML forms from RDF/Turtle. It was originally written for the use with TextGrid.

Installation

If you have node.js and Bower installed, you can get the latest development version of tgForms with the following command:

$ bower install hriebl/tgForms

If you want to download a specific pre-compiled version of tgForms, just append the version number to the command, e.g.:

$ bower install hriebl/tgForms#0.1

Compilation

Compiling tgForms is easy if you have CoffeeScript and Cake installed. In the tgForms directory, execute:

$ cake build

You may also minify the compiled JS file by running these commands:

$ wget "http://dl.google.com/closure-compiler/compiler-latest.zip"
$ unzip -nx "compiler-latest.zip"
$ cake minify

Vocabulary

tgForms understands some RDF Schema properties, namely rdfs:domain, rdfs:label, and rdfs:range, and interprets their subjects as form fields. Forms can be generated for classes that are used as objects of rdfs:domain. The library also comes with the following specific properties to refine forms:

tgforms:hasInput

Sets the input type for a property.

tgforms:hasDefault

Sets the default value for a property.

tgforms:hasOption

Sets a dropdown option for a property.

tgforms:hasPriority

Sets the priority for a property. Higher priorities appear first.

tgforms:isRepeatable

Makes a property repeatable.


The following input types are available for the use with tgforms:hasInput:

tgforms:button

A button. May be manually scripted.

tgforms:checkbox

A checkbox. Useful for boolean properties.

tgforms:dropdown

A dropbox menu. Useful if there is a limited number of options.

tgforms:text

A text field. Useful for short texts.

tgforms:textarea

A text area. Useful to longer texts.

Usage

tgForms is compatible with the RDF/Turtle from schema.rdfs.org. If you like, take a look at some CoffeScript code that generates a form for the schema:BarOrPub class.

TODO: Add up-to-date information about public methods, for the moment take a look at the source code.

tgforms's People

Contributors

hriebl avatar ubbo avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mweidling

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.