Page MenuHomePhabricator

"Headless value factory should not be asked for its namespace" error on IF() + BOUND()
Closed, ResolvedPublic

Description

Since yesterday, I keep getting this error in various queries.

Sample query:

SELECT ?item ?host ?p1
{
	?item wdt:P31 wd:Q3917681
	OPTIONAL {?item wdt:P17 ?host }
	BIND(IF(!BOUND(?host), 0, 1) as ?p1)
}

try it!

The query for the riders and their horse list last updated on Sept 11 and fails now for the same reason.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Esc3300 updated the task description. (Show Details)
Smalyshev subscribed.

Wow never seen that one before. I guess we have a headless rider here... ;) Will investigate.

Also note that you can rewrite it as:

SELECT ?item ?host (bound(?host) as ?p1)
{
	?item wdt:P31 wd:Q3917681
	OPTIONAL {?item wdt:P17 ?host }
}

and that works.

Smalyshev triaged this task as Medium priority.Sep 16 2016, 11:34 PM
Smalyshev moved this task from Incoming to Blazegraph on the Wikidata-Query-Service board.
Smalyshev renamed this task from "Headless value factory should not be asked for its namespace" error ( Wikidata Query Service) to "Headless value factory should not be asked for its namespace" error on IF() + BOUND().Sep 16 2016, 11:36 PM

Thanks for the suggestion. Combining it with xsd gets me the same, e.g.

SELECT ?item ?host (xsd:integer(bound(?host)) as ?p1)
{
	?item wdt:P31 wd:Q3917681
	OPTIONAL {?item wdt:P17 ?host }
}

That worked for the list of embassies.

I saw the ticket at Blazegraph was updated. Has the fix already been deployed?

Also, the error message for the above query is now "Server error".

No, the fix is not there yet. I'll update the ticket when it is.

Another query with the same error message:

SELECT (COUNT(?x) AS ?c) WHERE {
  BIND(IF(true, 1, 0) AS ?x).
}

Link

Same bug, or should I file a new ticket?

Looks like the same issue. I'll verify them both when we get the fix.

Thanks! The riders and horse list is updating again:

(cur | prev) 09:38, 23 February 2017‎ ListeriaBot (talk | contribs)‎ m . . (79,170 bytes) (+11,441)‎ . . (Wikidata list updated) (undo)
(cur | prev) 23:19, 11 September 2016‎ ListeriaBot (talk | contribs)‎ m . . (67,719 bytes) (+14)‎ . . (Wikidata list updated) (undo)