Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"smart" formatting yields a "cannot open the connection" error #3

Closed
bearloga opened this issue Apr 28, 2017 · 0 comments
Closed

"smart" formatting yields a "cannot open the connection" error #3

bearloga opened this issue Apr 28, 2017 · 0 comments
Assignees
Labels
bug

Comments

@bearloga
Copy link
Member

@bearloga bearloga commented Apr 28, 2017

Running in format = "simple" mode, we get the following:

sparql_query <- "SELECT DISTINCT
  ?softwareVersion ?publicationDate
WHERE {
  BIND(wd:Q206904 AS ?R)
  ?R p:P348 [
  ps:P348 ?softwareVersion;
  pq:P577 ?publicationDate
  ] .
}"

str(results <- WikidataQueryServiceR::query_wikidata(sparql_query))
'data.frame':	21 obs. of  2 variables:
 $ softwareVersion: chr  "3.3.3" "3.1.0" "3.1.2" "3.2.5" ...
 $ publicationDate: chr  "2017-03-06T00:00:00Z" "2014-04-10T00:00:00Z" "2014-10-31T00:00:00Z" "2016-04-14T00:00:00Z" ...

Using the format = "smart" mode, we'd be able to get a data.frame with publicationDate formatted to POSIXlt:

results <- WikidataQueryServiceR::query_wikidata(sparql_query, format = "smart")

But we get an error instead:

Error in open.connection(con, "rb") : cannot open the connection
In addition: Warning message:
In open.connection(con, "rb") : cannot open file '{
  "head" : {
    "vars" : [ "softwareVersion", "publicationDate" ]
  },
  "results" : {
    "bindings" : [ {
      "softwareVersion" : {
        "type" : "literal",
        "value" : "3.3.3"
      },
      "publicationDate" : {
        "datatype" : "http://www.w3.org/2001/XMLSchema#dateTime",
        "type" : "literal",
        "value" : "2017-03-06T00:00:00Z"
      }
@bearloga bearloga added the bug label Apr 28, 2017
@bearloga bearloga self-assigned this Apr 28, 2017
@bearloga bearloga closed this in 3530cef Apr 28, 2017
bearloga added a commit to bearloga/wmf that referenced this issue Apr 28, 2017
With wikimedia/WikidataQueryServiceR#3, we can use the “smart” mode to
have WDQSR format the publicationDate column for us
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.