Wikipedia:Lua/Modul/WikidataScheme/Specification

Vorlagenprogrammierung Diskussionen Lua Unterseiten
Modul Deutsch English Modul: Dokumentation

This page describes the data structure used for a WikidataScheme specification.

A root element is to be provided.

Building blocks

EntityName

This can be either:

NameResolver

This is a mapping table resolve in root element which assigns:

The motivation to use a symbolic name is:

Naturally, all expected symbolic names are to be resolved, otherwise an error is shown in displayed table.

The JSON function may be used to resolve all symbolic names and generates pretty formatted JSON with entity IDs only.

TextVariant

This can be either:

The resulting strings may contain balanced basic markup:

Entry

This is used for both claims and rather similar for qualifiers.

Detail

Qualifier

This is rather similar to claims.

Root Element

Using all definitions of building blocks, the specification is defined as follows:

JSON and Lua

Example

{ "@generated": "2026-10-25T21:02:53+01:00",
  "@format": "WikidataScheme 2019-12-16",
  "claims": [
    { "subject": "instance",
      "state":   "required",
      "values":  [
                   {
        "qlist": [ "template",
                   "module",
                   "gadget",
                   "dataStruct",
                   true ]
                   }
                 ]
    },
    { "subject": "proglang",
      "state":   "suggested",
      "values":  [
                   {
        "qlist": [ "lua",
                   "javascript",
                   "css" ]
                   }
                 ]
    },
    { "subject": "source",
      "state":   "suggested",
      "values":  [
                   {
        "intro": "Q42253",
        "qualifiers": [
          { "subject": "protocol",
            "state":   "required",
            "q": "https"
          },
          { "subject": "host",
            "state":   "optional",
            "qlist": [ "enwiki",
                       "dewiki",
                       "mediawikiwiki",
                       "git",
                       true ]
          },
          { "subject": "dataFormat",
            "state":   "optional",
            "qlist": [ "json",
                       true ]
          }
                      ]
                   }
                 ]
    },
    { "subject": "version",
      "state":   "suggested",
      "values":  [
                   {
        "intro": {
          "de": "Versionsbezeichnung größer als die vorangehende",
          "en": "Revision ID greater than previous",
          "it": "ID versione maggiore della precedente",
          "ru": "Идентификатор версии выше предыдущего"
                 }
                   }
                 ]
    },
    { "subject": "licence",
      "state":   "suggested",
      "values":  [
                   {
        "qlist": [ "Q14946043",
                   "Q18199165" ]
                   }
                 ]
    },
    { "subject": "usedby",
      "state":   "optional",
      "values":  [
                   {
        "intro": {
          "de": "Bekannte Verwendungen, oder übergeordnete Einheit",
          "en": "Known usages, and root software of a sub unit",
          "it": "Applicazioni note o unità supoeriore",
          "ru": "Известное использование или родительская программная единица"
                 }
                   }
                 ]
    },
    { "subject": "uses",
      "state":   "optional",
      "values":  [
                   {
        "intro": {
          "de": "Abhängigkeiten, benötigte Ressourcen, aus anderen Paketen oder Untereinheiten",
          "en": "Dependencies, required resources, from other packages or sub units",
          "it": "Dipendenze, risorse necessarie, da altri pacchetti o da unità inferiori",
          "ru": "Зависимости, требуемые ресурсы, из других пакетов или подъединиц"
                 }
                   }
                 ]
    },
    { "subject": "doc",
      "state":   "suggested",
      "values":  [
                   {
        "intro": "Q42253",
        "qualifiers": [
          { "subject": "protocol",
            "state":   "required",
            "q": "https"
          },
          { "subject": "host",
            "state":   "optional",
            "qlist": [ "enwiki",
                       "dewiki",
                       "mediawikiwiki",
                       true ]
          },
          { "subject": "lang",
            "state":   "optional",
            "qlist": [ "en",
                       "de",
                       true ]
          }
                      ]
                   }
                 ]
    },
    { "subject": "tags",
      "state":   "optional",
      "values":  [
                   {
        "intro": {
          "de": "Tagging, Themen, Schlagwörter",
          "en": "Tagging, topics, keywords",
          "it": "Tag, materie, parole chiave",
          "ru": "Тегинг, темы, ключевые слова"
                 }
                   }
                 ]
    }
            ],
  "resolve": { "css":            { "Q": 46441 },
               "dataFormat":     { "P": 2701 },
               "dataStruct":     { "Q": 175263 },
               "de":             { "Q": 188 },
               "dewiki":         { "Q": 48183 },
               "doc":            { "P": 973 },
               "en":             { "Q": 1860 },
               "enwiki":         { "Q": 328 },
               "gadget":         { "Q": 61866692 },
               "git":            { "Q": 186055 },
               "host":           { "P": 137 },
               "https":          { "Q": 44484 },
               "instance":       { "P": 31 },
               "javascript":     { "Q": 2005 },
               "json":           { "Q": 2063 },
               "lang":           { "P": 407 },
               "licCC3":         { "Q": 14946043 },
               "licence":        { "P": 275 },
               "lua":            { "Q": 207316 },
               "mediawikiwiki":  { "Q": 15633578 },
               "module":         { "Q": 15184295 },
               "proglang":       { "P": 277 },
               "protocol":       { "P": 2700 },
               "source":         { "P": 1324 },
               "tags":           { "P": 366 },
               "template":       { "Q": 11266439 },
               "usedby":         { "P": 1535 },
               "uses":           { "P": 2283 },
               "version":        { "P": 348 }
           }
}