Jump to content

Help:Wikidata

From Wikifunctions

One of the key facets of Wikifunctions is to make use of Wikidata's broad repository of data. This page is an overview of where and how you can do that today, hopefully understandable with only an intermediate knowledge of Wikifunctions.

Wikidata represents thingsphysical objects, big and small, as well as collectives, classes, and conceptsas Items, giving each a unique identifier like Q42 or Q104587954 (the Item's 'QID').
Separately, it represents the words from the world's languages as Lexemes, with identifiers like L100000. These will be invaluable for the natural language generation goals of Abstract Wikipedia.

Statement model

Information about Items (and other entities) is given as a list of Statements, a.k.a. subjectpredicateobject triples. (Though when you browse Wikidata, statements with the same predicate Property are grouped, and the subject is omitted since it's clear from the page you're on.) These are represented in Wikifunctions with the Wikidata statement (Z6003) type.
The subject is always (a reference to) an Item/Lexeme/etc., the predicate is always (a reference to) a Property, and the value can be of different Types depending on what Wikidata datatype it uses. Wikidata also has the concepts of 'unknown value' and 'no value', which are represented on a Z6003 with the Wikidata claim subtype (Z6020) enum.

Statements have a rank, and can have qualifiers which either clarify the predicate or provide additional "sub-values". For example, the question "When was Wikifunctions started?" has multiple answers, and so you'll find multiple Statements on its Item with the predicate inception (P571). They have applies to part (P518) qualifiers to distinguish in what way their value is the inception date. (You can also call this Function to get the list and inspect them.)

Identifiers

For efficiency, most operations will return just a reference to an Item/Property/etc. and not a representation of the whole entity, which may be quite large even without considering nested Items. The full entity, or part of it, can then be 'fetched' or 'resolved' as necessary with specialised Functions.

Type for referencesType for resolved entities
Property Wikidata property reference (Z6092)
(PID)
Wikidata property (Z6002)
Entity Schema
Item Wikidata item reference (Z6091)
(QID)
Wikidata item (Z6001)
Lexeme Wikidata lexeme reference (Z6095)
(LID)
Wikidata lexeme (Z6005)
Lexeme Sense Wikidata lexeme sense reference (Z6096)
(LSID)
Wikidata lexeme sense (Z6006)
Lexeme Form Wikidata lexeme form reference (Z6094)
(LFID)
Wikidata lexeme form (Z6004)
Statement
(triple w/ all 'optionals')
Wikidata statement (Z6003)
Claim
(triple w/o 'optionals')
also Z6003
Snak
(predicatevalue pair)
Wikidata property claim (Z6007)
Reference
(citation)
Wikidata reference (Z6008)

Lightweight enumerations

Some Types on Wikifunctions are 'enumerations' (lists of options) where the valid elements are defined in terms of QIDs. You can find these and the Functions for working with them in the Catalogue.

Creating such enumeration Types currently requires submitting a proposal, which will be fulfilled by someone with Type creation permissions once it gains the support of the community.

Datetime

Main page: WF:Time in Wikidata

Natural language generation