Module:Sandbox/AbstractWikipedia/Constructors/doc

This is the documentation page for Module:Sandbox/AbstractWikipedia/Constructors

The Constructors module creates abstract content for the use of the NLG Scribunto prototype.

Each one of the publicly-exposed function (with the exception of the Constructors function) returns a constructor of a specific type, corresponding to the name of the function (e.g. the Birth function will return a Birth constructor). In general, the constructor will be instantiated with data from the Wikidata item corresponding to the given Q-id (an exception is the Age function which instantiates the constructor using the data given in two other constructors, namely Birth and Death). In order to facilitate access to Wikidata properties, the module uses the Wikidata module. In a Wikifunctions implementation, these constructor-creation functions would probably be user-supplied Wikifunctions functions.

The Constructors function

edit

The Constructors function is special in that it returns a list of instantiated constructors, which correspond to the abstract content which should be verbalized for a given topic (identified by its Q-id). First, the function will attempt to retrieve manually-curated abstract content (which is stored in the Abstract Content module). If that doesn't exist, it will attempt to dynamically assemble abstract content depending to the type of the Q-id's item. Currently only items which refer to people are supported. If no abstract content can be assembled, an error is raised.