Skip to content

Instantly share code, notes, and snippets.

@nside
Created December 27, 2022 16:09
Show Gist options
  • Save nside/4614dd6f2344ceed6e0d993c71e70a73 to your computer and use it in GitHub Desktop.
Save nside/4614dd6f2344ceed6e0d993c71e70a73 to your computer and use it in GitHub Desktop.
Wikipedia export schema in Protocol Buffer
syntax = "proto3";
package org.mediawiki.www.xml.export_0_3;
enum CaseType {
// Default
CASE_TYPE_UNSPECIFIED = 0;
CASE_TYPE_FIRST_LETTER = 1;
CASE_TYPE_CASE_SENSITIVE = 2;
CASE_TYPE_CASE_INSENSITIVE = 3;
}
message ContributorType {
string username = 1;
uint32 id = 2;
string ip = 3;
}
message MediaWikiType {
string version = 1;
string lang = 2;
SiteInfoType siteinfo = 3;
repeated PageType page = 4;
}
message NamespaceType {
int32 key = 1;
string value = 2;
}
message NamespacesType {
repeated NamespaceType namespace = 1;
}
message PageType {
string title = 1;
uint32 id = 2;
string restrictions = 3;
repeated ChoiceWrapper_PageType choice_wrapper = 4;
message ChoiceWrapper_PageType {
RevisionType revision = 1;
UploadType upload = 2;
}
}
message RevisionType {
uint32 id = 1;
uint64 timestamp = 2;
ContributorType contributor = 3;
string minor = 4;
string comment = 5;
TextType text = 6;
}
message SiteInfoType {
string sitename = 1;
string base = 2;
string generator = 3;
CaseType case_field = 4;
NamespacesType namespaces = 5;
}
enum SpaceType {
// Default
SPACE_TYPE_UNSPECIFIED = 0;
SPACE_TYPE_DEFAULT = 1;
SPACE_TYPE_PRESERVE = 2;
}
message TextType {
SpaceType space = 1;
string value = 2;
}
message UploadType {
uint64 timestamp = 1;
ContributorType contributor = 2;
string comment = 3;
string filename = 4;
string src = 5;
uint32 size = 6;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment