Help:Datatype "URL"

From semantic-mediawiki.org
Help:Datatype "URL"Type URL 1.0 - 1.7.1/zh-hans


This documentation page applies to all SMW versions from 1.0 to 1.7.1.
      Other languages: dezh-hans

Help:Datatype "URL" en 1.0 1.7.1


URL
Holds URIs, URNs and URLs (similar to type String)
Further information
Provided by: Semantic MediaWiki
Since version: 1.0
Until version: still in use
Datatype ID:
In this wiki: URL
Table of Contents

Type:URL is a built-in datatype of Semantic MediaWiki that is used for the most common kinds of URLs, URNs, and URIs. It accepts almost any string and interprets it as a URL. The URL appears as a link in text and the Factbox.

Technically speaking, email addresses and even telephone numbers are also kinds of URLs. There are special datatypes for these kind of inputs that should be used in such cases: Email and Telephone number.

Strings vs. URLs[edit]

MediaWiki will generally display a property of String that starts with http:// as a hyperlink. However, strings do not check the validity of the input as a URL, and URLs have different meaning in RDF export, so it is generally recommended to use Type:URL if applicable.

Another important difference between strings and URIs is that the objects that are represented by some URI can be described further by using this URI in other statements. For example, we use the above URI of WWW2006 to specify information about the conference. It is not possible to specify information about a string in a similar way. Strings are just data and have no intrinsic properties other than being used in various places as concrete values for some properties.

The later observation also leads to problems: even the ontology language OWL DL that we use as an export format uses many URIs for identifying its language constructs. But it is not desirable to make new statements about those language constructs. For example, you clearly do not want to declare owl:sameAs, the property that specifies that two individuals refer to the same concept, as the capital of Germany! For this reason, the datatype Type:URL disallows certain URIs that already have a predefined meaning that cannot be used without changing the output format of the whole wiki. The corresponding URI ranges are specified by the MediaWiki message MediaWiki:smw_uri_blacklist which can be extended by wiki-administrators. URIs from those ranges will be rejected by the wiki, but this will not have any effect on normal usage where URIs typically just point to some web-resource, such as an HTML or image document.

Type:URI[edit]

Type:URI is an alias for Type:URL that had a slightly different meaning only in SMW versions before 1.0.