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
0
votes
0 answers

Force Wikidata Query Service to remove duplicate items

I am using Wikidata Query Service (which uses SPARQL) to retrieve some cities, but get duplicate items with different property values (even though these items pertain to the same city). It appears the error comes from some of the cities properties…
JAT86
  • 997
  • 12
  • 24
0
votes
1 answer

Selecting literal values from Wikidata federated query service using RDFLib

I'm trying to get external identifiers for an entity in Wikidata. Using the following query, I can get the literal values (_value) and optionally formatted URLs (value) for Q2409 on the Wikidata Query Service site. Load in Wikidata Query…
King Chung Huang
  • 5,026
  • 28
  • 24
0
votes
1 answer

How to get IMDb links of all films in a category page on Wikipedia?

I want to get the IMDb links of all films in a category page on Wikipedia, for example: https://en.wikipedia.org/wiki/Category:American_historical_films. I have heard of Wikidata Query Service and PetScan but honestly they are too complicated for me…
0
votes
1 answer

Jena Query Optimization

I am pretty new to sparql and apache Jena so please forgive my naiveness. I loaded wikidata dump (705G) using TDB2 loader and executed some query examples from Wikidata Query Service. Most of the queries take longer time in Jena compare to Wikidata…
0
votes
1 answer

SPARQL query that returns Wikidpedia labels from Wikidata itemLabel

I am new to SPARQL, Is it possible to write a query that returns Wikipedia box information for a corresponding item label from the Wikipedia box for the Arabic Language that appears at the bottom of the Wikidata item page? see the picture: Instead…
Mai
  • 121
  • 1
  • 10
0
votes
0 answers

Filter search in Wikidata API

I am trying to get filtered data from the Wikidata API, currently I can do a general search using this API, but now there have been specific cases where I have to filter this information, for example, I need to get a list of only authors to get the…
0
votes
0 answers

Limit Wikidata results to only one label where more are available

I Have the following SPARQL query for Wikidata: SELECT DISTINCT ?location ?place_eng ?admin_eng ?country_eng WHERE { { VALUES ?place { wd:Q23154 wd:Q19319 wd:Q2758 } OPTIONAL { ?place wdt:P625 ?location. } ?place wdt:P131 ?admin. …
theberzi
  • 2,142
  • 3
  • 20
  • 34
0
votes
0 answers

Wikidata SPARQL query-schema:last modified

Being an intern at a performing organization, an organization that imported its database in 2018, I am to update some of that data and add references to some of the properties that have been created in 2018. To do so, I need to make sure those…
0
votes
1 answer

How to query Wikidata using SPARQL for a specific property?

I'm using the Wikidata Query Service to try and get all instances within Wikidata that contain a UMLS CUI (Property P2892). I've tried doing SELECT ?item WHERE { ?item wd:P2892. } But am getting the error Query is malformed: Encountered " "." ".…
Sean
  • 2,890
  • 8
  • 36
  • 78
0
votes
0 answers

Timeout when retrieving results from Wikidata

This query for retrieving movie posters from Wikidata results in "Query timeout limit reached" errors on query.wikidata.org: #defaultView:ImageGrid SELECT ?item ?itemLabel ?pic ?fileTitle ?width ?height WHERE { ?item wdt:P31/wdt:P279* wd:Q11424 . …
Fugue
  • 416
  • 6
  • 20
0
votes
0 answers

How to exclude values from output in SPARQL query for Wikidata?

I'm trying to write a SPARQL query using Wikidata Query Service to retrieve all prime ministers of the Netherlands from 1970. However, I want to filter the output by checking if a prime minister worked for a university. If a minister worked for a…
0
votes
1 answer

Query works on wikidata query service but not on Apache Jena copy

The query below is the accepted answer for my question Getting only english property value. When used on the Wikidata Query service try it! it will show shortNames for countries like Australia -> AUS and Austria -> AUT as requeted. Running the same…
Wolfgang Fahl
  • 15,016
  • 11
  • 93
  • 186
0
votes
0 answers

Batch processing a list in Wikidata Query Service via command line (wdq)

I am trying to extract names and death dates of certain people from a list by querying Wikidata with the wdq command. I was hoping to achieve this with the following command on Bash Shell: while read line; do wdq 'SELECT * WHERE { ?person rdfs:label…
0
votes
0 answers

How to fetch data by giving page URL in Wikidata Query Service (SPARQL)

I am trying to get some lists of data from Wikipedia. So I am using Wikidata SPARQL query service. What I need to know is how can I fetch the data from the URL (Wikipedia page URL). Currently I am searching from name. Following is my query, SELECT…
H Athukorala
  • 739
  • 11
  • 32
0
votes
1 answer

SPARQL UNION does not yield the results of the second query

I'm trying to load all sovereign states together with some states with partially recognized sovereignty (Taiwan, Kosovo) in Wikidata's SPARQL endpoint query.wikidata.org. This is my SPARQL: SELECT ?item ?iso2 WHERE { { ?item wdt:P31…
Jonas Sourlier
  • 13,684
  • 16
  • 77
  • 148