Wikidata Code and Reference

For different scripts and tools…

Sample Quickstatements

Use QuickStatements batch tool to create one or many records in a batch vs. manually. See also QuickStatements reference.

NOTE: the machine-generated versions below use tabs, but | will work as a separator which causes fewer issues in text editors.

Researcher in Sociology or Political Science

Remove untrue statements, fill out any available IDs, and clear descriptive PREFIX: before creating. This batch was created for making researchers for the ARDA dataset project. For employer statement, fill in the blank with the employer’s wikidata ID + add employment type to the end of the statement. Use birth/death dates only for deceased individuals (my choice) and add sources to any statements as desired using ref URL S854.

CREATE
LAST|Len|""
LAST|Aen|""
LAST|Den|""
LAST|P31|Q5
MALE: LAST|P21|Q6581097
FEMALE: LAST|P21|Q6581072
SOCIOLOGIST: LAST|P106|Q2306091
SOCIOLOGIST OF RELIGION: LAST|P106|Q64481759
POLITICAL SCIENTIST: LAST|P106|Q1238570
THEOLOGIAN: LAST|P106|Q1234713
LC: LAST|P244|""
VIAF: LAST|P214|""
GND: LAST|P227|""
ISNI: LAST|P213|""

EMPLOYER: LAST|P108| |P39
employment types:
- full professor Q25339110
- associate professor Q9344260
- assistant professor Q5669847
- department head Q12318472
- dean Q723682
- research professor Q27177003
- (other) professor Q121594
- emeritus Q1240569

BIRTH: LAST|P569|+YYYY-00-00T00:00:00Z/9
DEATH: LAST|P570|+YYYY-00-00T00:00:00Z/9

REF URL: S854 ""

Research Institute/Center

CREATE
LAST|Len|""
LAST|Aen|""
LAST|Den|""
research institute: LAST|P31|Q31855
research center: LAST|P31|Q7315155
inception: LAST|P571|+YYYY-00-00T00:00:00Z/9|S854|""
field of work: LAST|P101|QXXX
parent org: LAST|P749|QXXXXX
official website: LAST|P856|""
named after: LAST|P138|QXXXX
  1. Need to add that it’s a subsidiary to its parent org’s page.
  2. Add major members’ affiliations to their records / create records for center directors, etc.

People: Identifiers

A collection of identifier properites which can be used for people:

LC: LAST|P244|""
VIAF: LAST|P214|""
GND: LAST|P227|""
ISNI: LAST|P213|""
ORCID: LAST|P496|""
GoodReads: LAST|P2963|""
LibraryThing: LAST|P7400|""
Poets.org: LAST|P5343|""
Poetry Foundation: LAST|P5341|""
Poetry Society of America: LAST|P5503|""
ISFDB: LAST|P1233|""
Tor Author: LAST|P5714|""
Fantastic Fiction: LAST|P5408|""
Encyclopedia of Science Fiction: LAST|P5357|""
IMDB ID: LAST|P345|""
Find a Grave: LAST|P535|""
Amazon author ID: LAST|P4862|""

Datasets: ARDA Model

The following below is a sample record for an ARDA dataset along with a template. Note, the ARDA datasets are created using scripts available at ARDA to wikidata (particularly json-to-quickstatements.py and the openrefine-template.txt).

Sample:

CREATE
LAST    Len "Gallup Poll of Catholics, 2005"
LAST    Den "dataset"
LAST    P31 Q1172284
LAST    P126    Q4810029
LAST    P50 Q12402498   P1545   "1"
LAST    P50 Q12390815   P1545   "2"
LAST    P50 Q5246218    P1545   "3"
LAST    P2093   "Mary L. Gautier"   P1545   "4"
LAST    P859    Q30264508
LAST    P953    "http://www.thearda.com/archive/files/descriptions/GALLUP05.asp"
LAST    P577    +2005-00-00T00:00:00Z/9

Structure:

CREATE
LAST    Len ""
LAST    Den "dataset"
LAST    P31 Q1172284
LAST    P126    Q4810029 # Maintained By
LAST    P50 Q12402498   P1545   "1" # author 1
LAST    P50 Q12390815   P1545   "2" # author 2
LAST    P50 Q5246218    P1545   "3" # author 3
LAST    P2093   "Mary L. Gautier"   P1545   "4" #author 4 (text string)
LAST    P859    Q30264508 #sponsor
LAST    P953    "http://www.thearda.com/archive/files/descriptions/GALLUP05.asp" #url
LAST    P577    +2005-00-00T00:00:00Z/9 #publication

Role-Playing Game Designer

Template for creating entries for RPG designers:

CREATE
LAST|Len|""
LAST|Aen|""
LAST|Den|""
LAST|P31|Q5
MALE: LAST|P21|Q6581097
FEMALE: LAST|P21|Q6581072
WRITER: LAST|P106|Q36180
ROLE-PLAYING GAME DESIGNER: LAST|P106|Q54845077
EDITOR: LAST|P106|Q1607826
OFFICIAL WEBSITE: LAST|P856|""
LC: LAST|P244|""
VIAF: LAST|P214|""
GND: LAST|P227|""
ISNI: LAST|P213|""
GOODREADS: LAST|P2963|""

RPG Publisher

Template for creating RPG publishers (note, review description):

CREATE
LAST|Len|""
LAST|Aen|""
LAST|Den|"role-playing game publishing company"
LAST|P31|Q2085381
INCEPTION: LAST|P571|+YYYY-00-00T00:00:00Z/9
DISSOLUTION: LAST|P576|+YYYY-00-00T00:00:00Z/9
OWNED BY: LAST|P127|
COUNTRY: LAST|P17
OFFICIAL WEBSITE: LAST|P856|""
LC: LAST|P244|""

Role-Playing Game

Template for creating RPGs, which are “role-playing game” or “tabletop role-playing game.”:

CREATE
LAST|Len|""
LAST|Aen|""
LAST|Den|""
TABLETOP ROLE-PLAYING GAME (PREFER): LAST|P31|Q1643932
ROLE-PLAYING GAME: LAST|P31|Q160738
STORYGAME: LAST|P31|Q16645768
AUTHOR: LAST|P50|
PUBLICATION DATE: LAST|P577|+YYYY-00-00T00:00:00Z/9
PUBLISHER: LAST|P123|
GAME MECHANICS LAST|P4151|
OFFICIAL WEBSITE: LAST|P856|""

Role-Playing Game Edition

Template for creating edition of RPG. Note, there’s a necessary second template for adding the edition to the parent. Obviously only use when dealing w/multiple editions. Hack for getting ISBNs formatted–gettextbooks.com can be helpful in displaying a format that Wikidata will accept!

CREATE
LAST|Len|""
LAST|Aen|""
LAST|Den|"edition of..."
LAST|P31|Q1643932
LAST|P31|Q3331189
EDITION OF: LAST|P629|
AUTHOR: LAST|P50|
PUBLICATION DATE: LAST|P577|+YYYY-00-00T00:00:00Z/9
PUBLISHER: LAST|P123|
ISBN-13: LAST|P212|""
ISBN-10: LAST|P957|""
GOODREADS BOOK ID: LAST|P2969|""
OCLC CONTROL #: LAST|P243|""

Adding edition to parent:

PARENT|P747|CHILD    

Journal Article

(given WikiCite work, hold off on this when not appropriate to something)

CREATE
LAST|Len|"Sharing Community Created Content in Support of Social Justice: The Dakota Access Pipeline LibGuide"
LAST|P31|Q13442814
LAST|P2093|"Sarah R. Kostelecky"
LAST|P1433|Q27727173
LAST|P577|+2018-00-00T00:00:00Z/9
LAST|P478|"6"
LAST|P433|"2"
LAST|P356|"10.7710/2162-3309.2234"

Note, the author is author name string vs. an actual author link. The link would be ideal. See creating people and the use of P1545 in multi-author ARDA dataset records.