UserGuide
Install Guide
Base Install (Required)
ECS-TV Live Services
ECS-TV Interactive Services
System Details
Overview
LIVE Services
Interactive Services
   XML Form Language Spec
   RDF & The ECS-TV Ontology
Next Steps

ECS-TV System Details


Previous Part 6 - XML Form Language Spec Next

XML Form Language Spec

ECS-TV Interactive provides a front end for submission of data to a 3Store which inports RDF data, storing facts as triples. 3Store is also able to make intferences upon this data to discover new facts as show below in figure 6.1 where we show a quick recap on the triple and shows how inferences are drawn.

  Subject Predicate Object
Fact 1 School of Electronics and Computer Science PartOf Univeristy of Southampton
Fact 2 IAM Group PartOf School of Electronics and Computer Science
Inference IAM Group PartOf Univeristy of Southampton
Figure 6.1: Recap on triples and overview of inferencing model in 3Store.

The extensible nature of the ECS-TV system provides much opertunity for expansion outside the School of Electronics and Computer Science. This includes to other universities as well as other Schools at the University of Southampton. Unfortunatly these other organisations will be limited to using the current ontology and structure of the system for defining their own institutes, thus having to break them down into Schools and Research Groups.

In order to handle such a large amount of data as defined by the ontology whilst remaining extensible for future expansion it was decided to create an XML syntax to define the data which users can input on the various forms. This data would be directly linked to the ontology requiring minimal changes needing to be performed if this ontology was updated.

Form Data

An overview on which data the ECS-TV interactive system requires is given in the section on Database Structure. This data corresponds almost exactly to that which can be input on each form within the web interface, with each table corresponding to a single form or section. ECS-TVs webservers use PHP to read the XML data corresponding to the requested form and draw this on the screen ready to be filled in.

Defining a Form
    The XML document contains one section per form. This section contains many values which represent the different fields to be displayed on that form:

<section attr1="..." attr2="...">
     <value attr1="..." attr2="...">value name</value>
     <value attr1="..." attr2="...">value name</value>
     .....
</section>
Figure 6.2 - Basic overview of XML syntax for form data.

   Section Attributes:
      These define the global properties of the form:

Attribute Required Description
name Y Section Name: Used when requesting the form as the forms unique key.
title Y Title of the form
type Y The type of data this form is describing. This forms the rdfs:type key.
about Y The namespace prefix to the rdf:Description about key, combines with the special key field on the form.
boxwidth Y Width of the window this form is displayed in on the screen.
boxheight Y Height of the window this form is displayed in on the screen.
Figure 6.3 - Section attributes global to the form.

   Value Attributes:
      Value attributes define each field on the form which the user can fill in. There are many types of value attributes and each takes a different set of data to define their behaviour.

     Types of Value Attribute
        HTML forms have many methods of inputing data and the ECS-TV XML syntax supports 4 types of input field outlined below in Figure 6.4:

INPUT (single line text) TEXTAREA (multiline text) SELECT (Drop down choices) BOOLEAN (Y/N selection)
Attributes

name: name of field
size: Length of Field
maxlength: Max allowed charecters
value: Value of field
Attributes

name: name of field
rows: number of rows
cols: number of columns
value: Value of field
Attributes

name: name of field
valarray: key & name pairs
value: key of value
Attributes

name: name of field
Figure 6.4 - ECS-TV XML Form syntax: Supported input methods.

     Global Attributes:
        Figure 6.4a shows the global attributes which can be set for all four types of input field on the form.

Attribute Required Description
name Y The RDF key and name of field (e.g. foaf:name). Note: More than one name can be defined by comma seportating the names.
If the field is the unique key for this type of data the first name should be the string key.
type Y This should be set to input for a single line text field.
required N true/false: States if the field is required, contents will be checked on submission of the form.
help N A small description of what data is required in this field, this is displayed to the user when their mouse pointer hovers over the fields name.
Figure 6.4a - Global attribures qpplicable to all four types of input.

     Input AND Select type:
        Figure 6.4b shows attributes which can be set for input (single line) and select types:

Attribute Required Description
resource N true/false: States if the data should be stored as a resource link to another object. This is normally used on fields where the data is already in the database and should be linked to. Requires relation.
relation with 'resource' Relation of this item to its resource (including namespace). The predicate between the subject and reference to the object.
University["This Item"] hasRelation rdf:resource="This object.
add N true/false: States if the user can add a data item of this type to the system, requires add_type.
add_type with 'add' The section name containing the form data of the type of data which can be added.
dependancy N The value name in the current section which this item depends on.
For example a lecturer must be a member of a particular university.
dependancy_relation with 'dependancy' The relation of this item to the dependancy (including namespace) e.g. 'namespace/memberOf'.
Figure 6.4b - Attributes which can be set for only Input and Select type fields.

     Input (single line text) only:
        Figure 6.4c shows the fields which are recognised when intending to use a single line text field:

Attribute Required Description
length Y The size of the input field to be displayed.
validate N A perl standard regex expresion used to validate the contents of the field upon submission.
quick_lookup N Defines the type of item (including namespace) which the entered item is appended to.
This allows a lookup to be performed to find any prexisting data in the database relating to this key. To use this sucessfully the attribute lookup_type is required. dependancy and dependancy_relation are only required for more in depth lookups.
lookup_type with 'quick_lookup' The rdfs:type of the item you are looking up in the database.
Figure 6.4c - Attributes which can be set for only the Input field.

     Select Type only:
        Figure 6.4d shows attributes which are only applicable to fields of type select. Note that when the value in a select field is changed the form refreshes to enable any validation of the input data to take place.

Attribute Required Description
select_type Y The data type to be looked up in the database for inclusion as options in the select field. Use this field in conjunction with dependancy and dependancy_relation to limit the content of the fields dependant on other selections on the form.
allow_null N true/false: Include the empty string as a valid selection in a select input.
Figure 6.4d - Attributes which can be set for only the Select field.

     Textarea Type only:
        Figure 6.4e shows attributes which are only applicable to fields of the type textarea.

Attribute Required Description
rows Y Number of rows the textarea displays on the form.
cols Y Number of columns the textarea displays on the form.
Figure 6.4e - Attributes which can be set for only the Textarea field.

     Special Types of Value Attribute
        There is currently one type of special value attribute which does not define an item of data on the form. This defines any style which can be embeded in the form to split up the layout, commonly this is just a horizontal rule accross the page <hr/>. Only the name and type attributes are allowed in this type of field.

<value name='<hr/>' type='style'></value>
Figure 6.5 - A value attribute providing style to a form.

An example:
    With such a powerful syntax it can become easy to get lost so below is an example. Figure 6.6 is the XML data which draws the submission page for a course lecture, a brief description before each line should assist as a guide to what this achieves.

<!-- Gives gloabl data of form -->
<section name='course_lecture' title='Course Lecture Submission' type='http://www.ecstv.ecs.soton.ac.uk/ontology/ecstv/Media' about='http://www.ecstv.ecs.soton.ac.uk/Media/'>
    <!-- Select field containing all universities found in database, no dependancies. -->
      <value name='ecstv:university' type='select' add='true' select_type='http://www.ecstv.ecs.soton.ac.uk/ontology/ecstv/University' dependancy='none' required='true' resource='true' relation='ecstv:hasUniversityRelation'>University</value>
    <!-- Select field containing all schools belonging to the chosen university. -->
      <value name='ecstv:school' type='select' add='true' select_type='http://www.ecstv.ecs.soton.ac.uk/ontology/ecstv/School' dependancy='ecstv:university' dependancy_relation='<http://www.ecstv.ecs.soton.ac.uk/ontology/ecstv/partOf>' required='true' resource='true' relation='ecstv:hasSchoolRelation' allow_null='true'>School</value>
    <!-- Select field containing all groups belonging to the chosen school, null is allowed. -->
      <value name='ecstv:group' type='select' add='true' select_type='http://www.ecstv.ecs.soton.ac.uk/ontology/ecstv/Group' dependancy='ecstv:school' dependancy_relation='<http://www.ecstv.ecs.soton.ac.uk/ontology/ecstv/partOf>' required='false' resource='true' relation='ecstv:hasGroupRelation' allow_null='true'>Group</value>
    <!-- Style divide on form. -->
      <value name='<hr>' type='style'></value>
    <!-- name/label of content, note the 2 comma seporated names. -->
      <value name='foaf:name,rdfs:label' type='input' length='50' required='true'>Name/Title</value>
    <!-- Standard input field, notice the validation -->
      <value name='ecstv:sequenceNumber' type='input' length='3' validate='/^[0-9*]+$/' required='false'>Sequence Number</value>
    <!-- Textarea input field expecting a fair quantity of data -->
      <value name='ecstv:extraInfo' type='textarea' rows='4' cols='48'>Extra Information (as HTML)</value>
    <!-- Style divide on form. -->
      <value name='<hr>' type='style'></value>
    <!-- Input field which is able to lookup the data the user has entered to find a key. -->
      <value name='ecstv:hasProvider' type='input' required='true' quick_lookup='http://www.ecstv.ecs.soton.ac.uk/Person/#' lookup_type='http://xmlns.com/foaf/0.1/Person' dependancy='ecstv:university' dependancy_relation='<http://www.ecstv.ecs.soton.ac.uk/ontology/ecstv/memberOf>' resource='true' relation='ecstv:hasProvider' add='true' add_type='ecstv:University_Staff'>Provider alias/email</value>
    <!-- Input field which is able to lookup the data the user has entered to find a key. -->
      <value name='ecstv:hasCourseRelation' type='input' required='true' quick_lookup='http://www.ecstv.ecs.soton.ac.uk/Unit/#' lookup_type='http://www.ecstv.ecs.soton.ac.uk/ontology/ecstv/Unit' dependancy='ecstv:school' dependancy_relation='<http://www.ecstv.ecs.soton.ac.uk/ontology/ecstv/providedBy>' resource='true' relation='ecstv:hasCourseRelation' add='true' add_type='ecstv:unit'>Course Code</value>
<!-- Close Section -->
</section>
Figure 6.6 - Example of XML syntax in use. This example defines the data required for a course lecture.


Previous Part 6 - XML Form Language Spec Next