Skip to content
Josef Hardi edited this page Aug 20, 2015 · 2 revisions

SYNTAX:

<uri-template tml:name="string" tml:value="string"/>

CONTAINED IN:

<program>

DESCRIPTION:

Specifies a string template used in the mappings. A string template is a format string that can be used to build strings from multiple components. It has a reference to column names using pairs of curly braces ({ and }). The following syntax rules apply to valid string templates:

  • Pairs of unescaped curly braces must enclose valid column orders written as an integer number starting from 1 to N.
  • There should be at least one pair of unescaped curly braces.
  • If a template contains multiple pairs of unescaped curly braces, then any pair should be separated from the next one by a "safe separator". This is any character or string that does not occur anywhere in any of the data values of either referenced column.

The template value of the term map for a given logical table row is determined as follows:

  1. Let result be the template string.
  2. For each pair of unescaped curly braces in result:
    • Replace the order number with the column name specified by the URI template call in rr:template,
    • Let value be the data value of the column,
    • If value is NULL, then return NULL,
    • Let value be the natural RDF lexical form corresponding to value type,
    • Replace the pair of curly braces with value.
  3. Return result.

By default, a simple URI-safe version is applied by replacing blank space character with an underscore _ character.

The following example declares a URI template named Employee that has a string template with reference to a single column.

<uri-template tml:name="Employee" tml:value="http://obidea.com/ex/ontology/work/employee/{1}/" />

If among the mapping definitions there is a URI template call rr:template="Employee(emp_no)" then it will generate URIs with reference to emp_no column of a logical table:

<http://obidea.com/ex/ontology/work/employee/1000/> <http://obidea.com/ex/ontology/work/firstName> "John" .
<http://obidea.com/ex/ontology/work/employee/1001/> <http://obidea.com/ex/ontology/work/firstName> "Mary" .
<http://obidea.com/ex/ontology/work/employee/1002/> <http://obidea.com/ex/ontology/work/firstName> "Tom" .

ATTRIBUTES:

  • tml:name: The URI template name.
  • tml:value: The URI string template.

SEE ALSO:

Clone this wiki locally