|Holds URIs, URNs and URLs|
|Provided by:||Semantic MediaWiki|
|Until version:||still in use|
|In this wiki:||URL|
|Table of Contents|
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, e-mail addresses and even telephone numbers are also kinds of URLs. There are special datatypes for these kind of data values that should be used in such cases: datatype "Email"Holds e-mail addresses and datatype "Telephone number"Holds international telephone numbers based on the standard.
Datatype "Annotation URI"Holds URIs, but has some technical differences during export compared to the "URL" type is a specialized variant of this datatype.
Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x. introduced configuration parameter
$smwgURITypeSchemeListSets the permissive URI schemes for data values to properties of datatype URL and Annotation URI setting the list of permissive permissive URI schemes for data values to allow for better validation.
Text vs. URL
MediaWiki will generally display a property of datatype "Text"Holds text of arbitrary length that starts with http:// or https:// 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.
The URL type denotes that it is a reference to something else. 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 system 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.
Searching within values
Since Semantic MediaWiki 1.8.0Released on 2 December 2012 and compatible with MW 1.17.0 - 1.22.x
(except 1.22.1). the first 40 characters (if more than 72 characters were stored as property value) or all 72 characters (if a maximum of 72 characters were stored as property value) are searchable as explained on the help page about selecting pages.1 Searching within property values was not possible in earlier versions of Semantic MediaWiki (≤ 1.7.1).
With Semantic MediaWiki 2.5.0Released on 14 March 2017 and compatible with MW 1.23.0 - 1.29.x. a full-text search feature2 was introduced which allows to search with in more than just the maximum of 72 characters as described before.
Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x. again introduced configuration parameter
$smwgFieldTypeFeaturesSets relational database specific field type features with it's option
SMW_FIELDT_CHAR_LONG3 making it possible to extend the searchable length as described here to 300 characters4 without relying on the full-text search feature.
There is one output format
NOWIKI available which is specific to this datatype. It escapes the URL and displays it as a plain string. This is useful if you e.g. want to generate links containing text on the page with the query result. See the help page on displaying information for further information on this.
- API example
- Help page on configuration parameter
$smwgURITypeSchemeListSets the permissive URI schemes for data values to properties of datatype URL and Annotation URI
- Help page on configuration parameter
$smwgFieldTypeFeaturesSets relational database specific field type features
- Semantic MediaWiki: User mailing list thread " Unable to query over the last words of a long text value "
- Semantic MediaWiki: GitHub pull request gh:smw:1481 |
- Semantic MediaWiki: GitHub pull request gh:smw:2536
- Stack Overflow: Question 3489041: Mysql::Error: Specified key was too long; max key length is 1000 bytes