wikidata

Wikidata LabelService does not behave as expected

て烟熏妆下的殇ゞ 提交于 2019-11-28 14:18:49
The following Wikidata query does not work as I would expect it: # WikiData SPARQL Query # # Wolfgang Fahl 2018-01-06 # # get father of queen victoria SELECT ?queenVictoria ?queenVictoriaLabel ?fatherProperty ?fatherPropertyLabel ?father ?fatherLabel WHERE { # # father # https://www.wikidata.org/wiki/Property:P42 # Queen Victoria # https://www.wikidata.org/wiki/Q9439 BIND (wdt:P22 AS ?fatherProperty). BIND (wd:Q9439 AS ?queenVictoria). ?queenVictoria ?fatherProperty ?father. SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } try it! The result is queenVictoria

SPARQL - Insert data from remote endpoint

不问归期 提交于 2019-11-28 11:33:22
问题 How can i query a remote endpoint (like endpoints of DBPedia or Wikidata) and insert resulting triples in a local graph? So far, i know that there are commands like INSERT, ADD, COPY etc. which can be used for such tasks. What i don't understand is how to address a remote endpoint while updating my local graph. Could someone provide a minimum example or the main steps? I'm using Apache Jena Fuseki v2 on Windows and this is my query so far: PREFIX wdt: <http://www.wikidata.org/prop/direct/>

Wikidata results sorted by something similar to a PageRank

主宰稳场 提交于 2019-11-27 23:51:10
In Wikidata ( Wikidata SPARQL endpoint ), is there a way to order the SPARQL query results with something like a PageRank? SELECT DISTINCT ?entity ?entityLabel WHERE { ?entity wdt:P31 wd:Q5. SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } LIMIT 100 OFFSET 0 Can we specify a field to order the results by and that field expresses that the entity at the top is more notable/important/recognizable that the following one and so on? It seems that PageRank does not make much sense in relation to Wikidata. Obviously, large classes and large aggregates will be leaders. Also, unlike

How to get only the most recent value from a Wikidata property?

风流意气都作罢 提交于 2019-11-27 08:38:33
问题 Suppose I want to get a list of every country (Q6256) and its most recently recorded Human Development Index (P1081) value. The Human Development Index property for the country contains a list of data points taken at different points in time, but I only care about the most recent data. This query will not work because it gets multiple results for each country (one for each Human Development Index data point): SELECT ?country ?countryLabel ?hdi_value ?hdi_date WHERE { ?country wdt:P31 wd:Q6256

Download Wikidata single entity - truthy

ぐ巨炮叔叔 提交于 2019-11-27 08:37:38
问题 I would like to download Wikidata for a single entity. I know I can achieve using the URL, for example: https://www.wikidata.org/wiki/Special:EntityData/Q42.rdf Will give me Wikidata for Douglas Adams in RDF format. But this data is fully, meaning complete with meta-data such as qualifiers and references. I am interested in primary data only. Actually I am working on RDF Reification, and for that I need some sample non-RDF data which I can test my program on (like truthy Wikidata). I do not

Retrieving data from blank nodes in Wikidata

放肆的年华 提交于 2019-11-27 08:25:10
问题 I am attempting to retrieve data about the lifespans of certain people. This is problematic in cases of people that have lived a while ago. The dataset for e.g. Pythagoras seems to have a so called "blank node" for date of birth (P569) . But this blank node references another node earliest date (P1319) which has data I could work with just fine. But for some reason I am not able to retrieve that node. My first try looked like this, but somehow that results in a completly empty result set:

Wikidata LabelService does not behave as expected

断了今生、忘了曾经 提交于 2019-11-27 08:19:55
问题 The following Wikidata query does not work as I would expect it: # WikiData SPARQL Query # # Wolfgang Fahl 2018-01-06 # # get father of queen victoria SELECT ?queenVictoria ?queenVictoriaLabel ?fatherProperty ?fatherPropertyLabel ?father ?fatherLabel WHERE { # # father # https://www.wikidata.org/wiki/Property:P42 # Queen Victoria # https://www.wikidata.org/wiki/Q9439 BIND (wdt:P22 AS ?fatherProperty). BIND (wd:Q9439 AS ?queenVictoria). ?queenVictoria ?fatherProperty ?father. SERVICE wikibase

wikidata get all properties with labels and values of an item

风流意气都作罢 提交于 2019-11-27 06:07:59
问题 My question is how I can extract all properties and there respective labels that are also rendered on the webpage from wikidata preferably over SPARQL. Take for example the Google entry on wikidata. For the property P414 (stock exchange) or P159 there are subproperties like P969 (located at street address). They actually show up once you query wbgetentities as qualifieres. The problem with wbgetentities is that the labels are missing. I get the desired output (e.g. wdt:P17 => country =>

Getting readable results from Wikidata

你说的曾经没有我的故事 提交于 2019-11-26 20:27:16
问题 Ok so I'm trying to get information from Wikidata about movies, take this movie for example: https://www.wikidata.org/wiki/Q24871 On the page the data is clearly displayed in a readable format, however when you trying to extract it via the API you get this: https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q24871 Here is a section from it: "P272": [ { "id": "q24871$4721C959-0FCF-49D4-9265-E4FAC217CB6E", "mainsnak": { "snaktype": "value", "property": "P272", "datatype": "wikibase

Some cities aren&#39;t instances of city or big city? Odd behaviour of Wikidata

守給你的承諾、 提交于 2019-11-26 07:50:49
问题 While examining the results of the official example query \"Continents, countries, regions and capitals\" (on https://query.wikidata.org/, limited to Germany for your convenience here: link), I noticed that some capitals of German federal states were missing. For example Wiesbaden as capital of Hesse. I noticed that Wiesbaden is an instance of big city , but not of city (see https://www.wikidata.org/wiki/Q1721), in contrast to some other cities. I was able to alleviate the problem by also