About Thing 18
Purpose: Wikibase is the software that Wikidata is based on. Creating your own Wikibase or participating in another Wikibase will help answer the question of 'what do I do if the Wikidata platform matches my needs but I would like to design my own data model?' It will also help us appreciate all of the formatting and data modeling work put into Wikidata by different contributors over the years that makes it just work.
Learning Outcomes: Learn how to get started with your own Wikibase, basic data modeling in Wikibase, and how to make a SPARQL query on a non-Wikidata Wikibase.
Intended Audience: Intermediate
Prerequisites: Thing 4. Editing in Wikidata, and basic familiarity with Wikidata concepts such as adding new Items and adding properties to an existing Item.
Author: Jackie Rubashkin and Joe Cera, Berkeley Law Library
Expected Duration: 75-90 minutes (does not include the time between requesting access to an account and receiving access)
This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
Getting Started
Wikibase projects can be the perfect solution when the format and structure of Wikidata is right for your project but you need more control over the data model. The biggest hurdle to getting started used to be the technical challenges of hosting your own Wikibase but Wikimedia Deutschland has jumped this hurdle for you by hosting individual Wikibase instances on wikibase.cloud. Going through the process of creating your own Wikibase will help you understand Wikidata better and allow for greater control over the data model so you can move your own projects forward.
Activities
- Read Wikibase/What is Wikibase from the MediaWiki documentation.
- Read Which Wikibase Should I Choose? so you are aware of how the self-hosted versus cloud-hosted instances are different.
- Sign up for an account at wikibase.cloud. This is technically still in an open beta so it might take a couple of days to a couple of weeks before your account is approved and created.
- While you are waiting for your account approval, look at these Wikibase instances for inspiration. Not all of these are hosted at wikibase.cloud but all use Wikibase:
- Qichwabase for language data
- FactGrid and LexBib for research data
- Repository authorities at Berkeley Law
- Once your account for wikibase.cloud is approved:
- Read Creating a Wiki to get started. This entails some very basic operations like naming your Wikibase and creating the Admin User.
- Note: The name and URL can not be changed at this time but you can always delete your Wikibase and start another (URLs cannot be reused)
- Login to your admin portal at wikidata.cloud and create your first Wikibase
- Read Wikibase settings to change the admin settings for your Wikibase
- Go to your Wikibase settings and change "Registration Options" slider so that accounts must be requested. This will make it so you have control over who else is able to contribute.
- Read Creating a Wiki to get started. This entails some very basic operations like naming your Wikibase and creating the Admin User.
- Read Introduction to modeling data to start thinking about how you will model data in your own Wikibase. Note that this really comes down to your decision to have more properties or more items.
- Login to your Wikibase as the admin user (check your email for the temporary password).
Create Your First Item
- Click on "New Item" on the left sidebar, the resulting page should look very familiar to anyone who has created an item in Wikidata
- Add a label, a description, and an alias (if needed) for your first item
- Note: The next steps will make more sense if this item also exists in Wikidata
Create Your First Two Properties
- Formatter URL:
- Click on "New Property" on the left sidebar
- For "Label" add "formatter URL"
- For "Description" add "web page URL; URI template from which "$1" can be automatically replaced with the effective property value on items"
- "Data type" should be "String"
- Click the "Create" button
- Make a note of the property number of this item. If it is the first property you are creating, it will be P1
- Wikidata identifier:
- For "Label" add "wikidata QID" or some other reference that will connect this item with its entry in Wikidata
- The "Description" should be a short note about how this field is the corresponding Wikidata identifier for an item
- Choose "External Identifier" for the data type
- Click the "Create" button
- New properties can take minutes to a day to be visible in your Wikibase. Check the "All properties" link in the left sidebar to verify that your properties are available to use. While you are waiting, think about what other properties you might want to add to your data model. Also, do this:
- Go back to your admin console on wikibase.cloud
- Click on the gear icon to get into the settings of your Wikibase
- Click on the "Features" tab
- Delete the existing entries under the "Mapping Properties to Wikidata"
- Click on the "Add New Mapping" button and add the mapping from your Wikibase. The My Wikibase value will be P1 (or whatever property number your formatter URL has) and the Wikidata value will be P1630 (which is the formatter URL property number in Wikidata).
- Once the formatter URL and wikidata QID properties are available for use:
- Go to your wikidata QID property and click on "+ add statement"
- Type in "formatter URL" and use the value https://www.wikidata.org/wiki/$1
- Note: If you want to make use of this formatter URL for a non-wikidata source, the $1 is the variable and everything else is a constant. Other examples might be adding the formatter URL to an LCSH property which would use the value https://id.loc.gov/authorities/subjects/$1. Or, a VIAF property that contains a formatter URL property that would use the value http://viaf.org/viaf/$1. These all format the entry so adding the identifier value results in a fully resolvable URL.
- Go to the first item you added in your Wikibase
- Click on "+ add statement"
- Input the corresponding Qnumber from Wikidata for that item (by adding the property "wikidata QID" and the Wikidata item number).
- Wait for 10 minutes to a day and come back to appreciate that this Qnumber now creates an automatic link to the corresponding Wikidata entry.
- Now you can create any link to another identifier system using the same process, always using the formatter URL property and updating the value in that identifier's property in your Wikibase
Test Out Your Query Service
- Click on "Query Service" in the left sidebar
- Your SPARQL query should look something like this:
PREFIX [two or three letter invented prefix of your choosing for entities]:<[your wikibase URL]/entity/>
PREFIX [two or three letter invented prefix of your choosing for properties]:<[Your wikibase URL]/prop/direct/>
SELECT ?item ?itemLabel ?wdIdentifier WHERE {
?item [your two or three letter property prefix]:[the P number of your Wikidata property]
?wdIdentifier.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".}
}
- For a basic example for comparison, see this Query
Reflection
Look around your workspace and pick an object. Write down how you would model the data about that object in triple statements. Do any of those statements connect that object to another object around you? Can you imagine how a simple data model can quickly become a complex data model as you add different types of entities?
Consider sharing your thoughts in the Comments section at the bottom of the page.
Additional Resources
- Wikibase: configure, customize, and collaborate
Documentation on getting started from 2018, based on the Wikibase Suite but still useful. - Wikibase Cloud documentation
Contains links to information for newbies, from a Wikimedia mailing list email.
Claim Credit
Need a certificate of completion? Answer the questions below, submit them, and you’ll receive an email confirmation with a link to download your certificate.
Look around your workspace and pick an object. Write down how you would model the data about that object in triple statements. Do any of those statements connect that object to another object around you? Can you imagine how a simple data model can quickly become a complex data model as you add different types of entities?