Help:Type Reference

The datatype Reference is meant to associate a value with an individual defined provenance metadata record. It was introduced in .CiteRef::gh:smw:1812

This page is mainly concerned with the  datatype declaration but you may want to read information referenced statement to find some background on the reasoning for this datatype.

For an exhaustive description on how to use the reference and provenance data feature which is made available by this datatype, please see the Semantic MediaWiki GitHub issue #1808CiteRef::gh:smw:1808 as well as the Semantic MediaWiki Sandbox example page for the corresponding pull request #1812.CiteRef::sb:smw:1812

Usage
on the property page of the reference property - you cannot refer to the same field property twice, nor can you have multiple   annotations on the reference property page.CiteRef::gh:smw:3522
 * Annotation
 * To create a property of datatype "Reference", the  annotation has to be added to the property page
 * To define the actual fields that will hold the provenance data, apply an annotation like
 * The datatypes and position of the provenance data fields are fixed by the position used in the  declaration
 * By convention the first field of the "Has fields" declaration must describe the property holding the value to be referenced. This is equivalent to just declaring  without adding provenance data
 * An annotation to a property of datatype "Reference" requires the reference to be added as a concatenated string separated by " ", e.g.


 * In case a value itself contains " "as part of its declaration then " " is to be used to distinguish it from the separator
 * Annotations of datatype "Reference" work in the same way other datatypes do and can be combined with the  parser function or the   parser function
 * Query
 * Queries which operate the same way as with those of the "Record" datatype and can specify the level of granularity with which an entity is expected to match ( vs.  )

Display

 * Values with a reference will show a  marker to indicate additional information being available which when hovered over to display a tooltip with those additional value statements
 * A reference to a value will in most cases (when displayed as in-text or as result of a  query) be displayed as a tooltip

Examples
See Property:Has Wikidata reference and Demo:Franz Schubert
 * Has Wikidata reference

The property is called "Has population" and the following declarations are added to it's page:    with property "Population" being of, "Retrieved on" being of  and "Retrieved from" being of.
 * Has population (Sandbox)
 * Example on Semantic MediaWiki Sandbox for pull request #1812
 * https://sandbox.semantic-mediawiki.org/wiki/Property:Has_population
 * https://sandbox.semantic-mediawiki.org/wiki/Berlin
 * https://sandbox.semantic-mediawiki.org/wiki/Q33
 * https://sandbox.semantic-mediawiki.org/wiki/Property:GDP

Limitations

 * You cannot use to control how a specific field appears.
 * You cannot #ask for a  printout if that field property has a  annotation.CiteRef::gh:smw:3517
 * You cannot set the layout of the values; they will always appear as a comma-separated list.
 * Fields of records cannot be the basis for special purpose query formats such as or geography related result formats, etc.