# Invalid 'expires' attribute with SERVICE Wikidata

**URL:** <https://community.stardog.com/t/invalid-expires-attribute-with-service-wikidata/2801>\
**Category:** Support\
**Created:** [November 20, 2020, 12:36pm UTC](https://community.stardog.com/t/invalid-expires-attribute-with-service-wikidata/2801 "2020-11-20T12:36:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mospring](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/mospring/32/825_2.png) [@mospring](https://community.stardog.com/u/mospring)\
**Post date:** [November 20, 2020, 12:36pm UTC](https://community.stardog.com/t/invalid-expires-attribute-with-service-wikidata/2801/1 "2020-11-20T12:36:06Z")

</div>

I am having the same problem as already described here:

> [@Federated query to wikidata returning http 400](https://community.stardog.com/t/federated-query-to-wikidata-returning-http-400/2399):
>
> 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] o…

while running a Wikidata Service query with Stardog that includes a property path.  
It seems to be a Httpclient issue and is fixable as described here:

> <https://github.com/eclipse-rdf4j/rdf4j/issues/1718>
>
> When using the SPARQLRepository to evaluate a query against the Wikidata query s…ervice, the log is filled with warnings of the following type:
> 
> \`\`\`
> \[main\] WARN org.apache.http.client.protocol.ResponseProcessCookies - Invalid cookie header: "Set-Cookie: WMF-Last-Access-Global=08-Dec-2019;Path=/;Domain=.wikidata.org;HttpOnly;secure;Expires=Thu, 09 Jan 2020 00:00:00 GMT". Invalid 'expires' attribute: Thu, 09 Jan 2020 00:00:00 GMT
> \`\`\`
> 
> An investigation has shown that this is due to the current (default) HTTP Client implementation which does not correctly parse the cookies. Further investigation has shown that users of the HTTP client are are advised to to explicitly use RFC 6265 compliant policies. 
> 
> This can be achieved using configuration.
> 
> See https://issues.apache.org/jira/browse/HTTPCLIENT-1763 and https://stackoverflow.com/questions/36473478/fixing-httpclient-warning-invalid-expires-attribute-using-fluent-api/40697322 for further details
> 
> The log can be seen by running a test like the following (with logs enabled):
> 
> \`\`\`
> @Test
> public void testWikidata() throws Exception {
> 
> 
> SPARQLRepository repo = new SPARQLRepository("https://query.wikidata.org/sparql");
> repo.init();
> 
> try (RepositoryConnection conn = repo.getConnection()) {
> 
> TupleQuery tq = conn.prepareTupleQuery("SELECT \* WHERE { ?s ?p ?o } LIMIT 10");
> try (TupleQueryResult tqr = tq.evaluate()) {
> while (tqr.hasNext()) {
> System.out.println(tqr.next());
> }
> }
> }
> repo.shutDown();
> }
> \`\`\`

It would be great to fix this bug in Stardog as well. I don't know how to run my query now. ☹

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [December 4, 2020, 12:36pm UTC](https://community.stardog.com/t/invalid-expires-attribute-with-service-wikidata/2801/2 "2020-12-04T12:36:08Z")

</div>

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