Help:Datatype "Page"

From semantic-mediawiki.org
(Redirected from Help:Datatype "Page")
Page
Holds names of wiki pages, and displays them as a link
Further information
Provided by: Semantic MediaWiki
Since version: 1.0
Until version: still in use
Datatype ID:
_wpg
In this wiki: Page
Table of Contents

The datatype Page is used for properties whose value is a page in the wiki. It is the essential datatype for building relationships between wiki pages.

When to use

Conceptually, a property of type "Page" represents a relationship to "another thing" in the wiki (or even another wiki if interwiki links are used). As such, it can be used to answer to a concept in Linked Data that favours "things not strings": by modelling wiki pages as entities - e.g. persons, places, organisations, objects, processes, events, etc. - and using properties of datatype "Page" to establish relationships between them, you can organise knowledge as a queryable, semantic network.

If you need to be able to decide on the basis of specific features, the comparison of "Page" and "Text" datatypes below may help.

Features

  • By default, properties of datatype "Page" display as a link in inline queries and search interfaces.
  • Values may not be longer than 255 characters.
  • It is the default datatype of a property if a different datatype was not explicitly set. For example, if you write {{#set:Brand New Prop=Some Value}} (where 'Property:Brand New Prop' was not previously defined), SMW assumes Brand New Prop is of type "Page" and that Some Value represents a page in the wiki, whether or not it exists.
  • Supports inverse queries and property chains.
  • Supports links to interwiki pages - see below.

Page versus Text

You can use datatype Page in most cases where you would use datatype "Text". Making the property value a wiki page allows you to document each possible value in the wiki. It is not an error if there is no page yet for the value. Indeed, this can encourage consistency as links to non-existent pages appear differently. Viewing the page for a value in the Semantic Browser will show all the pages and relations for which it is the object.

Using datatype "Text" may be better in case the possible values of the property:

  • are a large set
  • do not have much useful documentation


Table of comparison between properties of datatype "Page"Holds names of wiki pages, and displays them as a link and datatype "Text"Holds text of arbitrary length
Property of datatype "Page" Property of datatype "Text"
Naming values
Characters permitted Value has the naming restrictions that apply to page titles in MediaWiki. See the documentation at MediaWiki.org. Value may contain arbitrary text, including markup (such as that for bold and italic)
Length of value permitted Value may not be longer than 255 bytes, again because of restrictions that apply to page titles in MediaWiki Value may be longer than 255 bytes
Use of values in query statements
Support for equivalent values? Value can be made an alias of another 'Page' value. This is achieved using MediaWiki's #REDIRECT syntax, which is used to forward users from a variant page title to the target page. Value cannot be made an alias of another 'Text' value.
Wildcards Value accepts wildcards in queries Value accepts wildcards in queries
Number of characters searchable (using wildcards and comparators) Value is searchable for all 255 bytes Value is searchable for the first 40 characters (if more than 72 characters were stored as property value) or 72 characters (if a maximum of 72 characters were stored as property value) for users of SMWSQLStore3 not using the full-text search feature. No restriction for SMWElasticStore.
Inverse querying Yes, property allows for inverse querying. In this way, a list of unique property values can be retrieved. No, property does not allow for inverse querying. To retrieve a set of unique property values, see some alternative approaches listed here, which may or may not offer a solution.
Annotating values Value cannot itself be annotated. However, the page associated with a value may hold semantic annotations and so it can be the basis for extended queries such as subqueries. In addition, it can be the target for another property-value pair, making it queryable in different contexts. Value cannot itself be annotated. However, it can be the target for another property-value pair, making it queryable in different contexts.
Appearance of values in printout statements
Appearance without special formatting Value returned by a query normally appears as a page link. Value returned by a query is rendered as-is in wiki text. This means that markup, such as that for bold and italic (see above), is usually rendered, although there may be exceptions.
Special formatting Value can be de-linked by setting the query parameter link= (available in most result formats) to none. Additional formatting is usually achieved by means of templates. Additional formatting is usually achieved by means of templates.
Other
Service links Property supports service links Property does not support service links


Links to interwiki pages

It is possible to link to pages on external websites using interwiki prefixes. For instance, to set "sandbox:Interwiki links" (sandbox:Interwiki links) as the value of the property "Has page", where "sandbox" is the interwiki prefix defined for our sandbox site, we will use the following annotation: {{#set:Has page=sandbox:Interwiki links}}. When we query for values of this property on the current page, we should get an interwiki link.

{{#show: {{FULLPAGENAME}} |?Has page }}

Result: Interwiki links

Creating such a relationship from a local wiki page to an external page goes in one direction only. The limitation here is that an external page does not automatically make its semantic data (if any) available back to the local wiki. For possible solutions, see Extension "Semantic External Query Lookup" and Extension "Semantic Interlanguage Links".

Interfaces

Examples

API example


History

  • In very early versions of Semantic MediaWiki (Semantic MediaWiki 1.0Released on 31 December 2007 and compatible with MW 1.9.x - 1.12.x. and earlier), properties of datatype "Page" were known as "relations".
  • Semantic MediaWiki 1.2.0Released on 10 July 2008 and compatible with MW 1.11.x - 1.14.x. - adds support for interwiki pages.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.