User:Ck3d/Ontology Proposal

From OpenStreetMap Wiki
Jump to navigation Jump to search

Article TODOs

I currently develop the templates based on this ontology on my private server, which is sometimes online.



This ontology proposal provides a guideline how to setup a semantic structure in combination with the MediaWiki extension Semantic MediaWiki. discussion→

Summary

The ontology is based on the current scheme used in the wiki to structure information transfer.

This proposal introduces a possibility to define distinctive domains in order to differentiate and to interpret different features based upon organizational units (e.g. countries). It also will define members, and tags which are applicable to relations. Further more it is possible to define combined tags (e.g. highway=path + bicycle=designated ≙ Cycleway).

In a first step, the proposal suggests to address only the semantics of pages "Key:..." and "Tag:..." since these pages already present structured information. As a consequence of the semantic information content map feature tables could be automatically generated.

Guidelines

Guidelines of this ontology are:

  • KISS in order to provide optimal usability
  • seamless migration
  • a minimum of changes to actual wiki structures
  • the definition of semantic names by intuition
  • users shouldn't be confronted with semantics
  • templates as simple as possible
  • possible to extend the ontology for future requirements

Problems

  • SMW has limitations on many-valued properties. This properties can be avoided by defining separate identities (see n-ary relations)
  • SMW has problems with equal sign (=) in page titles (e.g. "Tag:highway=trunk"); limitation? or bug?
  • StringFunctions can't deal with quotation mark (") in strings

Glossary

OSM basic terms

node Mf node.png (WGS84 plan position)
can have many tags
way Mf way.png (nodes)
can have many tags
relation Relation.png
can have many tags, many members and many relations
member
consists of one role and one node, way or relation; it will be assigned to a relation
role (string)
it describes which role a node, way or relation has; it is a free definable English abbreviation/term or nothing or a number or a combination of that; its meaning can be:
English term, boolean, index, orientation, ...
tag
consists of one key and one value; it will be assigned to a node, way or relation, which will be described but it can also describe a other tag; tag description pages actually use this template
key (string)
it is a free definable English abbreviation/term; key description pages actually use this template; its meaning can be:
English term
value (string)
it is a free definable English abbreviation/term or a number; its meaning can be:
English term, boolean, number, index, orientation, speed, meter, height, width, weight, ...

Other terms

area Mf area.png
it is not part of OSM protocol; a way has the meaning of area if beginning and ending node is the same node (closed way) in combination of tag area=yes, which can be explicit or implicit defined.
domain
There are cases where tags present too general descriptions of an object's properties. The planned domain, therefore should present a possibility to define additional implications to a tag.
Actual domains are useful only in country or state.
The term "domain" intends to show the possibility to extend the concept of planned developments of the ontology proposal for future requirements.
Necessity of domains is shown in the following examples:
A domain can be defined in other languages than in English.

Ontology

discussion→


OSM Element

discussion→


Title
Category:Node|Way|Relation|Member|Tag

Name type string; [1];automatic assignment from Title
correct name of a OSM Element; MediaWiki doesn't allow page titles with beginning lower case character and underlines in it

OSM Element examples

Category:OSM Element
Title Category: Name
Node node
Way way

Template:OSM Element Definition

<includeonly>
;Name
:[[Name::{{lc:{{PAGENAME}}}}]]
[[Category:OSM Element]]
</includeonly>

Tag

discussion→


Each tag has exactly one definition, which are defined in English. For a language specific translation of a tag the class translation has to be used. According to the tag a wiki redirect has to be manually created or will be automatically created by a wiki bot (e.g. "Tag:Highway=residential" → "Residential road").

Title
Tag:unique English term
Tag:unique non English term (only for tags which refer to a domain)

Key↗ type string; [1]
a key individual

Value↗ type string; [1]
a value individual

Applicable to↗ type page → OSM Element; [1]
a OSM element class

Implied by↗ type page → Tag|Member; [0..*]
a list of tag and member individuals which are implied by a tag

Required by↗ type page → Tag|Member; [0..*]
a list of tag and member individuals which are required by a tag

Suggested for↗ type page → Tag|Member; [0..*]
a list of tag and member individuals which are suggested for a tag

Group type string; [0..1]
group of a tag

Summary type text; [1]
summary of a tag

Photo↗ type page → Image; [0..1]
photo of a tag

Domain type string; [0..1]
domain of a tag (e.g. country code UK)

Language code type enumeration; [1]
language code of a tag; if no domain is specified en

Tag examples

Category:Tag
definition types: Title Tag: Key Value Applicable to↗ Category: Language code Group Implied by↗ Suggested for↗ Summary Domain
way Residential road highway residential Way en physical Roads accessing or around residential ...
way Road of unknown classification highway road Way en physical A road of unknown classification. This...
relation Boundary (relation) type boundary Relation en non physical for grouping boundaries and marking en...
domain specific way Class "A" road highway trunk Way en UK/Road ... UK
domain specific way Verkehrsberuhigter Bereich highway living_street Way de DE/Straße ... DE
tag 2 highway lanes lanes 2 Tag en physical
  • Tag:Motorway
  • ...
2 physical travel lanes...
unspecified tag Highway lanes? lanes '1-' Tag en physical
  • Tag:Motorway
  • ...
Total number of physical travel lanes ...
unspecified tag Name? name '*' Tag en non physical
  • Tag:...
Name of the taged object

Template:Tag Definition

<includeonly>
;Key
:[[Key::{{{Key}}}]]
;Value
:[[Value::{{{Value}}}]]
;Applicable to
:[[Applicable to::{{{Applicable to}}}]]
;Implied by
:{{#arraymap:{{{Implied by|}}}|,|x|[[Implied by::x| ]]}}
;Required by
:{{#arraymap:{{{Required by|}}}|,|x|[[Required by::x| ]]}}
;Suggested for
:{{#arraymap:{{{Suggested for|}}}|,|x|[[Suggested for::x| ]]}}
;Group
:{{#if:{{{Group|}}}|[[Group::{{{Group}}}]]|-}}
;Summary
:[[Summary::{{{Summary}}}]]
;Photo
:{{#if:{{{Photo|}}}|[[Photo::{{{Photo}}}]]|-}}
;Domain
:{{#if:{{{Domain|}}}|[[Domain::{{{Domain}}}]]|-}}
;Language code
:[[Language code::{{#if:{{{Language code|}}}|{{#if:{{{Domain|}}}|{{{Language code}}}|en}}|en}}]]
;Translations
:{{#ask: [[Category:Translation]] [[Refers to::{{FULLPAGENAME}}]]}}
;Implies
:{{#ask: [[Implied by::{{FULLPAGENAME}}]]}}
;Requires
:{{#ask: [[Required by::{{FULLPAGENAME}}]]}}
;Suggests
:{{#ask: [[Suggested for::{{FULLPAGENAME}}]]}}
[[Category:Tag]]
</includeonly>

Member

discussion→


Developments planned

Each member has exactly one definition, which are defined in English. For a language specific translation of a member the class translation has to be used.

Title
Member:unique English term
Member:unique non English term (only for members which refer to a domain)

Role type string; [1]
a role individual

Applicable to↗ type page → OSM Element; [1]
a OSM Element class

Has Tag↗ type page → Tag; [1]
a tag individual

Group type string; [0..1]
group of a member

Summary type text; [1]
summary of a member

Photo↗ type page → Image; [0..1]
photo of a member

Domain type string; [0..1]
domain of a member (e.g. country code UK)

Language code type enumeration; [1]
language code of a member; if no domain is specified en

Member examples

Category:Member
definition types: Title Member: Role Applicable to↗ Category: Has Tag↗ Tag: Language code Summary
term Border 'blank' Way Boundary (relation) en the multiple ways that form the border
term Enclave enclave Way Boundary (relation) en enclaves of this border

Template:Member Definition

TBD

Translation

discussion→


OSM is a multilingual project.

Each tag or member can have a translation into other languages. The translations have to be stored in respective pages. The semantic content of the referred page, then, will be displayed in an info box equivalent to the actual state.

Title
Language Code:Referred Page

Name type string; [1]
translated title of the referred page

Refers to↗ type page → Tag|Member; [1]; automatic assignment from Title
referred page that will be translated

Language Code type enumeration; [1];automatic assignment from Title
language code of a translation

Group type string; [0..1]
translated group of the referred page

Summary type text; [1]
translated summary of the referred page

Translation examples

Category:Language code
definition types: Title Name Refers to↗ Group Language code Summary
term De:Tag:Living street Spielstraße Tag:Living street Straßen de ...

Template:Translation Definition

<includeonly>
;Name
:[[Name::{{{Name}}}]]
;Refers to
:[[Refers to::{{#explode:{{PAGENAME}}|{{#explode:{{PAGENAME}}|:|0}}:|1}}]]
;Language code
:[[Language::{{lc:{{#explode:{{PAGENAME}}|:|0}}}}]]
;Group
:{{#if:{{{Group|}}}|[[Group::{{{Group}}}]]|-}}
;Summary
:[[Summary::{{{Summary}}}]]
[[Category:Translation]]
</includeonly>

Migration process

To keep the templates clean, following MediaWiki namespaces should be defined:

  • Tag
  • "Language code" (e.g. En, De, Fr)
  • Member (in the future)

Templates

MediaWiki has built in functions, these are called Magic words. Used functions are:

Functions used from further extensions:

Parser Functions
StringFunctions
Semantic Forms

See also