File: wikibase-manifest-schema-v2.js

package info (click to toggle)
openrefine 3.9.5-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 44,436 kB
  • sloc: javascript: 106,758; java: 91,946; xml: 6,634; sh: 614; makefile: 78; python: 71; sql: 59
file content (164 lines) | stat: -rw-r--r-- 7,382 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
const WikibaseManifestSchemaV2 = {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://openrefine.org/schemas/wikibase-manifest-v2.json",
  "type": "object",
  "description": "The schema validates Wikibase manifests with version 2.x. The manifest contains configurations of basic information (e.g. URL of the main page), extensions (e.g. OAuth extension) or external services (e.g. Reconciliation service) of a Wikibase",
  "properties": {
    "version": {
      "type": "string",
      "pattern": "^2\\.[0-9]+$",
      "description": "The version of the Wikibase manifest, in the format of 2.x"
    },
    "mediawiki": {
      "type": "object",
      "description": "The configurations of the MediaWiki engine",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the Wikibase, such as 'Wikidata'"
        },
        "root": {
          "type": "string",
          "pattern": "^.*/$",
          "description": "The URL of the root of the Wikibase, such as 'https://www.wikidata.org/wiki/'. The trailing slash cannot be omitted"
        },
        "main_page": {
          "type": "string",
          "description": "The URL of the main page of the Wikibase, such as 'https://www.wikidata.org/wiki/Wikidata:Main_Page'"
        },
        "api": {
          "type": "string",
          "description": "The MediaWiki API endpoint of the Wikibase, such as 'https://www.wikidata.org/w/api.php'"
        }
      },
      "required": ["name", "root", "main_page", "api"]
    },
    "wikibase": {
      "type": "object",
      "description": "The configurations of the Wikibase extension",
      "properties": {
        "site_iri": {
          "type": "string",
          "pattern": "^.*/$",
          "description": "The IRI of the Wikibase, such as 'http://www.wikidata.org/entity/'. This should match the IRI prefixes used in RDF serialization. Be careful about using 'http' or 'https', because any variation will break comparisons at various places. The trailing slash cannot be omitted"
        },
        "maxlag": {
          "type": "integer",
          "description": "The default maxlag of this Wikibase. For Wikidata, the default value is 5 (seconds)"
        },
        "tag": {
          "type": "string",
          "description": "The tag to apply to edits made to the Wikibase instance. If the ${version} string is included, it will be replaced by the major.minor version of OpenRefine used to make the edit"
        },
        "max_edits_per_minute": {
          "type": "integer",
          "description": "The maximum number of edits to do per minute, on this Wikibase instance. By default, 60."
        },
        "properties": {
          "type": "object",
          "properties": {
            "instance_of": {
              "type": "string",
              "description": "The 'instance of' qid of the Wikibase ('P31' for Wikidata)"
            },
            "subclass_of": {
              "type": "string",
              "description": "The 'subclass of' qid of the Wikibase ('P279' for Wikidata)"
            }
          },
          "required": ["instance_of", "subclass_of"]
        },
        "constraints": {
          "type": "object",
          "description": "Constraints related qids and pids, not required since the constraints extension may not be installed",
          "properties": {
            "property_constraint_pid": {
              "type": "string",
              "description": "The property constraint pid of the Wikibase ('P2302' for Wikidata)"
            }
          },
          "patternProperties": {
            "^.*$": {
              "type": "string",
              "description": "If a pid/qid is missing, constraint checks depending on it will be skipped"
            }
          },
          "required": ["property_constraint_pid"]
        }
      },
      "required": ["site_iri", "maxlag", "properties"]
    },
    "oauth": {
      "type": "object",
      "description": "The configurations of the OAuth extension. Not required. Configuring this if and only if the OAuth extension is installed",
      "properties": {
        "registration_page": {
          "type": "string",
          "description": "The url of the OAuth consumer registration page, 'https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose' for Wikidata"
        }
      },
      "required": ["registration_page"]
    },
    "entity_types": {
      "type": "object",
      "description": "The available entity types on this Wikibase, with particular settings for each of them. The keys of this object are strings such as 'item', 'property', 'mediainfo' or 'lexeme'",
      "patternProperties": {
        "^.*$": {
          "type": "object",
          "description": "The settings for the given entity type.",
          "properties": {
            "reconciliation_endpoint": {
              "type": "string",
              "pattern": "^.*\\${lang}.*$",
              "description": "The default reconciliation API endpoint of the Wikibase for this entity type, the endpoint should include the language variable '${lang}', such as 'https://wikidata.reconci.link/${lang}/api'"
            },
            "site_iri": {
              "type": "string",
              "description": "The RDF prefix in which URIs for entities of this type are minted. If entities of this type are edited locally, this should be the global site_iri of the Wikibase. If those entities are drawn from another Wikibase instance, it should be the site_iri of that instance."
            },
            "mediawiki_api": {
              "type": "string",
              "description": "The MediaWiki API endpoint of the Wikibase, such as 'https://www.wikidata.org/w/api.php'"
            }
          },
          "required": ["site_iri"]
        }
      }
    },
    "editgroups": {
      "type": "object",
      "description": "The configurations of the EditGroups service of the Wikibase",
      "properties": {
        "url_schema": {
          "type": "string",
          "pattern": "^.*\\${batch_id}.*$",
          "description": "The URL schema used in edits summary. This is used for EditGroups to extract the batch id from a batch of edits and for linking to the EditGroups page of the batch. The URL schema must contains the variable '${batch_id}', such as '([[:toollabs:editgroups/b/OR/${batch_id}|details]])' for Wikidata"
        },
      },
      "required": ["url_schema"]
    },
    "schema_templates": {
      "type": "array",
      "description": "A list of predefined schema templates to be offered to the user",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the template to be displayed to the user"
          },
          "schema": {
            "type": "object",
            "description": "The schema, potentially incomplete, to be loaded with this template"
          }
        },
        "required": ["name", "schema"]
      }
    },
    "hide_structured_fields_in_mediainfo": {
      "type": "boolean",
      "description": "Boolean set to true when the Wikibase instance supports file uploads but does not have structured data associated to them in the form of MediaInfo entities"
    }
  },
  "required": ["version", "mediawiki", "wikibase", "entity_types"]
};