#ask: syntax – "annotation" query marker

From semantic-mediawiki.org
< #ask: syntax elements
#ask: syntax elements#ask: syntax – "annotation" query marker
#ask: syntax details:
Syntax
@annotation
Description Marks an inline query as part of an annotation
Datatype support All datatypes
Component query marker
Software Semantic MediaWiki
Since version Semantic MediaWiki 3.0.0 Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x.
Keyword self-reference · post process · annotation

The @annotation query marker marks an inline query as part of an annotation. It was introduced in Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x.1.

Rationale[edit]

It is possible to use inline queries (#ask or #show) to create semantic annotations. In other words, you can set the value of a semantic property to the result of an inline query. Since caching is used, the property value will not be automatically updated when the query result changes.

You can now let Semantic MediaWiki know that the inline query is used inside of a semantic annotation via the annotation query marker. This then allows Semantic MediaWiki to update the property value when the query result changes.

Example[edit]

Output of a query used to provide the data value of an annotation:

Syntax
[[SomeProperty::{{#show: {{FULLPAGENAME}} |?AnotherProperty |link=none |@annotation }}]]
Link

<sandbox.semantic-mediawiki.org>: More examples for this query marker

Note[edit]

Post-processing of jobs created by this query marker is done by API-module "smwtask"Allows to invoke and execute internal Semantic MediaWiki tasks.2 See also configuration parameter $smwgPostEditUpdateSets how many jobs should be executed as part of a post-edit event.

See also[edit]

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:2572
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:3318