0

Note: Before anyone marks this as duplicate to How to query Wikidata for "also known as", no actual working answer was given there.

The question I have is similar to that thread: How do I get matching entities from "also known as" using a query (without getting time-out errors)? I have a working solution to match the "also known as" column for properties, but I cannot get it to work for all entities. This is that query:

    SELECT DISTINCT ?property
    WHERE {
        ?property a wikibase:Property .
        ?property skos:altLabel ?altLabel . 
        FILTER (CONTAINS(?altLabel, "<ALSOKNOWNAS>"@en))
        SERVICE wikibase:label { bd:serviceParam wikibase:language "en" .}
    }

The < ALSOKNOWNAS > indicates where a label is inserted from my script. As an example, when placing the word "invented" in the query, the query returns the page P61 for "discoverer or inventor".

Removing the first line of the WHERE statement does not work. I'm not very proficient in WIkidata query, but I hope someone can help me.

Hylke
  • 171
  • 2
  • 17
  • Could you explain how this question is different than the one you refer to? And what query did you try for entities? What works and what doesn't work – I mean, what do you see when you say it doesn't work? – Ben Companjen May 18 '20 at 13:36
  • @BenCompanjen my question is actually almost the same as one I refered to, but that one is not answered. I thought it would be better to open up a new thread rather than try to revive a 2 year old one. What I figured would work for entities is the same query with the first line (?property a wikibase:Property .) removed. This however gives a timeout error. That is what one used in the old thread mentioned would happen, but he did not give a solution. – Hylke May 18 '20 at 13:44
  • Thanks. I think (but it's been a while since I actively participated here) that it is better to revive the old question, especially if the answer is expected to be the same. You could ask for further clarification of any given answers if necessary. has some info on query time-out workarounds. – Ben Companjen May 18 '20 at 13:56
  • https://w.wiki/RBY – Stanislav Kralin May 18 '20 at 19:39

0 Answers0