Help:Datatype "String"

From semantic-mediawiki.org
Jump to: navigation, search
String
Holds character sequences up to 255 characters
Further Information
Provided by: Semantic MediaWiki
Added in version: 1.0
Removed in version: 1.7.1
Datatype ID:
_str
In this wiki: String
Table of Contents

The datatype String is used for simple words and similar character sequences. It has the following restrictions:

  • If you want to store special character sequences like "::", you need to store them using the parser function #set, instead of with the more standard "[[Property::value]]" notation.
  • Values cannot be longer than 255 characters (if you use non-Latin characters, this number might be smaller). For longer strings, use datatype "Text"Holds text of arbitrary length instead.

You can use some wiki markup inside a string property such as runs of ' for bold and italic, and the markup will change the appearance of the string. You cannot embed semantic annotations inside a string property.

Restricting values

You can use special property "Allows value"Lists one permissible value for a property to restrict a property to a particular set of values. For example you could limit a property like "Status" to values like "Active", "Pending", etc.

Compatibility note

Since Semantic MediaWiki 1.8.0Released on 2 December 2012 and compatible with MW 1.17.0 - 1.22.x
(except 1.22.1).
this datatype is depreciated for SMWSQLStore3 and was removed entirely with Semantic MediaWiki 1.9.0Released on 3 January 2014 and compatible with MW 1.19.0 - 1.22.x. where this datatype remains to be just an alias of datatype "Text"Holds text of arbitrary length.

You are advised to change the datatype declaration of property pages from datatype "String"Holds character sequences up to 255 characters to datatype "Text"Holds text of arbitrary length though the aliasing will not be removed in the foreseeable future.1


Related query syntax elements

General

Help pageSyntax elementDescription
#ask: annotation query marker
@annotation
Marks an inline query as part of an annotation2
#ask: control query marker
@control=slider
Allows to dynamically alter a result display without the need to reload a page3
#ask: deferred query marker
@deferred
Marks an inline query as deferred from regular parsing3
#ask: hierarchy depth restriction
+depth=
Restricts the hierarchy depth of a query4
#ask: printout column alignment
+align=
Defines an alignment for the content of a printout column
#ask: printout column width
+width=
Defines a width for a printout column5
#ask: printout sorting order
+order=
Defines the sorting order for printout statements (dot chain syntax)6


References

  1. ^  Semantic MediaWiki: GitHub issue gh:smw:1893
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:2572
  3. a b  Semantic MediaWiki: GitHub pull request gh:smw:2398 (Add support for @deferred mode)
  4. ^  Semantic MediaWiki: GitHub issue gh:smw:2662
  5. ^  Semantic MediaWiki: GitHub pull request gh:smw:2677
  6. ^  Semantic MediaWiki: GitHub pull request gh:smw:2073