Skip to main content
32 votes

Get Wikipedia URLs (sitelinks) in Wikidata SPARQL query

On 18. April 2016 the ticket "More efficient SPARQL queries for sitelinks" brought us a better way: schema:isPartOf. ?sitelink schema:about ?item . ?sitelink schema:inLanguage "en" . ?sitelink ...
robbi5's user avatar
  • 421
11 votes
Accepted

Is Wikidata up to date with Wikipedia?

The dependency is supposed to be the opposite, i.e. that Wikipedia should rely on data in Wikidata. This is however not fully implemented yet. If you look at the infobox on this cheese in French, all ...
Ainali's user avatar
  • 446
7 votes

Wikipedia table to JSON (or other machine-readable format)

The wikitextparser Python module has good support for converting tables into structured formats. Example: import wikitextparser as wtp import requests import json r = requests.get('http://en....
maxschlepzig's user avatar
5 votes

Is Wikidata up to date with Wikipedia?

Wikidata doesn't automatically use data from Wikipedia. Data from Wikipedia is uploaded to Wikidata by hand or using some more or less automated tools to do batch uploads but ultimately under control ...
Pere's user avatar
  • 381
5 votes
Accepted

ISO 3166-1 country codes in DBpedia

There is dbp:iso3166code, but it seems it's not set for a lot of countries.
svick's user avatar
  • 869
4 votes

Get season statistics for NFL players

Since the 2016 season is about to start I figure I'll update this to hopefully help some others that stumble upon this page. The best resource for getting free and comprehensive nfl statistics is the ...
BrutalSimplicity's user avatar
4 votes

ISO 3166-1 country codes in DBpedia

DBpedia The answer provided by @svick will probably be most useful one in the long run, but for the time being dbp:iso3166code is unusable. However, I noticed that (apparently) all the country pages ...
Bolo's user avatar
  • 258
4 votes
Accepted

Search in wikidata with specific Q code

In short, URIs are "things, not strings". The filtering condition should be: ?item = <http://www.wikidata.org/entity/Q6015113>, or ?item = wd:Q6015113, or ?item = URI("http://www.wikidata.org/...
Stanislav Kralin's user avatar
4 votes
Accepted

Limiting a SPARQL Query to Lastest Point in Time

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)} ...
Stanislav Kralin's user avatar
3 votes
Accepted

Wikipedia Article Category

I don't think it's possible to filter articles by topic with a single query in the API. However, you can use Wikidata to detect and filter politics, celebrities and so. You'll need to follow several ...
Pere's user avatar
  • 381
3 votes

wikidata: (when) will it be possible to query for wikipedia page links?

(When) will the following be possible: Search in their Phabricator. For a wikipedia page: get the list of all wikipedia links on that page with their respective wikidata IDs in a single query/...
Stanislav Kralin's user avatar
3 votes

Info based on page title?

From Wikidata API, you could access the data from Britney Spears entity using the wbgetentities endpoint: https://www.wikidata.org/w/api.php?action=wbgetentities&titles=Britney%20Spears&sites=...
maxlath's user avatar
  • 276
3 votes
Accepted

Wikipedia: How to activate email notification from watchlist?

I haven't tried the mail feature, but I think MediaWiki notifies you when somebody else edits the page. There is no reason to send you a mail when you edit the page yourself - you should already know ...
Pere's user avatar
  • 381
3 votes

How to get urls of entries in wikipedia list articles?

You might also use the SPARQL REST API to query wiki data. E.g. get a table of US citizens whose occupation is a subclass of scientist: PREFIX schema: <http://schema.org/> SELECT ?item ?...
aventurin's user avatar
  • 191
3 votes
Accepted

How to get urls of entries in wikipedia list articles?

You can use the links API property to get the titles of all the links on the page: https://en.wikipedia.org/w/api.php?action=query&format=jsonfm&titles=List_of_American_scientists&prop=...
NinjaBearMonkey's user avatar
3 votes

Mapping all Wikipedia URLs to Wikidata entity ids

You can also use the OpenRefine reconciliation API, which has an additional feature: it will resolve Wikipedia redirects for you. For instance, say you want to retrieve the Qid corresponding to the ...
pintoch's user avatar
  • 321
3 votes

How to get soccer players Wikipedia URL?

To get a long list of soccer players who where born TODAY, ordered by birthdate , youngest first, Go to http://dbpedia.org/sparql and enter this query into the big text box: PREFIX rdf: <http://...
knb's user avatar
  • 1,237
3 votes

Wikipedia table to JSON (or other machine-readable format)

Sometimes it pays off to look one step ahead, i.e. to check if the items and its properties represented by a Wikipedia table are also available in the Wikidata knowledge base. Depending on the data, ...
maxschlepzig's user avatar
3 votes
Accepted

Crosswalk between FIPS codes and Wikipedia articles about U.S. Census Places

Is this something that would be possible with Wikidata? Yes, this is possible: There are the FIPS 55-3 and FIPS 6-4 properties in Wikidata; Wikidata contains information about the so-called ...
Stanislav Kralin's user avatar
2 votes

Get season statistics for NFL players

Free historical data with a simple request: http://api.suredbits.com/nfl/v0/stats/jones/julio Docs: https://www.suredbits.com/api/nfl/stats/
Thomas McCabe's user avatar
2 votes

Mapping all Wikipedia URLs to Wikidata entity ids

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['...
Ash's user avatar
  • 121
2 votes
Accepted

Downloading wikipedia data from specific url

Copy/paste into spreadsheet tool? If you are doing it once, why get any more complicated? http://pastebin.com/raw/bKAFbReV Or, https://www.google.ch/search?q=wikipedia+table+to+csv
philshem's user avatar
  • 17.6k
2 votes

Download wikipedia dump and save in raw text form

There seems to be a CPAN package for perl called WikiText, which from its description will do what you are after. WikiText provides a parser for the WikiText markup language, and output modules ...
Marcus D's user avatar
  • 1,109
2 votes

Get section and page title from a list of articles in Wikipedia via API

It turns out I can get the section and then the pages/links for that section, in two separate queries like so: 1) Get the sections https://en.wikipedia.org/w/api.php?action=parse&format=json&...
atineoSE's user avatar
  • 215
2 votes

Info based on page title?

For bios, you can also use the Wikipedia Open Search API, which is more simple than Wikidata : https://en.wikipedia.org/w/api.php?action=opensearch&search=britney+spears&limit=10&...
Ettore Rizza's user avatar
2 votes
Accepted

Various Country Statistics

World Statistics provides the following links: World Bank UN ILO FAO UNICEF Software/services Gapminder Google Public Data Other sources The World Factbook. The World Factbook is in the public ...
Stanislav Kralin's user avatar
2 votes
Accepted

Wikidata - Search of human instance that doesn't break

I suppose the problem is not that you're not familiar with STRSTARTS, but rather performance. This page contains some introductory remarks. Search in multiple languages If you really want to search ...
Stanislav Kralin's user avatar
2 votes
Accepted

Wikimedia Commons API image by category

Yes, Wikimedia Commons exposes MediaWiki API. Basically, your query should be the following: https://commons.wikimedia.org/w/api.php ?action=query &list=categorymembers &cmtitle=Category:...
Stanislav Kralin's user avatar
2 votes

How to get specific wikipedia data?

For the later (categories, pages,...) I recommend using the various dumps that are available from the Wikidata project. The dumps are available at the Wikimedia dumps source. The RDF format is ...
SeDav's user avatar
  • 121

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