Closed daveliepmann closed 7 years ago
For me stringify-query
returns:
(mundaneum.query/stringify-query
'[:select :distinct ?pLabel
:where [[?p (wdt :award-received) / (wdt :subclass-of) * (entity "Nobel Prize")
_ (wdt :award-received) / (wdt :subclass-of) * (entity "Academy Awards")]]])
=> "SELECT DISTINCT ?pLabel \nWHERE {\n ?p wdt:P166 / wdt:P279 * wd:Q7191 ; wdt:P166 / wdt:P279 * wd:Q19020 .\n SERVICE wikibase:label { bd:serviceParam wikibase:language \"en,de,fr,es,it,ca,nl\" . }\n}"
... but the query itself returns []
. I imagine this represents a data change on their end. Will investigate.
Talk page of P166 suggests that it's due to change from subclass-of
to instance-of
; testing confirms it. Note substitution of "instance" for "subclass":
(query
'[:select :distinct ?pLabel
:where [[?p (wdt :award-received) / (wdt :instance-of) * (entity "Nobel Prize")
_ (wdt :award-received) / (wdt :instance-of) * (entity "Academy Awards")]]])
=> [{:pLabel "Bob Dylan"} {:pLabel "George Bernard Shaw"}]
I don't understand why it works for you.
The query returns []
for me too! The change to :instance-of
happened after I wrote this demo code. :)
Oops, conflated the "fragile af" stringify-query
difference with the return values
From core.clj line 57:
stringify-query
of that returns""
.