Help:Datatype "Record"

From semantic-mediawiki.org
Help:Datatype "Record"Notes on record types
Record
Holds compound property values that consist of a short list of values with fixed type and order
Further information
Provided by: Semantic MediaWiki
Since version: 1.6.0
Until version: still in use
Datatype ID:
_rec
In this wiki: Record
Table of Contents

The datatype record is used for property values that consist of a short list of values of other datatypes. For each property that uses this datatype, the order and type of the individual fields of the record is fixed, based on a declaration with special property "Has fields"Defines a short list of fields with a fixed type and order for datatype Record on the property page. Individual fields in a record value are separated with semicolons (;).

In earlier versions of Semantic MediaWiki, record properties have also been called many-valued properties or n-ary properties.

Declaration and usage[edit]

A record property is declared by annotating the respective property page with 2 special properties:

  • [[Has type::Record]], and
  • a single1 annotation of [[Has fields::<field-1>;...]] listing the record's fields separated by semicolons (;), where each field is the name of another property - you must not have any two fields refer to the same property.

Defining and using a record[edit]

Limitations[edit]

  • 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 result format "Timeline"Displays query results in interactive timelines or geography related result formats, etc.

Technical notes[edit]

A record is stored internally as subobject (given its n-ary characteristics) hereby is represented by its own entity space, yet is tightly coupled to the embedding subject. Furthermore, if a record is defined by something like [[Has fields::Has foo;Has bar]] and a query contains a condition to [[Has foo::+]] then the result set will match the "native" record representation (meaning the subobject not the formatted record).

With "native" record representation2 we refer to a subobject with an anonymous identifier identifiable by _#... as part of the entity (subject, page) name.

See also[edit]



References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:3522
  2. ^  Duplicate article messing with queries "... will fetch those records as native subobject representation because it contains the `TitularMandante` property ..."