The Stack Overflow podcast is back! Listen to an interview with our new CEO.
4

SELECT ?itemLabel ?population ?date { ?item wdt:P31 wd:Q50337; p:P1082 [pq:P585 ?date; ps:P1082 ?population] FILTER NOT EXISTS {?item p:P1082 [pq:P585 ?date_] FILTER (?date_ > ?date)} SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } Try it If you really need GROUP BY: SELECT ?itemLabel ?date ?population { { SELECT ?item ...


2

Data dumps are at https://dumps.wikimedia.org/enwiki/20181201/ (currently). Article content (source code) is in the pages-articles files (e.g. enwiki-20181201-pages-articles.xml.bz2 is all pages in a single file, enwiki-20181201-pages-articles1.xml-p10p30302.bz2 is page IDs 10 to 30302, enwiki-20181201-pages-articles-multistream.xml.bz2 is a single file with ...


2

For the later (categories, pages,...) I recomend using the various dumps that are available from the Wikidata project. The dumps are available at the wikimedia dumps source The RDF format is described pretty well in the Wikidata RDF dump description Use the Wikidata Toolkit to process it and get the specific information you want. Or import it into a triple ...


2

Just get the list of linked articles, get the categories for each and sum up. If you want to do it with the official API in a single request (well, single sequence of requests because the data will be too large for one response so you'll have to use query continuation, it would look like this: https://en.wikipedia.org/w/api.php?action=query&format=json&...


1

The query service does not know that your variable ?article means that you want a Wikipedia article. You have to also ask for it in the actual query. One way to do that is to add these lines in the query: ?article schema:about ?place. FILTER REGEX(STR(?article), ".wikipedia.org/wiki/") . The first line queries for all the the sitelinks that the item have. ...


1

Ask your lawyer. (Or don't, depending on how serious your project is. No one is going to sue you about a hobby web page showing some logos.) Most logos are copyrighted and the owner has not given permission for such use, but depending on what jurisdiction you operate in, there might be exceptions such as fair use that allow you to use them without permission....


1

I've spent the last year or so working on a simple CLI tool to easily create your own NFL databases. It currently supports PostgreSql and Mongo natively, and you can programmatically interact with the Engine if you'd like to extend it. Want to create your own different database (eg MySql) using the Engine? Simply implement an interface and the Engine will ...


1

First, download wikidata json dumps from https://www.wikidata.org/wiki/Wikidata:Database_download . Then start reading the json file e.g. using Python's json library and for each entity, find entity['sitelinks']['enwiki']['value'] which gives you the page title. Then replace space with _ and concatenate it to wikipedia.org/wiki/... Now you have the ...


1

I created a Python package and command line tool to deal with the issue called wikimapper. It can be installed via pip install wikimapper. It uses the Wikipedia SQL dumps to create an index that then can be used to map many times very fast (much faster than the Wikidata SPARQL endpoint). You could either use one of my precomputed indices and use this sqlite3 ...


Only top voted, non community-wiki answers of a minimum length are eligible