Help:Datatype "Telephone number"

From semantic-mediawiki.org
Jump to: navigation, search
Telephone number
Holds international telephone numbers based on the RFC 3966 standard
Further Information
Provided by: Semantic MediaWiki
Added in version: 1.5.0
Removed in version: still in use
Datatype ID:
_tel
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 3966 1 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

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.

Examples

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;vnd.company.option=foo]]
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]]

Semantic search

Using telephone number properties for searching pages can be done in a similar fashion as for all other properties; see Help: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::+]] }}.


Related query syntax elements

General

Help pageSyntax elementDescription
#ask: annotation query marker
@annotation
Marks an inline query as part of an annotation3
#ask: control query marker
@control=slider
Allows to dynamically alter a result display without the need to reload a page4
#ask: deferred query marker
@deferred
Marks an inline query as deferred from regular parsing4
#ask: hierarchy depth restriction
+depth=
Restricts the hierarchy depth of a query5
#ask: printout column width
+align=
Defines an alignment for the content of a printout column
#ask: printout column width
+width=
Defines a width for a printout column6



This documentation page applies to all SMW versions from 1.5.0 to the most current version.
      Other languages: dezh-hans

Help:Type Telephone number en 1.5.0


References

  1. a b c  https://tools.ietf.org/html/rfc3966
  2. ^  https://tools.ietf.org/html/rfc3966#section-5.1.1
  3. ^  Semantic MediaWiki: GitHub pull request gh:smw:2572
  4. a b  Semantic MediaWiki: GitHub pull request gh:smw:2398 (Add support for @deferred mode)
  5. ^  Semantic MediaWiki: GitHub issue gh:smw:2662
  6. ^  Semantic MediaWiki: GitHub pull request gh:smw:2677