Help:Datatype "Telephone number"

Help:Datatype "Telephone number"Type Telephone number/zh-hans
Telephone number
Holds international telephone numbers based on the RFC 3966 standard
Further information
Provided by: Semantic MediaWiki
Since version: 1.5.0
Until version: still in use
Datatype ID:
In this wiki: Telephone number
Table of Contents

The datatype telephone number is used for international telephone numbers that are to be stored in a standardized format. The datatype will try to interpret the phone number according to RFC 39661 so that it can be exported in a machine-readable format using tel: URIs.

Applications that do not need any re-use or validation of telephone numbers can also use datatype datatype "Text"Holds text of arbitrary length to store arbitrary human-readable phone number strings.

Declaration and Usage[edit]

A property of this type can be declared by writing [[has type::Telephone number]] on the property page.

Values of this property are complete phone number strings including country code. It is allowed to use the symbols "/", "-", ".", or " " to structure phone numbers in a readable way. These symbols will be used for the display of the data. Note that for the storage of data only the symbols "/", "-", "." are used but not a space. If spaces were specified for display a hyphen will however be used for storage, e.g. "+49-30-45-08-49-40" instead of "+49 30 45 08 49 40". The reason for this is that though the International Telecommunication Union (ITU) recommends the use of space characters as visual separators in printed telephone numbers RFC 3966 by the Internet Engineering Task Force (IETF) defines that URIs for telephone numbers MUST NOT use spaces in visual separators to avoid excessive escaping.2

Global numbers must always start with "+" or "00". Optionally, it is allowed to write the RFC 3966 1 URI prefix "tel:" in front of any telephone number.

The datatype does not support local numbers (without global country code). Moreover, it is not allowed to use vanity numbers since the mapping from letters to numbers is not standardized internationally.


Below are some examples of correct phone numbers:

Preferred annotations
[[Has telephone number::+353-91-555560]]
[[Has telephone number::00353-91-555560]]
Allowed annotations
[[Has telephone number::+353.91.555559]]
[[Has telephone number::+353 91 555561]]
[[Has telephone number::+ 353 91 555562]]
[[Has telephone number::+353 91 5 55563]]
[[Has telephone number::+353/91/555564]]
[[Has telephone number::00353 91 555565]]
[[Has telephone number::00353 / 91555566]]

It is allowed to write tel:in front of any of these examples, as in [[Has telephone number::tel:+353-91-555560]]. Moreover, some special fields are also allowed (see RFC 3966 1 for explanation):

[[Has telephone number::tel:+353-91-555560;postd=pp22]]
[[Has telephone number::tel:+1234567890;phone-context=+1234;]]
Invalid annotations

The following examples are not allowed and will lead to errors:

[[Has telephone number::+353 (0) 91 555555]]
[[Has telephone number::(00353 91) 55 55 55]]
[[Has telephone number::+353-91-55555-5/-6]]
[[Has telephone number::091 555 555]]
[[Has telephone number::+353-91-CALLME]]
[[Has telephone number::+353-91-55555-5 after 6pm]]
[[Has telephone number::+-353-91-55555-5]]
[[Has telephone number::+1]]
API example

Semantic search[edit]

Using telephone number properties for searching pages can be done in a similar fashion as for all other properties; see Semantic search. As with any property, you can use the "+" wildcard to select all pages with some value for a telephone number property, for example {{#ask: [[Has telephone number::+]] }}.


  1. a b c  RFC 3966: The tel URI for Telephone Numbers
  2. ^  RFC 3966: The tel URI for Telephone Numbers - Separators in Phone Numbers