Unconventional and overkilled use of Wikidata: get a machine-readable list of Touhou games that maps release numbers to titles, for canonicalizing album metadata fields. In hindsight, my script was bloated and unnecessary. The whole thing could just be a simple SPARQL query.

Here it is. A refactored and proper #SPARQL query to #Wikidata for getting a machine-readable list of Touhou games that maps release numbers to titles, without the bloated and inefficient Python code in the last post. Runs in milliseconds instead of half a minute. Interactive query at https://query-main.wikidata.org

SELECT ?game ?thRelease ?titleJa ?titleEn ?titleZh ?titleZhHans WHERE { wd:Q907907 p:P527 [ ps:P527 ?game ; pq:P1545 ?thReleaseValue ] . BIND(CONCAT("TH", ?thReleaseValue) as ?thRelease) OPTIONAL { ?game rdfs:label ?titleJa FILTER(LANG(?titleJa) = "ja") } OPTIONAL { ?game rdfs:label ?titleEn FILTER(LANG(?titleEn) = "en") } OPTIONAL { ?game rdfs:label ?titleZh FILTER(LANG(?titleZh) = "zh") } OPTIONAL { ?game rdfs:label ?titleZhHans FILTER(LANG(?titleZhHans) = "zh-hans") } } ORDER BY xsd:float(?thReleaseValue)

Still working on my machine-readable #Touhou soundtrack database, so I can connect it to my music player in the future to remember soundtracks names that I still can't remember after listening for 10 years... #2hu
An obscure feature of #MediaWiki: common operations have public APIs callable by everyone without an account. For example,expandtemplates evaluates arbitrary wikitext. If the data you're looking for is already inside a template, it means it's a free machine-readable API. Example: Query the Japanese and English titles of the second soundtrack in #Touhou 6 Stage 5.
MediaWiki expandtemplates is super effective, over a thousand #Touhou soundtrack names queried in seconds without any special features on the wiki.
One more step closer to a working #Touhou soundtrack finder in the browser.
My #Touhou soundtrack finder Userscript is working now! ​​ After listening to these soundtracks for 10+ years, I'm finally able to tell the games, characters and locations associated with them (still need to tune the release priority, newer soundtrack versions are currently overrepresented).
@niconiconi Oh ones on bandcamp I'm not aware of, do you have a list somewhere? IIRC I looked at the touhou tag few times but only found ones I already knew.
@[email protected] Use this 3rd-party bandcamp search engine (source on GitHub), tag "touhou" and "chiptune". Works much better than the official search. https://campexplorer.io/
Camp Explorer