Help:Semantic Forms

From Biowikifarm Metawiki
Revision as of 18:05, 4 April 2010 by Bernhard Zelazny (Talk | contribs) (Created page with '{{WikihelpHeader}} This section gives some guidance on, and provides some examples for the use the Semantic Forms. For more detailed descriptions see the '''[http://www.mediawik...')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Help sections
Contents · Semantic MediaWiki · Semantic Forms
Add Ontology · Semantic links and import/export features · Import external vocabulary
Other SemanticMW extensions · Other extensions



This section gives some guidance on, and provides some examples for the use the Semantic Forms. For more detailed descriptions see the Semantic Forms website.

Introduction

The Semantic Forms extension is used in connection with the Semantic Mediawiki extension. It is useful for creating forms which can greatly facilitate the entry of data in the semantic system. As an example we explain here the creation of a form for entering data into a semantic literature database, specifically articles published in journals. This system sorts the literature automatically in the respective journal page and allows formatting and displaying the literature in different ways.

Defining properties and data types

As explained in the Semantic Mediawiki help section the data need to be defined as properties and data types. However, you only need properties for the data which you want to call up later in queries. In our example we create the properties
Property:Publication title
Property:Publication authors
Property:Publication journal
Property:Publication year
Property:Publication volume
Property:Publication pages
However, we do not need to create properties for other elements of the publication pages, like abstracts or external links to the full texts of the articles.

Creating categories for the form and the journals

Each form needs a special category which defines a link to the form. Here we create the Category:Publications. In the text for this category we provide the link to our form trough the following assignment:
[[Has default form::Publication in journal]]
where "Publication in journal" is the name of our form.

We further need the Category:Journals to be able to bring the articles into a structure where they can be found easily.

Creating a template for the form

The Template:Publication in journal provides formatting instructions for the data entered into the form. Each form needs a template and in order to avoid confusion the template should have the same name as the form. In this template the text between the and only provide some information on the data fields used by the template which should be later also included in the form. If these data elements have been defined as properties they should be here, of course, referred to with exactly the same spelling. The actual content of the template is enclosed in the tags. The content consists of the following parts:

  • Defining the format in which the data will be displayed in a page created by the form:
    1. For each data field the content to be entered into the form is enclosed in 3 curly braces, e.g. the text - '''Abstract:''' {{{Publication abstract|}}} - defines how and where the abstract of an article will appear in the final page. In this case it will appear after a line stating the journal, volume and page numbers and will be preceded by the bold text "Abstract:".
    2. For data fields like authors, title, journal, volume and page number which we want to call-up later in semantic queries we need to format them as semantic assignments (see Semantic Mediawiki help section). This means use the format "[[property::value]]". For example in "[[Publication title::{{{Publication title|}}}]]" The first "Publication title" is the property name and the "{{{Publication title|}}}" is what will be entered as title later in the form.
    3. The "{{#if: ....}}" constructions simply make sure none of the formatting instructions are applied if the field is left blank in the form. Note that the abstract field is not enclosed in "{{#if: ....}}". Therefore the bold text "Abstract:" will appear in the page even if no abstract has been entered, in order to encourage other users to add an abstract at a later stage.
  • Defining a table for some data. The text starting with "{| border= ... defines a table to display the fields journal, year, volume, and pages. These are important data which are used to generate the name of the article page.
  • Link to Category:Publications. We finally need a link to the special property assigned to the form.

Creating the form "Publication in journal"

Calling-up the data entered