921
questions
2
votes
1
answer
42
views
SPARQL Federated Queries to Wikidata from nobelprize times out
I'm trying to do a SPARQL federated query from nobelprize endpoint to Wikidata endpoint, but it returns a 502 Proxy Error.
The code:
SELECT * WHERE {
SERVICE <https://query.wikidata.org/sparql> {...
0
votes
0
answers
23
views
Display statement qualifiers with SPARQL request to wikibase
I am new to SPARQL and trying to use a query to obtain not just items and a statement, but also a qualifier that comes with that statement.
Here is the idea: entities in the wikibase are political ...
0
votes
0
answers
26
views
How do you control which location shows up on the wikidata query service map if there are multiple?
I want to create a map of artworks (all between 1250-1500 and in Florence) using Wikidata's query service. Currently, what I am doing is: VIEW QUERY HERE but this creates a new item for each location. ...
1
vote
2
answers
47
views
Selecting only the statement with the minimum date qualifier
I'm trying to write a query telling me the age upon which heads of state first took office. I'm having trouble isolating the position held statement with the earliest start time qualifier. I can't ...
0
votes
1
answer
23
views
Wikidata SPARQL: Get Property Value
I used the query builder to find all instances where property Q1902is available. A portion of the query returned by the builder is:
SELECT DISTINCT ?item ?statement0 WHERE {
?item p:P1902 ?...
0
votes
0
answers
28
views
Extracting Medical Condition as English Label from Wikidata
I'm trying to extract people named George who possibly have a medical condition. This is my query:
SELECT ?name ?name_label ?condition ?condition_name ?occupationLabel ?fullName
WHERE
{
SERVICE ...
0
votes
0
answers
43
views
Error during a wikidata update, Blazegraph not working
I followed the instructions at https://www.mediawiki.org/wiki/Wikibase/Docker to install wikibase docker. But when I run /runUpdate.sh inside wbdocker-wdqs-1 container, I get errors. I get exceptions ...
0
votes
1
answer
47
views
Collect triples from Wikidata using SPARQL
I would like to collect triples (subject, predict, object) from a Wikidata entity (e.g. Helen Keller). Currently, I have a query as below:
SELECT ?wd ?wdLabel ?ps_Label ?ps_Description WHERE {
...
0
votes
1
answer
27
views
SPARQL on Wikidata: Official languages of a country that aren't just regional languages
I want a SPARQL query to retrieve the official languages of a country, say for Afghanistan:
SELECT ?langCode ?itemLabel WHERE {
wd:Q889 wdt:P37 ?officialLanguage.
?officialLanguage rdfs:label ?...
1
vote
1
answer
45
views
Trouble retrieving specific data from Wikidata using SPARQL
I'm trying to retrieve specific data from Wikidata using SPARQL, but I'm encountering difficulties. Specifically, I'm attempting to extract the runway length for a particular airport entity (Q29863) ...
0
votes
0
answers
24
views
Understanding Entity Roles and Admissible Values in Wikidata Triples via SPARQL
I am currently working with Wikidata and utilizing SPARQL queries to extract information. I'm interested in understanding the roles of entities within triples and the admissible values for certain ...
0
votes
0
answers
41
views
How to Determine Subject-Object Placement in SPARQL Triples?
I'm currently working on a project involving LLMs and SPARQL queries, particularly focusing on prompting LLMs to translate natural language questions into SPARQL queries. However, the model encounters ...
0
votes
2
answers
87
views
Python - SPARQWrapper returns me a XML file when I request a CSV file. Need help converting the data into an SQL table [duplicate]
I wrote this code to get names of all gen 1 pokemon from Wikidata, which I then want to turn into a SQL table.
```python
sparql = SPARQLWrapper("https://query.wikidata.org/sparql")
sparql....
1
vote
1
answer
82
views
Get Wikipedia page ID instead of Wikilink after reconciliation with Wikidata in Open Refine
I know how to download Wikipedia Sitelinks in Open Refine after reconciliation with Wikidata.
I use "Add column from reconciled column ... " and use "SPARQL: Senwiki" as property ...
0
votes
0
answers
30
views
Cannot find Q60 New York City with a Wikidata query
The following query:
SELECT ?item WHERE { ?item wdt:P31 wd:Q515 . FILTER(?item = wd:Q62) } LIMIT 10
outputs Q62 (San Francisco) as expected but this query
SELECT ?item WHERE { ?item wdt:P31 wd:Q515 . ...
1
vote
1
answer
30
views
SPARQL request on qualifiers?
I saw the following SPARQL query successfully requesting Publication date (P577) qualifiers (link) :
SELECT ?title ?item ?date ?place ?placeLabel WHERE {
SERVICE wikibase:label { bd:serviceParam ...
1
vote
1
answer
98
views
Get Wikipedia page ID from WikiData ID
I want to get Wikipedia page ID from Wikidata ID from Wikidata Query Service in a single SPARQL query.
First SPARQL query to get Wikidata ID (wd:Q3131) from title page: "Alpes-de-Haute-Provence&...
0
votes
0
answers
55
views
Retrieve Units for Values of PropertyType Quantity in QLever Wikidata Query
I'm encountering an issue while attempting to retrieve the units associated with values of propertyType Quantity in QLever Wikidata Query. In my query, I've attempted to include the units for ...
0
votes
0
answers
53
views
Merging results of two different qualifier queries in SPARQL
I can't come up with the right way to describe my problem, so I'll just show it. I want to find towns (aka seats) in two subsidiary regions (subprovinces aka sancaks and districts aka kazas) of each ...
0
votes
0
answers
48
views
Query for all locations with latitude and longitude?
I'm trying to get a data dump of every Wikipedia ID that has an associated latitude and longitude. The end goal is to be able to quickly match a list of a Wikipedia ID's mined from an NER task for a ...
1
vote
0
answers
85
views
construct a Wikidata SPARQL query to get a person's data by their Wikipedia URL
how to construct a Wikidata SPARQL query to get a person's(single) data by their Wikipedia URL
I'm new to SPARQL and Wikidata, I tried this, but it takes a long time and returns no results:
SELECT ...
1
vote
0
answers
43
views
Problems with multi-filter wikidata sparql query not seeming to work properly
I'm trying to generate a list of former counties and county equivalents in the United States, but the query isn't returning what I would otherwise expect.
My test case is Illinois County, Virginia.
My ...
2
votes
1
answer
41
views
SPARQL not showing a part of results with Image grid view
I created a query to find female artists based on some conditions, and wanted to include pictures to the result of the query so that #defaultView: ImageGrid view shows not only the required data, but ...
1
vote
0
answers
76
views
Wikidata SPARQL is using BIND instead of FILTER
I used Wikidata's query generator to get a list of people born on 18th May 1958. The query is reproduced below.
SELECT DISTINCT ?item ?itemLabel WHERE {
SERVICE wikibase:label { bd:serviceParam ...
1
vote
1
answer
38
views
Fetching wikidata properties from an entity discovered by property value
I'm attempting to find location data by the url of an entity. This query returns zero results, but if I replace the P856 clause with ?item wdt:* wd:Q48340 . it works just fine.
SELECT ?item ?...
4
votes
1
answer
59
views
Pull Wikidata companies with English websites
I'm trying to query businesses that have LinkedIn identifiers, ISINS, LEIs, or English websites. I only want one row of data per company if possible.
I'm struggling with the last part. I think I ...
2
votes
1
answer
101
views
How do you count the entities of a type that share values in Wikidata or subparts of Wikidata?
I want to see how many entities in a selection share a property value with other entities. For example, how many paintings share the same 'depict' property value (P180)?
My attempts with the following ...
1
vote
1
answer
115
views
sparql wikidata - how to only show statements without any references
I am trying to gather all statements for a specific topic (let's say Václav Havel - Q36233) but I need to exclude all statements that include any reference.
SELECT ?subjectLabel ?property ?object ?...
1
vote
0
answers
70
views
How to query wikidata for the number of taxonomic entities that have a wikipedia page?
I am trying to find out how many biological taxonomic entities have an article on wikipedia, across all languages.
I am able to get the number of entities in wikidata, but many of these don't have an ...
0
votes
1
answer
95
views
How to specify a unit with Quickstatements in Wikidata
I want to add the type of unit for a property (centimeters) like width [1]
using Quickstatements [2].
In the UI it is pretty easy and visible like:
Adding a statement with additional qualifier[3] ...
2
votes
1
answer
42
views
Are these label concats/merges possible to do efficiently in Sparql?
Starting with the example shown in https://stackoverflow.com/a/57856942/841830 I then grouped them to only have one row per country. (It is 208 results in 21600ms; the original was 53,546 results in ...
1
vote
1
answer
99
views
Query Wikidata to get all properties that are subclasses of entity (all types of images associated with an entity)
My goal is to get all images related to a wikidata entity. I can get the image property (of e.g. the statue of liberty) with the following query:
SELECT ?image WHERE
{
wd:Q9202 wdt:P18 ?image.
}
...
0
votes
0
answers
42
views
How to query Wikidata using labels in a specific language + other filtering criteria?
My goal is to query Wikidata and obtain a list of living persons whose label contains a specific string.
For instance, with this code I searched for Silvio Berlusconi and obtained as a result Pier ...
2
votes
0
answers
67
views
How can I search for a person who goes by a pseudonym in Wikidata SPARQL?
So I have the following wikidata SPARQL that will grab basic biographical information on a person. If I provide it a pseudonym such as (Madonna, Cher, Beyonce) it will timeout on me every time. Of ...
1
vote
0
answers
62
views
SPARQL query with UNION outputs available and missing values for the same entities - How to output only the available values?
this query outputs twins. For this it combines the following sets of items using UNION:
entities that are instances of the "twin" class
entities that have a biological sibling born on the ...
1
vote
0
answers
74
views
How to manage uris like <http://www.wikidata.org/.well-known/genid/d50f382e536becbbbc0987cd91bf1287> in wikidata
When I run the following query on WDQS
select distinct ?creator
where
{
?s wdt:P31 wd:Q3305213; wdt:P170 ?creator .
}
LIMIT 100 OFFSET 100000
I get a lot of uris like
http://www.wikidata.org/.well-...
1
vote
1
answer
117
views
Wikidata SPARQL cannot give me birthdates for January 1
All I'm doing is I want to use wikiservice sparql to get famous people by birthdate. Every other day in the year works, except January 1. When I researched this, I found out it had something to do ...
0
votes
0
answers
32
views
Trouble filtering out all former muncipality's in the Netherlands that have an end time
I am currently doing an exercise in which i am asked the following question:
"Return the name of all Dutch municipalities and its number of inhabitants ordered by the number of inhabitants"
...
0
votes
0
answers
31
views
BIND not working - suspected problem with query engine
I have a long query but the relevant parts are shown here:
SELECT DISTINCT ... (concat(?height_statue_in_meters, ' m (', ?height_statue_in_feet, ' ft)') AS ?height_of_statue) (concat(?...
2
votes
1
answer
120
views
Search Item in Wikidata SPARQL by Title ignoring special characters, like regular search
I want to find a movie by a title regardless special characters that wiki has in it.
For example I am searching for "Guyver Dark Hero" movie.
Wiki has it under the title "Guyver: Dark ...
0
votes
0
answers
167
views
Entity Linking with Wikipedia and Wikidata on spaCy v3.7
I'm planning to perform custom training with spaCy for entity linking using Wikidata. Could you provide guidance on creating a KnowledgeBase, especially since the latest spaCy version needs ...
1
vote
0
answers
42
views
Why is this query not working when put into a larger query?
Query 1 shows that the chemical element "americium" was named after "Americas" which was named after "Amerigo Vespucci".
Query 2 shows chemical elements with some ...
0
votes
1
answer
45
views
SPARQL query mixes up different statement nodes for Q-item
Edit: Please read the comments to this post - the post itself is answered.
The relevant part of my query (retrieving Nobel Prize winners who, at the time of winning, were head of state or head of ...
2
votes
1
answer
43
views
Unable to get label querying Wikidata SPARQL endpoint
I'm trying to query the Wikidata SPARQL endpoint through a Python script. I'm successfully getting the QID of the entities but I'm unable to get the label.
PREFIX rdfs: <http://www.w3.org/2000/01/...
0
votes
0
answers
72
views
Query Takes 5 Hours on First Run After Docker Restart
I'm using GraphDB version 10.2.0.
I am encountering a performance issue with GraphDB that I hope you can help me with. Here's the situation:
Problem Description:
When I initially run a specific query ...
0
votes
0
answers
42
views
SPARQL query to match the entity type from two ttl files
I have a ttl file from Yago, and ttl file contains NER from DBpedia
Examples
Yago ttl files
<Jungle_Lord> rdf:type <wordnet_oeuvre_103841417> .
<Jungle_Lord> rdf:type <...
0
votes
0
answers
75
views
Parsing Wikipedia / Wikidata: how to get the current country based on city?
I'm parsing wikidata/wikipedia and i'm currently writing a function like get_country_by_city( $wikidata_id ).
The problem: when eg. passing Q64 (Berlin), i'm getting 10 country instances and i want to ...
0
votes
1
answer
51
views
Sparql query to match unique item identifier from wikidata
I'm trying to get properties value for a given wikidita item from the identifier unique identifier (e.g. wd:Q200639).
Let's say I want Paul Valéry's birth date (https://www.wikidata.org/wiki/Q200639). ...
0
votes
0
answers
33
views
how to create sub schema of wiki data using wDumper for different time frame
I want to use WDumper to get sub-schema, however the sub-schema needs to be version or year specific. For instance, I need disease sub-schema of Wikidata for each of the following years: 2016, 2017, ...
0
votes
0
answers
25
views
sparql wikidata question : how to get several labels?
I want to get the xLabel and the nodeLabel at the same time...
SELECT ?x ?xLabel ?dn ?dd ?de ?df ?nodetext
WHERE {
?x p:P39 ?node.
?node ps:P39 wd:Q70495953. #on sélectionne les éléments qui sont ...