Template:PropertyMapping: Difference between revisions
From Mediawiki1
Jump to navigationJump to search
No edit summary |
No edit summary |
||
(17 intermediate revisions by 4 users not shown) | |||
Line 8: | Line 8: | ||
<td> ontology property | <td> ontology property | ||
</td><td>{{#if:{{{ontologyProperty|}}}|[[OntologyProperty:{{{ontologyProperty}}}|{{{ontologyProperty}}}]]|<span style="color:red">please define an ontology property</span>}}</td></tr> | </td><td>{{#if:{{{ontologyProperty|}}}|[[OntologyProperty:{{{ontologyProperty}}}|{{{ontologyProperty}}}]]|<span style="color:red">please define an ontology property</span>}}</td></tr> | ||
{{#if:{{{select|}}} | {{#switch: {{{select}}} | {{#if:{{{select|}}} | {{#switch: {{{select}}} | ||
| first = <tr> | | first = <tr> | ||
Line 17: | Line 16: | ||
</tr> | </tr> | ||
| #default = <tr><td>select</td><td><span style="color:red">please use either 'first' or 'last'</span></td></tr> | | #default = <tr><td>select</td><td><span style="color:red">please use either 'first' or 'last'</span></td></tr> | ||
}}[[Category:Mappings using select]] | |||
}} {{#if:{{{prefix|}}} | | |||
<tr> | |||
<td>prefix</td><td>{{{prefix}}}</td> | |||
</tr>[[Category:Mappings using prefix]]}} | |||
{{#if:{{{suffix|}}} | | |||
<tr> | |||
<td>suffix</td><td>{{{suffix}}}</td> | |||
</tr> | |||
{{#ifeq: {{lc:{{{nocat|false}}} }} | false | [[Category:Mappings using suffix]] | <!-- Category suppressed --> }} | |||
}} {{#if:{{{transform|}}} | {{#switch: {{{transform}}} | |||
| internal = <tr> | |||
<td>transform</td><td>{{{transform}}}</td> | |||
</tr> | |||
| external = <tr> | |||
<td>transform</td><td>{{{transform}}}</td> | |||
</tr> | |||
| #default = <tr><td>transform</td><td><span style="color:red">please use either 'internal' or 'external'</span></td></tr> | |||
}} | |||
{{#ifeq: {{lc:{{{nocat|false}}} }} | false | [[Category:Mappings using transform]] | <!-- Category suppressed --> }} | |||
}} | }} | ||
{{#if:{{{unit|}}}|<tr> | {{#if:{{{unit|}}}|<tr> | ||
<td>unit</td><td>[[Datatype:{{{unit}}}|{{{unit}}}]]</td> | <td>unit</td><td>[[Datatype:{{{unit}}}|{{{unit}}}]]</td> | ||
</tr>}} | </tr> | ||
{{#ifeq: {{lc:{{{nocat|false}}} }} | false | [[Category:Mappings using unit]] | <!-- Category suppressed --> }} | |||
}} | |||
{{#if:{{{factor|}}}|<tr> | {{#if:{{{factor|}}}|<tr> | ||
<td>factor</td><td>{{{factor}}}</td> | <td>factor</td><td>{{{factor}}}</td> | ||
</tr>}} | </tr>[[Category:Mappings using factor]]}} | ||
{{#if:{{{language|}}}|<tr> | |||
<td>language</td><td>{{{language}}}</td> | |||
</tr>[[Category:Mappings using custom language]]}} | |||
{{#if:{{{comment|}}}|<tr> | {{#if:{{{comment|}}}|<tr> | ||
<td>comment</td><td>{{{comment}}}</td> | <td>comment</td><td>{{{comment}}}</td> | ||
Line 39: | Line 61: | ||
| ontologyProperty = | | ontologyProperty = | ||
| select = | | select = | ||
| prefix = | |||
| suffix = | |||
| transform = | |||
| unit = | | unit = | ||
| factor = | | factor = | ||
| language = | |||
| comment = | | comment = | ||
| nocat = | |||
}} | }} | ||
</pre> | </pre> | ||
Line 47: | Line 74: | ||
=== Meanings === | === Meanings === | ||
* '''templateProperty''': | * '''templateProperty''': One template property which is to be mapped. | ||
* '''ontologyProperty''': | * '''ontologyProperty''': One target 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. | * '''select''': A selector used to map only one value from the list defined by the template property. Currently only 'first' and 'last' are admitted. See [[:Category:Mappings using select]] | ||
* '''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 [http://mappings.dbpedia.org/index.php/DBpedia_Datatypes 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. | * '''prefix'''/'''suffix''': Add a prefix or suffix to the value provided in the template. Particularly useful in converting [[:Category:Identifier|identifiers]] to URLs. Both a prefix and a suffix may be provided. | ||
* '''factor''': Multiplication factor that is applied for numeric data. | * '''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). See [[:Category:Mappings using transform]] | ||
* '''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 [http://mappings.dbpedia.org/index.php/DBpedia_Datatypes 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. See [[:Category:Mappings using unit]] | |||
* '''factor''': Multiplication factor that is applied for numeric data. See [[:Category:Mappings using factor]] | |||
* '''language''': if the ontologyProperty has range rdf:langString, we can define the language tag using the wikipedia language code (e.g. language = de). See [[:Category:Mappings using custom language]] | |||
* '''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 === | ||
Line 82: | Line 113: | ||
| ontologyProperty = firstSpouse | | ontologyProperty = firstSpouse | ||
| select = first | | select = first | ||
}} | |||
</pre> | |||
The property mapping for a french title property: | |||
<pre> | |||
{{PropertyMapping | |||
| templateProperty = french_title | |||
| ontologyProperty = title | |||
| language = fr | |||
}} | }} | ||
</pre> | </pre> | ||
</noinclude> | </noinclude> |
Latest revision as of 14:50, 8 June 2016
{{PropertyMapping}} maps template properties to ontology properties.
Usage
{{PropertyMapping | templateProperty = | ontologyProperty = | select = | prefix = | suffix = | transform = | unit = | factor = | language = | comment = | nocat = }}
Meanings
- templateProperty: One template property which is to be mapped.
- ontologyProperty: One target 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. See Category:Mappings using select
- 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). See Category:Mappings using transform
- 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. See Category:Mappings using unit
- factor: Multiplication factor that is applied for numeric data. See Category:Mappings using factor
- language: if the ontologyProperty has range rdf:langString, we can define the language tag using the wikipedia language code (e.g. language = de). See Category:Mappings using custom language
- 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 }}