Template:GeocoordinatesMapping: Difference between revisions

From DBpedia Mappings
Jump to navigationJump to search
(Created page with '<table class="wikitable"> <tr><th style="text-align:left" colspan="2">Geocoordinates Mapping </th></tr> {{#if:{{{coordinates|}}}|<tr> <td width="200px">coordinates template prope...')
 
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<table class="wikitable">
<includeonly><table class="wikitable">
<tr><th style="text-align:left" colspan="2">Geocoordinates Mapping
<tr><th style="text-align:left" colspan="2">Geocoordinates Mapping <small>([[Template:GeocoordinatesMapping|<span style="cursor:help;">help</span>]])</small>
</th></tr>
</th></tr>
{{#if:{{{coordinates|}}}|<tr>
{{#if:{{{coordinates|}}}|<tr>
<td width="200px">coordinates template property
<td width="200px">coordinates template property</td>
</td><td width="350px">{{{coordinates}}}</td></tr>}}
<td width="350px">{{{coordinates}}}</td>
{{#if:{{{coordinates|}}}|<tr>
</tr>}}
<td width="200px">latitude template property
</td><td width="350px">{{{latitude}}}</td></tr>}}
{{#if:{{{latitude|}}}|<tr>
{{#if:{{{latitude|}}}|<tr>
<td width="200px">longitude template property
<td width="200px">latitude template property</td>
</td><td width="350px">{{{longitude}}}</td></tr>}}
<td width="350px">{{{latitude}}}</td>
</tr>}}
{{#if:{{{longitude|}}}|<tr>
{{#if:{{{longitude|}}}|<tr>
<td width="200px">longitude degrees template property
<td width="200px">longitude template property</td>
</td><td width="350px">{{{longitudeDegrees}}}</td></tr>}}
<td width="350px">{{{longitude}}}</td>
</tr>}}
{{#if:{{{longitudeDegrees|}}}|<tr>
{{#if:{{{longitudeDegrees|}}}|<tr>
<td width="200px">longitude minutes template property
<td width="200px">longitude degrees template property</td>
</td><td width="350px">{{{longitudeMinutes}}}</td></tr>}}
<td width="350px">{{{longitudeDegrees}}}</td>
</tr>}}
{{#if:{{{longitudeMinutes|}}}|<tr>
{{#if:{{{longitudeMinutes|}}}|<tr>
<td width="200px">longitude seconds template property
<td width="200px">longitude minutes template property</td>
</td><td width="350px">{{{longitudeSeconds}}}</td></tr>}}
<td width="350px">{{{longitudeMinutes}}}</td>
</tr>}}
{{#if:{{{longitudeSeconds|}}}|<tr>
{{#if:{{{longitudeSeconds|}}}|<tr>
<td width="200px">longitude direction template property
<td width="200px">longitude seconds template property</td>
</td><td width="350px">{{{longitudeDirection}}}</td></tr>}}
<td width="350px">{{{longitudeSeconds}}}</td>
</tr>}}
{{#if:{{{longitudeDirection|}}}|<tr>
{{#if:{{{longitudeDirection|}}}|<tr>
<td width="200px">latitude degrees template property
<td width="200px">longitude direction template property</td>
</td><td width="350px">{{{latitudeDegrees}}}</td></tr>}}
<td width="350px">{{{longitudeDirection}}}</td>
</tr>}}
{{#if:{{{latitudeDegrees|}}}|<tr>
{{#if:{{{latitudeDegrees|}}}|<tr>
<td width="200px">latitude minutes template property
<td width="200px">latitude degrees template property</td>
</td><td width="350px">{{{latitudeMinutes}}}</td></tr>}}
<td width="350px">{{{latitudeDegrees}}}</td>
</tr>}}
{{#if:{{{latitudeMinutes|}}}|<tr>
{{#if:{{{latitudeMinutes|}}}|<tr>
<td width="200px">latitude seconds template property
<td width="200px">latitude minutes template property</td>
</td><td width="350px">{{{latitudeSeconds}}}</td></tr>}}
<td width="350px">{{{latitudeMinutes}}}</td>
</tr>}}
{{#if:{{{latitudeSeconds|}}}|<tr>
{{#if:{{{latitudeSeconds|}}}|<tr>
<td width="200px">latitude direction template property
<td width="200px">latitude seconds template property</td>
</td><td width="350px">{{{latitudeDirection}}}</td></tr>}}
<td width="350px">{{{latitudeSeconds}}}</td>
</tr>}}
{{#if:{{{latitudeDirection|}}}|<tr>
{{#if:{{{latitudeDirection|}}}|<tr>
<td> ontology property
<td width="200px">latitude direction template property</td>
</td><td>[[OntologyProperty:{{#replace:{{{ontologyProperty}}}|:|/}}]]</td></tr>}}
<td width="350px">{{{latitudeDirection}}}</td>
{{#if:{{{unit|}}}|<tr>
</tr>}}
<td>unit</td><td>{{{unit}}}</td>
{{#if:{{{ontologyProperty|}}}|<tr>
<td> ontology property</td>
<td>[[OntologyProperty:{{#replace:{{{ontologyProperty}}}|:|/}}|{{{ontologyProperty}}}]]</td>
</tr>}}
</tr>}}
</table>
</table></includeonly>
<noinclude>'''<nowiki>{{GeocoordinatesMapping}}</nowiki>''' maps one or more template properties containing geo coordinate values to ontology properties. It can combine several values (containing e.g. degree, minute and second) to one coordinate.
 
=== Usage ===
 
<pre>
{{GeocoordinatesMapping
| coordinates      =
| ontologyProperty =
}}
</pre>
 
<pre>
{{GeocoordinatesMapping
| latitude        =
| longitude        =
| ontologyProperty =
}}
</pre>
 
<pre>
{{GeocoordinatesMapping
| latitudeDirection  =
| latitudeDegrees    =
| latitudeMinutes    =
| latitudeSeconds    =
| longitudeDirection =
| longitudeDegrees  =
| longitudeMinutes  =
| longitudeSeconds  =
| ontologyProperty  =
}}
</pre>
 
=== Meanings ===
* where to put the converted result, by default "coordinates"
'''ontologyProperty'''
 
Use one set of these properties:<br/>
* all coordinates in one template property:
'''coordinates'''
* decimal coordinates in two properties:<br/>
'''latitude''', '''longitude''':
* coordinates broken into direction and 3 numbers:<br/>
'''latitudeDirection''', '''latitudeDegrees''', '''latitudeMinutes''', '''latitudeSeconds''',<br/>
'''longitudeDirection''', '''longitudeDegrees''', '''longitudeMinutes''', '''longitudeSeconds'''
 
=== Example ===
 
Geo coordinates are often distributed to four or six properties: for latitude and longitude and the corresponding degree, minute, second, south/north, east/west. Eg in template Infobox Settlement:
<pre>
{{ Infobox settlement
|lat_deg = 39  |lat_min = 52  |lat_dir = N
|long_deg = 32 |long_min = 52 |long_dir = E
...
}}
</pre>
 
The DBpedia parser ''GeocoordinatesMapping'' generates correct latitude and longitude values from these 6 elements:
<pre>
{{TemplateMapping
| mapToClass = Settlement
| mappings =
  {{GeocoordinatesMapping
    | latitudeDirection = lat_dir | latitudeDegrees = lat_deg | latitudeMinutes = lat_min | latitudeSeconds = lat_sec
    | longitudeDirection = long_dir | longitudeDegrees = long_deg | longitudeMinutes = long_min | longitudeSeconds = long_sec }}
}}
</pre>
 
Other place templates include coordinates for several points, so you use several instances of ''GeocoordinatesMapping''. E.g. for [[Mapping en:Geobox]] (by default ontologyProperty is "coordinates", which means the place overall):
<pre>
{{GeocoordinatesMapping
  | latitudeDegrees = lat_d  | latitudeMinutes = lat_m  | latitudeSeconds = lat_s  | latitudeDirection = lat_NS 
  | longitudeDegrees = long_d  | longitudeMinutes = long_m  | longitudeSeconds = long_s  | longitudeDirection = long_EW }}
{{GeocoordinatesMapping | ontologyProperty = highestPosition
  | latitudeDegrees = highest_lat_d  | latitudeMinutes = highest_lat_m  | latitudeSeconds = highest_lat_s  | latitudeDirection = highest_lat_NS 
  | longitudeDegrees = highest_long_d  | longitudeMinutes = highest_long_m  | longitudeSeconds = highest_long_s  | longitudeDirection = highest_long_EW }}
</pre>
 
</noinclude>

Latest revision as of 15:41, 13 January 2015

{{GeocoordinatesMapping}} maps one or more template properties containing geo coordinate values to ontology properties. It can combine several values (containing e.g. degree, minute and second) to one coordinate.

Usage

{{GeocoordinatesMapping
| coordinates      =
| ontologyProperty =
}}
{{GeocoordinatesMapping
| latitude         =
| longitude        =
| ontologyProperty =
}}
{{GeocoordinatesMapping
| latitudeDirection  =
| latitudeDegrees    =
| latitudeMinutes    =
| latitudeSeconds    =
| longitudeDirection =
| longitudeDegrees   =
| longitudeMinutes   =
| longitudeSeconds   =
| ontologyProperty   =
}}

Meanings

  • where to put the converted result, by default "coordinates"

ontologyProperty

Use one set of these properties:

  • all coordinates in one template property:

coordinates

  • decimal coordinates in two properties:

latitude, longitude:

  • coordinates broken into direction and 3 numbers:

latitudeDirection, latitudeDegrees, latitudeMinutes, latitudeSeconds,
longitudeDirection, longitudeDegrees, longitudeMinutes, longitudeSeconds

Example

Geo coordinates are often distributed to four or six properties: for latitude and longitude and the corresponding degree, minute, second, south/north, east/west. Eg in template Infobox Settlement:

{{ Infobox settlement
|lat_deg = 39  |lat_min = 52  |lat_dir = N
|long_deg = 32 |long_min = 52 |long_dir = E
...
}}

The DBpedia parser GeocoordinatesMapping generates correct latitude and longitude values from these 6 elements:

{{TemplateMapping
| mapToClass = Settlement
| mappings = 
  {{GeocoordinatesMapping 
    | latitudeDirection = lat_dir | latitudeDegrees = lat_deg | latitudeMinutes = lat_min | latitudeSeconds = lat_sec 
    | longitudeDirection = long_dir | longitudeDegrees = long_deg | longitudeMinutes = long_min | longitudeSeconds = long_sec }}
}}

Other place templates include coordinates for several points, so you use several instances of GeocoordinatesMapping. E.g. for Mapping en:Geobox (by default ontologyProperty is "coordinates", which means the place overall):

 {{GeocoordinatesMapping 
   | latitudeDegrees = lat_d  | latitudeMinutes = lat_m  | latitudeSeconds = lat_s  | latitudeDirection = lat_NS  
   | longitudeDegrees = long_d  | longitudeMinutes = long_m  | longitudeSeconds = long_s  | longitudeDirection = long_EW }}
 {{GeocoordinatesMapping | ontologyProperty = highestPosition 
  | latitudeDegrees = highest_lat_d  | latitudeMinutes = highest_lat_m  | latitudeSeconds = highest_lat_s  | latitudeDirection = highest_lat_NS  
  | longitudeDegrees = highest_long_d  | longitudeMinutes = highest_long_m  | longitudeSeconds = highest_long_s  | longitudeDirection = highest_long_EW }}