Behind the <P812: academic major> Property

altilunium1 pts0 comments

Behind the Property - by ctify_

Property"/> Property"/>

rtnF

SubscribeSign in

Behind the Property<br>Jun 08, 2026

Share

This morning, I stumbled upon this Wikidata error.

I wanted to fix it, but I did not know how.<br>I wish there were an "intelligent autocorrect" feature built into Wikidata that could suggest a quick fix for situations like this. Modern IDEs already have such features.

Anyway. So, I started thinking of several ways to solve the problem.<br>One of my proposed solutions was to do a quick “global survey of Wikidata-wide usage” of P812 (academic major). Generate a list of all possible "legal" values of P812, then sort them by frequency.<br>So, I crafted this SPARQL query.<br>SELECT ?major ?majorLabel (COUNT(*) AS ?count)<br>WHERE {<br>?item wdt:P812 ?major .

SERVICE wikibase:label {<br>bd:serviceParam wikibase:language "en,mul,[AUTO_LANGUAGE]" .<br>GROUP BY ?major ?majorLabel<br>ORDER BY DESC(?count)

Using that SPARQL query, I could generate this list.

https://altilunium.github.io/blog/P812-direct.html<br>Satisfactory?<br>No.<br>I felt something big was missing.

That query only counted direct statements.<br>person → P812 → English literature

I also needed to count the other case.<br>person → P69 → St John's College<br>└── qualifier: P812 = English literature

So, I crafted another SPARQL query.<br>SELECT ?major ?majorLabel (COUNT(*) AS ?count)<br>WHERE {<br>?item wdt:P812 ?major .<br>UNION<br>?item p:P69 ?educationStatement .<br>?educationStatement pq:P812 ?major .

SERVICE wikibase:label {<br>bd:serviceParam wikibase:language "en,mul,[AUTO_LANGUAGE]" .<br>GROUP BY ?major ?majorLabel<br>ORDER BY DESC(?count)

But the Wikidata Query Service failed to execute it due to an upstream request timeout.

So, I modified the SPARQL query so it could be executed in QLever.<br>PREFIX wd:<br>PREFIX wdt:<br>PREFIX p:<br>PREFIX pq:<br>PREFIX rdfs:

SELECT ?major ?majorLabel (COUNT(*) AS ?count)<br>WHERE {<br>?item wdt:P812 ?major .<br>UNION<br>?item p:P69 ?educationStatement .<br>?educationStatement pq:P812 ?major .

OPTIONAL {<br>?major rdfs:label ?majorLabel .<br>FILTER(LANG(?majorLabel) = "en")<br>GROUP BY ?major ?majorLabel<br>ORDER BY DESC(?count)

It worked.

https://qlever.dev/wikidata/bULKgU<br>Now, I can simply browse that list to see what kinds of "academic major" values are considered valid to enter into Wikidata.

Share

Discussion about this post<br>CommentsRestacks

TopLatestDiscussions

No posts

Ready for more?

Subscribe

© 2026 rtnF · Privacy ∙ Terms ∙ Collection notice<br>Start your SubstackGet the app<br>Substack is the home for great culture

This site requires JavaScript to run correctly. Please turn on JavaScript or unblock scripts

major p812 count majorlabel wikidata query

Related Articles