Dinhani Posted October 11 Share Posted October 11 It seems that only Arcade/MAME games have the Series field populated. I was expecting to find console games like Pokemon, Donkey Kong Country, Paper Mario and several other to have this field populated, but it is always empty. Is there a way to start populating this field for non-arcade games in the official metadata database? 1 Quote Link to comment Share on other sites More sharing options...
Dinhani Posted October 13 Author Share Posted October 13 (edited) With some Python scripting, I was able to populate other platforms series based on Wikipedia/Wikidata data. First I exported a CSV file with all available games and series from Wikidata with this SPARQL query. Then I wrote a script that gets the WikipediaURL field from games metadata and tries to match it with the Wikipedia URL in the Series CSV file. Based on the matches I populate the Series field. Now almost all games have the field populated. The query I used in case it goes offline on Wikidata: SELECT (?Game AS ?GameID) ?GameLabel ?GameLink (?Series AS ?SeriesID) ?SeriesLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . } ?Game wdt:P31 wd:Q7889 . OPTIONAL { ?GameLink schema:about ?Game . ?GameLink schema:inLanguage 'en' . ?GameLink schema:isPartOf <https://en.wikipedia.org/> . } ?Game wdt:P179 ?Series . } Edited October 13 by Dinhani 1 Quote Link to comment Share on other sites More sharing options...
Buccaneer Posted October 13 Share Posted October 13 Sounds nice. Is it possible that you upload your metadata files somewhere so I can import them with that: Quote Link to comment Share on other sites More sharing options...
GlauberC Posted October 14 Share Posted October 14 (edited) Wow, that's amazing! Would it be possible that you share the script you used. I don't really know anything about coding but I don't mind taking a look to see if I can get this to work Edited October 14 by GlauberC misspelling Quote Link to comment Share on other sites More sharing options...
AstroBob Posted October 15 Share Posted October 15 Nice job with the script there, that is a very cool idea! To clarify, the LaunchBox Games DB doesn't contain any series information (even for arcade). The series info you see for arcade is coming from MAME, as MAME has a built-in function that generates a giant text file filled with a ton of info about all the games they support and we generate that file from MAME and use it to populate all metadata fields. The reason we don't populate the LaunchBox games DB with series information is that it is incredibly subjective (some people prefer the main series, others want each individual sub-series, and some want them both). So right now we leave it up to the user to define. That said, we could certainly do a better job of offering some ways for users to grab this info, and arguably it is a bit confusing that we fill it in for arcade (albeit via MAME) but not others. But great job on the script there, I haven't had a chance to test it myself but seems like it could fill a good use-case 🙌 Quote Link to comment Share on other sites More sharing options...
Dinhani Posted October 15 Author Share Posted October 15 (edited) @GlauberC I attached in this post the script and data for you to use. You need to adjust the value on line 13 with the path to your LaunchBox installation. Please be careful because it will read and write all you imported games and it will clear the Series field from all games before updating. Make a backup of all your data before running it. launchbox-set-series-field.py Series.csv Edited October 15 by Dinhani 1 Quote Link to comment Share on other sites More sharing options...
GlauberC Posted October 16 Share Posted October 16 thanks!! i ran into a few problems regarding python and some syntax as well (I think that the problem was that I was using "\" insted of "/" in the path folder but I'm not sure) just in case someone have the same problem I did, make sure to get lxml and polars after installing python pip install lxml pip install polars (not 100% sure if that's actually needed because I'm not a programmer but it did work for me) Quote Link to comment Share on other sites More sharing options...
Dinhani Posted October 16 Author Share Posted October 16 @GlauberC Your instructions are correct, these two commands are necessary to install the dependencies to parse the CSV and XML files. For the path, you can use "/" as you mentioned, or in case of backslashes, you can use double backslask "\\" because single backslash have special meaning in programming languages. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.