Questions tagged [wikidata-query-service]

Wikidata Query Service (WDQS) is a SPARQL endpoint that allows to publicly access to Wikidata's database.

Wikidata Query Service (WDQS) is a SPARQL public endpoint that allows to access to Wikidata's database.

It is accessible via:

Further documentation:

160 questions
1
vote
3 answers

SPARQL query running too slow, when quering, sometimes timesout, is there a way to optimize the query?

My Wikidata Query Service query sometimes takes 35000 milliseconds or 35 seconds to complete. I'm not very adept at SPARQL. The query below does work (except it does duplicates sometimes). I'm wanting to get "famous people" by providing a birthday…
Travis
  • 1,674
  • 1
  • 9
  • 14
1
vote
0 answers

WikiData : using 'of' property in SPARQL

I am trying to find a path in WikiData from animal entities to the Animal entity (Q729). To do so, for some entites, the only way appears to be this (example from jellyfish): Using a SPARQL query, I would need in this example to go from the…
1
vote
0 answers

Wikidata COUNT(*) query times out

I have a straightforward query that counts how many humans have an English Wikipedia page. prefix schema: PREFIX wikibase: PREFIX wd: PREFIX wdt:…
abhinavkulkarni
  • 2,284
  • 4
  • 36
  • 54
1
vote
1 answer

SPARQL fetch French communes allongside their departement and region from wikidata

I'm trying to fetch French communes from Wikidata using SPARQL. I want to also retrieve the departement code and the region code of the commune. For now I have this query : SELECT ?inseeCode ?commune ?nom ?dateFinNom ?dateFinCodeInsee…
fabien-michel
  • 1,873
  • 19
  • 38
1
vote
1 answer

unnest queries in Wikidata with SPARQL

I am trying to get a table from Wikidata with businesses, their twitter handle and the country of the business. I am running the following query on https://query.wikidata.org/ SELECT * WHERE { # querying for records where "instance of" (P31) =…
Carbo
  • 906
  • 5
  • 23
1
vote
1 answer

Wikidata Query Service: how do I search by freebase

I am using the Wikidata Query Service (https://query.wikidata.org) to get details about freebase ids. I now have a list of freebase ids /m/0gqpg /m/0h0vk /m/0h3vhfb /m/0h4xw_ /m/0h52w /m/0hfp /m/0hhbr How should I modify the following code to…
黄言之
  • 11
  • 2
1
vote
1 answer

getting the label and description of wikidata item as well as specified properties labels and description

i am relatively new to sparql and i need to get the label/title of the wikidata item as well as other specified properties' label and description. my code gives me only the properties' label and description but i cannot get the label/title and…
1
vote
1 answer

Return one image (and sitelinks) per item?

I want to return a table where each row is a distinct toy item and there are columns for each toy's image and its sitelink count. Q: Is there a better way to do this than what I finally did below? Why did I have to move labeling and sitelinks to the…
lowndrul
  • 3,715
  • 7
  • 36
  • 54
1
vote
1 answer

Search for Q-ID (from Wikidata) with Twitter Username ID. (Python)

I have a list of verified Twitter User-IDs. data['screen_name'] = [MOFAJapan_en, serenawilliams, JeffBezos ....] data['twitter_ids'] = [303735625, 26589987, 15506669 ....] and I want to get their respective Q-IDs from Wikidata. For the above…
1
vote
1 answer

Why does Wikidata query "ignore" my OPTIONAL properties?

I am trying to gather information on castles, palaces and other types of grand houses in the Netherlands and have written the following Wikidata query, which includes several optional properties as the extent of the available information varies from…
OnceUponATime
  • 450
  • 4
  • 12
1
vote
0 answers

How do I get a Wikidata Query over EVERY item?

I want to do a Wikidata Query about every item, that has at least a certain number of sidelinks. I already know, how to do this for a specific Group of Items SELECT ?item ?itemLabel ?itemDescription ?sitelinks WHERE { ?item wdt:P31 wd:Q223557 . …
1
vote
0 answers

Wikidata limit query to specific property constraints

I'm trying to list video games along with the data size (P3575). I want to limit the results to only show those in megabytes (Q79735) as a property constraint of data size. Here is what I have now, which lists everything (mainly Megabytes,…
1
vote
1 answer

Get the complete info of a Wikidata item

I'm using the following query to get the info of a specific Wikidata item. For example, this one gets the info about the movie Titanic SELECT ?wd ?wdLabel ?ps ?ps_Label ?wdpqLabel ?pq_Label { VALUES (?film) {(wd:Q44578)} ?film ?p ?statement…
SuperFrog
  • 7,631
  • 9
  • 51
  • 81
1
vote
0 answers

Grouping qualifiers in the output of a Wikidata SPARQL query

I am building a Wikidata SPARQL query to retrieve details about specific people. When asking for their educational details (P69 - educatedAt)- I am not sure how to craft the query such that it will collate their degrees and majors in the case that…
Korimako
  • 359
  • 3
  • 13
1
vote
1 answer

Sparql query dates json results in the same format that in web portal

How to get the results related to dates from Sparql queries in wikidata in JSON through Python codes in the same format they appear when I query directly through the web? When I query in Wikidata Query Portal (Try it), some dates appear formatted…