Federated query to wikidata returning http 400

It's only returning a warning but I'm trying to make a federated query to wikidata and it's returning 400 which Stardog doesn't seem to like.

WARN  2020-04-25 18:05:39,042 [stardog-user-3] org.apache.http.client.protocol.ResponseProcessCookies:processCookies(129): Invalid cookie header: "Set-Cookie: WMF-Last-Access=25-Apr-2020;Path=/;HttpOnly;secure;Expires=Wed, 27 May 2020 12:00:00 GMT". Invalid 'expires' attribute: Wed, 27 May 2020 12:00:00 GMT
WARN  2020-04-25 18:05:39,043 [stardog-user-3] org.apache.http.client.protocol.ResponseProcessCookies:processCookies(129): Invalid cookie header: "Set-Cookie: WMF-Last-Access-Global=25-Apr-2020;Path=/;Domain=.wikidata.org;HttpOnly;secure;Expires=Wed, 27 May 2020 12:00:00 GMT". Invalid 'expires' attribute: Wed, 27 May 2020 12:00:00 GMT
WARN  2020-04-25 18:05:39,045 [stardog-user-3] com.complexible.stardog.protocols.http.server.StardogUndertowErrorHandler:accept(61): Unexpected exception was handled by the server
com.complexible.stardog.plan.eval.operator.OperatorException: SERVICE evaluation returned HTTP response code 400
	at com.complexible.stardog.plan.eval.service.SPARQLService$SparqlServiceQuery.evaluateBatch(SPARQLService.java:125) ~[stardog-7.2.1.jar:?]
	at com.complexible.stardog.plan.eval.service.BatchingJoinArgServiceQuery.evaluate(BatchingJoinArgServiceQuery.java:59) ~[stardog-7.2.1.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.ServiceOperatorImpl.computeNext(ServiceOperatorImpl.java:97) ~[stardog-7.2.1.jar:?]

The query I'm sending is just an example query that I copied from the wikidata site that I grabbed to make sure I was querying something I know should return something. The query is

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>

select * where {  
    service <https://query.wikidata.org/sparql> {
     
        ?item wdt:P31/wdt:P279* wd:Q16917;
             wdt:P625 ?geo .
    }
}

It looks like the query Stardog is sending is

SELECT ?padolppj ?item ?geo 
WHERE {

  {
    <http://www.wikidata.org/entity/Q16917> (<http://www.wikidata.org/prop/direct/P279>)* ?padolppj    ?item <http://www.wikidata.org/prop/direct/P31> ?padolppj .     ?item <http://www.wikidata.org/prop/direct/P625> ?geo . 
  }
}

Which isn't a valid query. I'm not sure where the ?padolppj var is coming from. I think it's just and implicit var pulled from the property path but I don't recall it having worked with simple queries either but I'll give it another check. It's missing a '.' after the first ?item to make it a valid query.

...looks like I was able to make a simple query so maybe it was just the property path causing the problem. The following query worked

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>

select * where {  
    service <https://query.wikidata.org/sparql> {
         ?standard wdt:P1462 wd:Q37033 .
        OPTIONAL{ ?standard wdt:P856 ?website }
        SERVICE wikibase:label { bd:serviceParam wikibase:language "en" 
        }
    }
}

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.