Help:In-text annotation

Consider the Wikipedia article on Berlin. This article contains many links to other articles, such as «Germany», «European Union», and «United States». However, the link to «Germany» has a special meaning: it was put there since Berlin is the capital of Germany. To make this knowledge available to computer programs, one would like to «tag» the link

Germany

in the article text, identifying it as a link that describes a «capital property». With Semantic MediaWiki, this is done by putting a property name and :: in front of the link inside the brackets, thus:

Is capital of::Germany

In the article, this text still is displayed as a simple hyperlink to «Germany». The additional text  is the name of the property that classifies the link to Germany. As in the case of categories, the name of the property is arbitrary, but users should try to re-use properties that already appear elsewhere.

To simplify this re-use, every property has its own article in the wiki, just as every category has an article. You can see all the properties in use in the wiki with. Just as category articles are prefixed with, all property articles are prefixed with   to distinguish them from other articles. So you can also also use MediaWiki's special page "Search" to find existing properties. As with categories, a property's article can be empty, but it is strongly recommended to add a description that explains the intent of the property and its proper usage.

In-text annotations and property declarations are case-sensitive and therefore adhere certain MediaWiki configuration settings (e.g. configuration parameter ) and if changed arbitrarily may cause content to be rendered invalid or unavailable during query execution.

Turning links into properties
There are various ways of adding properties to pages:

Turning values in text into properties
There is other useful information in wiki articles besides links to other articles. For example, there is a number in the Berlin article giving its population. To make this knowledge available to computer programs, one would like to "tag" the text

3,396,990

in the article, identifying it as a value for the "Has population" property. With Semantic MediaWiki, this is done by putting the property name and :: in front of the text and surrounding it with  brackets, thus:

Has population::3,396,990

This works fine. However, it creates a link to a 3,396,990 page, and having an article for every population value probably does not make sense. Furthermore, if you wanted to create a list of all German cities ordered by population, numeric order is different from the alphabetical order that you would expect for article names. For example, in alphabetical order, "1,000,000" comes before "345". We want to be able to tell Semantic MediaWiki that "Has population" is a number, not a link to a page in the wiki. The way to do this is to specify a type for the "Has population" property; see the article on Property declarations for more information.

Content classification
The following help page on data classification describes some principles on how to use categories and properties to classify and distinguish content from another.

Silent annotations using

 * ''See Help:Setting values for more detailed information

Instead of using the standard double-brackets markup, you can also define semantic data using the  parser function. This function takes in pairs of property names and values and stores them semantically; but it does not print anything to the screen. An example call would be:

The  call is specifically helpful when trying to save a Text value that contains square brackets, such as wiki-links; such brackets often don't work with conventional Semantic MediaWiki markup.

If the parser strict mode is disabled (note: default is enabled) then extra colons can cause unexpected pattern matching which should be mitigated by using the  parser function instead.

For example Has text::fc00:123:8000::/%6 can be expressed by


 * Result

See also this help page for further information.