Template:GeocoordinatesMapping: Difference between revisions

From DBpedia Mappings
Jump to navigationJump to search
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 85: Line 85:


=== Meanings ===
=== Meanings ===
* where to put the converted result, by default "coordinates"
'''ontologyProperty'''


* '''coordinates''': Use the coordinates parameter if the geo coordinates are covered by one template property.
Use one set of these properties:<br/>
 
* all coordinates in one template property:
 
'''coordinates'''
* '''latitude'''
* decimal coordinates in two properties:<br/>
* '''longitude'''
'''latitude''', '''longitude''':
 
* coordinates broken into direction and 3 numbers:<br/>
 
'''latitudeDirection''', '''latitudeDegrees''', '''latitudeMinutes''', '''latitudeSeconds''',<br/>
* '''latitudeDirection'''
'''longitudeDirection''', '''longitudeDegrees''', '''longitudeMinutes''', '''longitudeSeconds'''
* '''latitudeDegrees'''
* '''latitudeMinutes'''
* '''latitudeSeconds'''
* '''longitudeDirection'''
* '''longitudeDegrees'''
* '''longitudeMinutes'''
* '''longitudeSeconds'''
 
 
* '''ontologyProperty'''


=== Example ===
=== 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. See template Infobox Settlement.
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>
<pre>
{{ Infobox settlement
{{ Infobox settlement
|latd = 39  |latm = 52  |latNS = N
|lat_deg = 39  |lat_min = 52  |lat_dir = N
|longd = 32 |longm = 52 |longEW = E
|long_deg = 32 |long_min = 52 |long_dir = E
...
...
}}
}}
</pre>
</pre>


The template Settlement contains the template properties lat_deg, lat_min, lat_sec, lat_dir, long_deg, long_min, long_sec, long_dir from which the DBpedia parser named GeocoordinatesMapping has to generate correct latitude and longitude values and write them as GeoNames triples. Here the template GeocoordinatesMapping is used.
The DBpedia parser ''GeocoordinatesMapping'' generates correct latitude and longitude values from these 6 elements:
<pre>
<pre>
{{TemplateMapping
{{TemplateMapping
| mapToClass = Settlement
| mapToClass = Settlement
| mappings =  
| 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 }}
   {{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>
</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>
</noinclude>

Latest revision as of 14: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 }}