Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [wikidata]

Wikidata is a project of the Wikimedia foundation related to open data

1
vote
0answers
30 views

Wikidata - How to get codes without urls

Ive the following query, but I only want the country codes, not the entire link. This happens also with other fields and i cant find the solution PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> ...
0
votes
1answer
26 views

Wikidata - Filter or Detect or Get incomplete date

I've the following query PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?item ?itemLabel ?dod ?dob WHERE { ?item wdt:P570 ?dod. ?item wdt:P31 wd:Q5. SERVICE wikibase:label { bd:...
0
votes
0answers
21 views

How to access only the first item in a statement?

I am trying to collect a list of capitals of Japanese prefectures. However, some items have multiple images; my understanding is that such items in a statement are ordered, and the top one is the most ...
1
vote
1answer
50 views

What are Outlink categories of Wikipedia

I am wondering if it is possible to view outlink categories of a given article in Wikipedia? For example, consider the Wikipedia article about 'Data Mining'. What are the outlink categories of "Data ...
1
vote
1answer
21 views

Limiting a SPARQL Query to Lastest Point in Time

I'm trying to get information on Prefectures in Japan out of Wikidata. I succeeded to read the population statement, however there are occasionally several values with different point in time fields. ...
2
votes
2answers
45 views

How to get specific wikipedia data?

I only want to use the link structure and articles’ content of Wikipedia. Therefore, I want to downlaod the dump that contains only the following details. articles content link structure (i.e. re-...
1
vote
1answer
51 views

Get list of all wikidata properties used to link to an item

The first part of my question is, is there a SPARQL equivalent of the "What links here" link? E.g. as described at https://opendata.stackexchange.com/a/5271/20321 I tried: WHERE { ?item wdt:?...
5
votes
1answer
71 views

Wikidata: How to represent British Hong Kong's under Japanese occupation?

Between 1941 and 1945, British Hong Kong (then a colony) was occupied by the Japanese, see this Wikipedia article. However on British Hong Kong's Wikidata page, there's no mention of the Japaneses ...
1
vote
1answer
36 views

Wikidata on all Trump's executive orders

I'd like a wikidata query that returns all executive orders signed by President Trump. This query gets all executive orders: https://query.wikidata.org/#SELECT%20%3Forder%20%3ForderLabel%20WHERE%20%...
3
votes
1answer
48 views

Numerically order SPARQL results that are external identifiers but actually all numbers

I wrote this query to list Wikidata items that have an RFC identifier: SELECT ?rfcId ?itemLabel ?classLabel ?item WHERE { ?item wdt:P31 ?class. ?item wdt:P892 ?rfcId. SERVICE wikibase:label { ...
1
vote
0answers
24 views

Filter wikidata results with 'around' service

Is it possible to use the "around" service as a filter, for example to search for a place name in a country and limit results to those within a given distance of a known point. For example, limit ...
2
votes
1answer
50 views

How can I query Wikidata for a label and optional image without further constraints?

I made a derivation of the cats with images example where I query for a specific cat, in particular its label and a possible image (in the web interface): SELECT ?item ?itemLabel ?pic WHERE { ...
4
votes
1answer
58 views

Why does Wikidata's query interface return no results for entities with an id of Q10000001 or higher?

I have this SPARQL query to return an item's label and the url of a Wikipedia article: PREFIX schema: <http://schema.org/> PREFIX wd: <http://www.wikidata.org/entity/> SELECT ?article ?...
6
votes
1answer
68 views

Julian and Gregorian dates from Wikidata

How can I get the Julian birth or death date for someone who was born or died under the Julian Calendar (Isaac Newton, for example) on Wikidata using a SPARQL query? This simple query returns "4 ...
1
vote
1answer
40 views

Restrict returned claims in entity

Is there a way to restrict the returned claims on wikidata's REST API? For example I am using this query: https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q17714&props=claims&...
1
vote
1answer
55 views

How can I get data about Wikipedians (e.g. language proficiency), by username?

Is there an open dataset containing information such as username, language proficiency levels (https://en.m.wikipedia.org/wiki/Wikipedia:Babel/Levels) and (possibly) academic degrees and nationality ...
1
vote
1answer
30 views

Search in wikidata with specific Q code

I've this query but I can't understand why doesn't return any result. I try different versions (with link, with only code, with wd:code) but nothing seems to work. What I need is this query but ...
2
votes
2answers
86 views

Mapping between ImageNet and Wikidata entities

Wikidata and ImageNet both know oxcarts: https://www.wikidata.org/wiki/Q1190777 http://imagenet.stanford.edu/synset?wnid=n03868242 (slow) An AI library gives me the ImageNet "synset" about oxcarts. ...
2
votes
0answers
87 views

How to use DBpedia to identify the topics

In the paper "Discovering Relevant Topics using DBPedia providing non-obvious recommendations" they have used skos:broader property and dcterms:subject property. In my task given the word I want to ...
1
vote
1answer
98 views

Weird results in search from wikidata

I ve this query, which i want to find every instance of human with name Jose (already a first name like John, very common) in wikidata spanish, and then I get only 10 results. I believe is the way of ...
2
votes
1answer
118 views

Wikidata - Search of human instance that doesn't break

Is this possible, like the wikidata autocomplete combo works, in a speedy way, with a filter of "itemlabel strings start with..." ? PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?item ...
1
vote
1answer
75 views

WikiData - Specific country with flag and emojiflag by item ID

I need to query the WikiData to get for an specific country code (that I've, for the example is Q414 (ARG), the flag and the emoji flag respective. The emoji, by I know, is on zxx lang, but anyway any ...
4
votes
1answer
223 views

Is there any open dataset for named entity linking?

Entity linking is the task of detecting mentions of entities from a knowledge base in a document. Are there any openly available datasets to train and evaluate such systems? The datasets I came ...
2
votes
2answers
58 views

What are commonly used ontologies for spatial relations with terms like “delimit”?

Currently, on Wikidata there is an open proposal to have a projecty about delimit which is supposed to have the meaning of "Walls of Jerusalem delimit Old City of Jerusalem". For good ...
3
votes
1answer
34 views

Wikidata differs from Wikipedia

I am trying to retrieve data for a company programmatically using the Wikidata API. However, the data retrieved from Wikidata is different from en.wikipedia.org. Is this expected? Example: Nissan ...
2
votes
0answers
71 views

Property and sub-property pairs

Here are some example records: https://www.wikidata.org/wiki/Q11361734 https://www.wikidata.org/wiki/Q74669 I have the following (updated) query: # Script #2 SELECT (GROUP_CONCAT( ?...
1
vote
1answer
49 views

Find all Wikidata items that use a particular P18 picture

I want to find all Wikidata items that have "Gthumb.svg" as a P18 property. Leaving aside the fact that "Gthumb.svg" may not exist on Commons and that normal P18 values have a "commons:" prefix, it ...
3
votes
1answer
108 views

Most efficient way to get the Wikidata entity for a city, given as a string

The goal is to get from the string "Lugano", the entity Q7024, knowing that I am searching for Swiss locations, by name in German. So far this is how I do it but it doesn't look very efficient. 1) ...
5
votes
1answer
76 views

Sort results by proximity with the “around” service in Wikidata

With this query, I can get a list of German cities around Berlin, within a radius of 50 km. SELECT ?place ?placeLabel ?location WHERE { wd:Q64 wdt:P625 ?arcLoc . ?place wdt:P31 wd:Q515 . ?...
2
votes
1answer
138 views

Wikidata - How to get a table with all US cities with associated counties?

I did not find existing data of good quality that I can use directly. I thought that Wikidata was the best source to use and that it would be an opportunity to learn how to extract from this data ...
3
votes
3answers
194 views

wikidata extract

I have a list of wikidata entity IDs (i.e. Tour Eiffel Q243, Big Ben Q41225...), and a list of properties (i.e. coordinates P625, country P18 ...). Is there any way to gather and extract in Excel (or ...
5
votes
3answers
136 views

Icons set to represent Wikidata classes (hospital, park, waterfall, prison, school, etc)

I am looking for icons that can illustrate Wikidata classes such as: Q16917 hospital Q22698 park Q34038 waterfall Q40357 prison Q3914 school etc I could use each class' image property, but ...
8
votes
2answers
361 views

Wikidata get property of property

This question is related to this. We have the following query: SELECT DISTINCT ?item ?itemLabel ?AuthorLabel ?year WHERE { ?item wdt:P166 wd:Q255032. ?item wdt:P50 ?Author . ?item wdt:P577 ...
4
votes
2answers
88 views

Info based on page title?

I'm looking for a way to get info from wikipedia based on the page title. example: If i have a page called "Britney Spears" i want to be able to get a simple bio extracted from wikipedia onto the ...
4
votes
2answers
382 views

get item's properties know QID

Know QID I can get items's label: SELECT DISTINCT * WHERE { wd:Q302 rdfs:label ?label . FILTER (langMatches( lang(?label), "EN" ) ) SERVICE wikibase:label { bd:serviceParam wikibase:language "...
1
vote
1answer
76 views

get label (Name) instead QID field

Using the following query: SELECT ?item ?itemLabel ?itemDescription ?director WHERE { ?item wdt:P31 wd:Q11424 . ?item wdt:P161 wd:Q2263 . OPTIONAL{?item wdt:P57 ?director .} SERVICE wikibase:...
7
votes
2answers
154 views

Retrieve periodic table information from wikidata

I'm trying to retrieve some basic informations from chemical elements stored in wikidata to create an interactive periodic table. It's my first attempt to use wikidata, so I've understood how to get ...
5
votes
1answer
82 views

Publishing (structured?) data about products: information about products, barcodes, photos (incl. packaging)

Is it legal to publish photos of products and their packaging? Can such be done anonymously on some open license? (which would be the best for such data to be open for public use, as products are ...
3
votes
1answer
153 views

Wikidata: QueryTimeoutException: Query deadline is expired

I used to execute successfully the following query: SELECT (COUNT(?r) AS ?count) WHERE { [] <http://www.wikidata.org/prop/direct/P31> ?r } on http://wdqs-beta.wmflabs.org/bigdata/namespace/wdq/...
9
votes
2answers
293 views

Is Wikidata up to date with Wikipedia?

I think that DBpedia links to Wikipedia by Wikipedia database dump, making it not up to date with on-line Wikipedia contents. I was wondering if Wikidata uses on-line Wikipedia content or if it also ...
3
votes
0answers
35 views

Percentage of radio stations that are terrestrial stations versus Internet stations

What are the percentages of radio stations which provide: terrestrial radio station only Internet radio station both I am looking into this data by year and world country. Thank you for your ...
5
votes
1answer
140 views

Constructing a WordNet-like tree from the Wikidata dataset?

Is there an approach to constructing a semantic tree somewhat like WordNet, but using the vastly more structured and useful Wikidata data instead? How could this work? Could we place similar entities ...
2
votes
1answer
184 views

How to get the property name for a specific ID?

Wikidata entities have claims, inside which are property IDs with their snaks. But how do I get the name for a particular property ID?
2
votes
1answer
346 views

Get QID from Wikidata label name, via SPARQL

I use api.php to get the QID of something using its English label. Example: Mozambique → Q1029 $ wget --quiet -O - "http://www.wikidata.org/w/api.php?action=wbgetentities \ &sites=enwiki&...
5
votes
1answer
187 views

Wikidata label language: How to fallback to ANY language?

In Wikidata, this shows labels in English, and falls back to Russian if no English is available: SERVICE wikibase:label { bd:serviceParam wikibase:language "en, ru" . } QUESTION: How to fall back ...
2
votes
2answers
135 views

How to get all Wikidata items in a country?

Using SPARQL I want to show all French embassies in Liberia (spoiler: there is exactly one) So I wrote this naive query: SELECT ?item WHERE { ?item wdt:P17 wd:Q1014. # country: Liberia ?...
8
votes
2answers
1k views

How to include sub-classes in a Wikidata SPARQL query? (example: when querying “bands”, include “rock bands”)

Here is my naive query for bridges: SELECT ?item WHERE { ?item wdt:P31 wd:Q12280. # Item's type is: bridge } Problem: It only returns a small fraction of all bridges, because railway bridges (...
2
votes
2answers
416 views

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

I want to get the different sections with their pages from the Wikipedia:Featured articles. By following this answer, I know I can get page titles of links as follows: https://en.wikipedia.org/w/...
6
votes
2answers
188 views

How to get urls of entries in wikipedia list articles?

I am trying to retrieve the URL of all articles listed inside wikipedia list articles. For concreteness lets consider the wikimedia list article List_of_American_scientists I know how to use the wiki ...
1
vote
1answer
50 views

Downloading wikipedia data from specific url

I want to download data from https://en.wikipedia.org/wiki/List_of_districts_of_Germany I am rookie at this and can'T find any relevant articles. Most of them are on downloading full wikipedia. I ...