Template:PropertyMapping: Difference between revisions
From Mediawiki1
Jump to navigationJump to search
(Added categories for prefix and suffix) |
(Added an #ifeq so that categories can be suppressed) |
||
Line 20: | Line 20: | ||
<tr> | <tr> | ||
<td>prefix</td><td>{{{prefix}}}</td> | <td>prefix</td><td>{{{prefix}}}</td> | ||
</tr> | </tr> | ||
{{#ifeq: {{lc:{{{nocat|false}}} }} | false | [[Category:Mappings using prefix]] | <!-- Category suppressed --> }} | |||
}} | }} | ||
{{#if:{{{suffix|}}} | | {{#if:{{{suffix|}}} | | ||
Line 27: | Line 27: | ||
<td>suffix</td><td>{{{suffix}}}</td> | <td>suffix</td><td>{{{suffix}}}</td> | ||
</tr> | </tr> | ||
[[Category:Mappings using suffix]] | {{#ifeq: {{lc:{{{nocat|false}}} }} | false | [[Category:Mappings using suffix]] | <!-- Category suppressed --> }} | ||
}} | }} | ||
{{#if:{{{transform|}}} | {{#switch: {{{transform}}} | {{#if:{{{transform|}}} | {{#switch: {{{transform}}} | ||
Line 67: | Line 67: | ||
| language = | | language = | ||
| comment = | | comment = | ||
| nocat = | |||
}} | }} | ||
</pre> | </pre> | ||
Line 81: | Line 82: | ||
* '''language''': if the datatype is of rdf:langString we can define the language of the language tag using the wikipedia language code (e.g. language = de) | * '''language''': if the datatype is of rdf:langString we can define the language of the language tag using the wikipedia language code (e.g. language = de) | ||
* '''comment''': Comment about this mapping. Not used during extraction, only on the wiki. Please use English. | * '''comment''': Comment about this mapping. Not used during extraction, only on the wiki. Please use English. | ||
* '''nocat''': by default, mappings containing prefix or suffix are categorized into [[:Category:Mappings using prefix]] and [[:Category:Mappings using suffix]] respectively. Setting 'nocat' to anything other than 'false' will suppress these categories. | |||
=== Example === | === Example === |
Revision as of 00:27, 16 July 2014
{{PropertyMapping}} maps template properties to ontology properties.
Usage
{{PropertyMapping | templateProperty = | ontologyProperty = | select = | prefix = | suffix = | transform = | unit = | factor = | language = | comment = | nocat = }}
Meanings
- templateProperty: A template property to ontology property mapping should list one template property which is to be mapped.
- ontologyProperty: A template property to ontology property mapping should list one ontology property.
- select: A selector used to map only one value from the list defined by the template property. Currently only 'first' and 'last' are admitted.
- prefix/suffix: Add a prefix or suffix to the value provided in the template. Particularly useful in converting identifiers to URLs. Both a prefix and a suffix may be provided.
- transform: specifies the type of link created by adding a prefix or suffix. Can be either 'external' (to link to an absolute URL) or 'internal' (to link to another page on this wiki).
- unit: If a template property containing a numerical value and a unit is mapped, the unit has to be defined (Please use only values from DBpedia unit and dimensions). If a template property has no default unit defined, e.g. its values can contain different units of the same dimension, the dimension has to be defined for usability as well as validation reasons. Possible dimensions are Length or Mass.
- factor: Multiplication factor that is applied for numeric data.
- language: if the datatype is of rdf:langString we can define the language of the language tag using the wikipedia language code (e.g. language = de)
- comment: Comment about this mapping. Not used during extraction, only on the wiki. Please use English.
- nocat: by default, mappings containing prefix or suffix are categorized into Category:Mappings using prefix and Category:Mappings using suffix respectively. Setting 'nocat' to anything other than 'false' will suppress these categories.
Example
The property mapping from the template property birth_date to the ontology property birthDate:
{{PropertyMapping | templateProperty = birth_date | ontologyProperty = birthDate }}
The property mapping for the number of visitors which is specified in millions:
{{PropertyMapping | templateProperty = visitors_mio | ontologyProperty = visitors | factor = 1000000 }}
The property mapping for the first value of the spouses template property:
{{PropertyMapping | templateProperty = spouses | ontologyProperty = firstSpouse | select = first }}
The property mapping for a french title property:
{{PropertyMapping | templateProperty = french_title | ontologyProperty = title | language = fr }}