Template:IntermediateNodeMapping: Difference between revisions

From Mediawiki1
Jump to navigationJump to search
No edit summary
No edit summary
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{|class="wikitable"
<includeonly>{|class="wikitable"
! style="text-align:left" colspan="2" | Intermediate Node Mapping <small>([[Writing_Mappings/Templates#Intermediate_Node_Mapping|<span style="cursor:help;">help</span>]])</small>
! style="text-align:left" colspan="2" | Intermediate Node Mapping <small>([[Template:IntermediateNodeMapping|<span style="cursor:help;">help</span>]])</small>
|-
|-
| width="150px" | node class
| width="150px" | node class
| width="400px" | {{#if:{{{nodeClass|}}}|[[OntologyClass:{{{nodeClass}}}]]|<span style="color:red">please define nodeClass</span>}}
| width="400px" | {{#if:{{{nodeClass|}}}|[[OntologyClass:{{{nodeClass}}}|{{{nodeClass}}}]]|<span style="color:red">please define nodeClass</span>
|-
[[Category:IntermediateNodeMapping with nodeClass]]
}}
|-
|-
| corresponding property
| corresponding property
| {{#if:{{{correspondingProperty|}}}|[[OntologyProperty:{{{correspondingProperty}}}]]}}
| {{#if:{{{correspondingProperty|}}}|[[OntologyProperty:{{{correspondingProperty}}}|{{{correspondingProperty}}}]]
|}<blockquote>{{#if:{{{mappings|}}}|{{{mappings}}}}}</blockquote>
[[Category:IntermediateNodeMapping with correspondingProperty]]
}}
|}<blockquote>{{#if:{{{mappings|}}}|{{{mappings}}}}}</blockquote></includeonly>
<noinclude>For extracting multiple values from a single property it is necessary to introduce an intermediate node. '''<nowiki>{{IntermediateNodeMapping}}</nowiki>''' 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 ===
 
<pre>
{{IntermediateNodeMapping
| nodeClass =
| correspondingProperty =
| mappings =
}}
</pre>
 
=== 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. See [[:Category:IntermediateNodeMapping with correspondingProperty]] [[:Category:IntermediateNodeMapping with nodeClass]]
* '''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.
<pre>
{{Infobox Automobile
| name    = Volkswagen Passat
| engine  = 1.6L 35 kW 135 Nm <br>
  1.8L 75 PS 140 Nm
}}
</pre>
 
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.
<pre>
{{TemplateMapping
| mapToClass = Automobile
| mappings =
  {{IntermediateNodeMapping | nodeClass = AutomobileEngine | correspondingProperty = engine | mappings =
    {{PropertyMapping | ontologyProperty = number | templateProperty = engine }}
    {{PropertyMapping | ontologyProperty = power | templateProperty = engine | unit = Power }}
    {{PropertyMapping | ontologyProperty = torque | templateProperty = engine | unit = newtonMeter }}
  }}
}}
</pre>
</noinclude>

Latest revision as of 11:56, 8 June 2016

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

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 = engine | mappings = 
    {{PropertyMapping | ontologyProperty = number | templateProperty = engine }}
    {{PropertyMapping | ontologyProperty = power | templateProperty = engine | unit = Power }}
    {{PropertyMapping | ontologyProperty = torque | templateProperty = engine | unit = newtonMeter }}
  }}
}}