931 questions
1
vote
0
answers
36
views
Get the raw string of a numeric Wikidata value with SPARQL
For example the following query returns only the value "57" but I need to get the original raw value stored as string ("+57.000").
select ?value (str(?value) as ?strValue) ?amount ...
2
votes
1
answer
69
views
How to use wikiextractor to filter english wiki dump for specific categories?
I found this version from wikiextractor that contains the option for filtering categories with a .txt file: https://github.com/sandertan/wikiextractor/. This works perfectly for the Dutch wiki, I used ...
0
votes
0
answers
71
views
I'd like to filter names by initials on Wikidata Query Service
I'm trying to find individuals on the Wikidata Query Service, and I'd like to filter results from certain initials (e.g. if a family name starts with "B" and at least one given name with &...
0
votes
0
answers
41
views
Wikidata SPARQL request fails with : Headless value factory should not be asked for its namespace
I have a SPARQL request that extracts various data for geographic locations from Wikidata:
SELECT DISTINCT ?h ?hLabel ?type ?location ?parent ?north ?south ?east ?west ?area
WHERE
{
VALUES (?h) {(wd:...
0
votes
0
answers
46
views
How to map geoname ids to geoboundary shapeIDs?
I'm looking to map either wikidata ids or GeoName ids to geoBoundary shapeIDs for ADM1 and ADM2. I'm not sure if there is a straightforward way to do this.
For example, here is the GeoName entry for ...
2
votes
0
answers
73
views
Why does this query timeout while this similar one does not?
I wanted to know for each president, in what state were they born, so I wrote this Wikidata query:
SELECT * WHERE {
# P31 = instance of
# Q5 = human (excludes fictional characters)
?president ...
1
vote
1
answer
46
views
Extracting DOIs from WikiData entries via Wikidata Query Service
I'm having trouble consistently retrieving DOIs for WikiData entries for scientific articles via the query service.
As a minimal working example, the following will return the DOI for the entry ...
1
vote
0
answers
69
views
Multiple language labels in sparql query on wikidata
I want to query wikidata entities and their labels in multiple languages. But for some reason querying the labels is very inperformant.
My base query looks like this (find 3 life forms that have ...
0
votes
0
answers
51
views
GROUP_CONCAT not concatenating?
I am learning how to make SPARQL requests to Wikidata.
I am trying to get a list of countries that:
speak English
are located in UTC from -8 to +2
with latest GDP Per Capita
With aggregated lists of ...
2
votes
1
answer
111
views
Searchstring to WikiData entity ID
Question
How do I get from an animal name (tiger) to its WikiData entity id (Q19939) in a static website?
Context
I am writing a small static website (no backend, just html and vanilla javascript) ...
1
vote
1
answer
99
views
How do I properly paginate a Wikidata SPARQL query?
I'm trying to run the following query (retrieving all humans with a Wikipedia article) on query.wikidata.org:
SELECT ?page_title
WHERE {
?item wdt:P31 wd:Q5.
?article schema:about ?...
2
votes
1
answer
65
views
wikidata service not getting labels for some items
the following SPARQL request in https://query.wikidata.org/
# title: Get metal groups
SELECT DISTINCT ?h ?hLabel ?url
WHERE {
?h wdt:P31 wd:Q215380. # groups
FILTER NOT EXISTS {?h wdt:P2032 ?end}
...
0
votes
2
answers
89
views
SPARQL 1.1 alternative for SERVICE labeling with Wikidata Query Service with fallback
How does one get a SPARQL 1.1 alternative for SERVICE labeling with Wikidata Query Service (or another SPARQL endpoint with data from Wikidata) with fallback?
I am thinking about the alternative to ...
0
votes
1
answer
70
views
How to use query_wikidata() (function available in WikidataR package for R) with multiple QIDs to obtain some of their properties?
I am trying to make a wikidata query using WikidataR package for R. My query shoud have the following results :
for each item of a list of wikidata elements (such as Q124988842, Q125696676, Q130644039)...
1
vote
0
answers
37
views
How to query objects of an entity AND their labels in Wikidata
I want to retrieve all the related objects of an entity and their labels, but I'm struggling against how the label service and the distinction between statements and (actual) entities works in ...
