Template:IntermediateNodeMapping

From Mediawiki1
Revision as of 17:22, 5 March 2010 by Admin (talk | contribs)
Jump to navigationJump to search

For extracting multiple values from a single property it is necessary to introduce an intermediate node. {{IntermediateNodeMapping}} allows to express mappings from Wikipedia template properties to ontology properties on an additional node and to connect the additional node to the mapped instance.

Usage

{{IntermediateNodeMapping
| nodeClass =
| correspondingProperty = 
| mappings =
}}

Meanings

  • nodeClass, correspondingProperty: Creates an additional node of the type nodeClass, which will be connected to the instance extracted from template by the property provided by correspondingProperty.
  • mappings: Mappings map template properties to ontology properties, they have to be defined by using PropertyMapping, IntermediateNodeMapping, or a CustomMapping.

Example

The template property engine on the template Infobox Automobile can contain a list of engine numbers and the corresponding power and torque.

{{Infobox Automobile
| name     = Volkswagen Passat
| engine   = 1.6L 35 kW 135 Nm <br>
		  1.8L 75 PS 140 Nm
}}

The template property engine on the template Infobox Automobile is mapped to an intermediate node of the type AutomobileEngine via the ontology property engine. For this purpose we use a DBpediaIntermediateNodeMapping which defines this connection property (engine) and the mappings from values occuring in the template values of the template property engine to ontology properties on AutomobileEngine.

{{TemplateMapping
| mapToClass = Automobile
| mappings = 
  {{IntermediateNodeMapping | nodeClass = AutomobileEngine | correspondingProperty = Automobile/engine | mappings = 
    {{PropertyMapping | ontologyProperty = AutomobileEngine/number | templateProperty = engine }}
    {{PropertyMapping | ontologyProperty = AutomobileEngine/power | templateProperty = engine | unit = Power }}
    {{PropertyMapping | ontologyProperty = AutomobileEngine/torque | templateProperty = engine | unit = newtonMeter }}
  }}
}}