Template:TemplateMapping: Difference between revisions

From DBpedia Mappings
Jump to navigationJump to search
(trying to make DisclaimerMapping optional)
(* '''header''': If value '0' is given, don't print the header. Useful for conditional mappings.)
Line 30: Line 30:
<pre>
<pre>
{{TemplateMapping
{{TemplateMapping
| header                =
| mapToClass            =
| mapToClass            =
| correspondingClass    =
| correspondingClass    =
Line 39: Line 40:
=== Meanings ===
=== Meanings ===


* '''header''': If value '0' is given, don't print the header. Useful for conditional mappings.
* '''mapToClass''': Templates are mapped to ontology classes. The template parameter mapToClass allows one DBpedia ontology class as a value.
* '''mapToClass''': Templates are mapped to ontology classes. The template parameter mapToClass allows one DBpedia ontology class as a value.
* '''correspondingClass''', '''correspondingProperty''': In the case that different templates are used on the same page (for instance Automobile and Automobile Generation), the instance resulting from the second grade template (Automobile Generation) can be connected to the instance of the first grade template (Automobile) using a corresponding property. Thus, if an instance of type correspondingClass is found on the same page, it will be connected to the instances of the mapped template by correspondingProperty.
* '''correspondingClass''', '''correspondingProperty''': In the case that different templates are used on the same page (for instance Automobile and Automobile Generation), the instance resulting from the second grade template (Automobile Generation) can be connected to the instance of the first grade template (Automobile) using a corresponding property. Thus, if an instance of type correspondingClass is found on the same page, it will be connected to the instances of the mapped template by correspondingProperty.

Revision as of 01:41, 28 April 2012

{{TemplateMapping}} maps templates to ontology classes.

Usage

{{TemplateMapping
| header                =
| mapToClass            =
| correspondingClass    =
| correspondingProperty =
| mappings              =
}}

Meanings

  • header: If value '0' is given, don't print the header. Useful for conditional mappings.
  • mapToClass: Templates are mapped to ontology classes. The template parameter mapToClass allows one DBpedia ontology class as a value.
  • correspondingClass, correspondingProperty: In the case that different templates are used on the same page (for instance Automobile and Automobile Generation), the instance resulting from the second grade template (Automobile Generation) can be connected to the instance of the first grade template (Automobile) using a corresponding property. Thus, if an instance of type correspondingClass is found on the same page, it will be connected to the instances of the mapped template by correspondingProperty.
  • mappings: Mappings map template properties to ontology properties, they have to be defined by using PropertyMapping or IntermediateNodeMapping. Custom, user-defined, mappings like the GeocoordinatesMapping can also be defined.

Example

The template Infobox Automobile shall be mapped to the ontology class Automobile.

The mapping for the template Infobox Automobile to the ontology class Automobile can be defined as follows:

{{TemplateMapping
| mapToClass = Automobile
}}

Mapping multiple templates from one wiki page

If a Wikipedia page contains multiple infobox templates, all relevant templates should be processed.

E.g. the templates Infobox Automobile and Infobox Automobile engine often occur on the same wiki page.

{{ Infobox Automobile
| name = Volkswagen Golf
...
}}

{{ Infobox Automobile engine
| name = Volkswagen air cooled engine
...
}}

The first template infobox on a page defines the type of this page, while further infobox templates will be extracted as instances of the corresponding types and own URIs. The template Infobox Automobile shall be mapped to the ontology class Automobile, while the template Infobox Automobile engine shall be mapped to the ontology class AutomobileEngine. The correspondence of the infobox template instances can be preserved by defining a correspondingClass and correspondingProperty on the Automobile instance pointing to the AutomobileEngine instance.

The mapping for the template Infobox Automobile to the ontology class Automobile can be defined as follows:

{{TemplateMapping
| mapToClass = Automobile
}}

The mapping for the template Infobox Automobile engine to the ontology class AutomobileEngine can be defined as follows:

{{TemplateMapping
| mapToClass            = AutomobileEngine
| correspondingClass    = Automobile
| correspondingProperty = Automobile/engine
}}