Template:TemplateMapping: Difference between revisions

From Mediawiki1
Jump to navigationJump to search
(DisclaimerMapping doesn't take parameters anymore)
(trying to make DisclaimerMapping optional)
Line 1: Line 1:
<includeonly>{{DisclaimerMapping}}
<includeonly>{{#ifeq:{{{header|}}}|0||{{DisclaimerMapping}}}}<!-- show disclaimer only if header != 0 -->


<table class="wikitable">
<table class="wikitable">

Revision as of 01:18, 28 April 2012

{{TemplateMapping}} maps templates to ontology classes.

Usage

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

Meanings

  • 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
}}