Quads with a View

by James

The observant user may have noticed, that the controls in our query editor have ever so slightly changed. In particular, the list is no longer titled “Queries”. The header is “Views” and each entry has an additional icon: a link.

sparql_link

If you follow the link, it presents the results from the query on a new page. In some regards, this is the same as the result pane in the editor window, but it offers at least two advantages. First, each column can be rearranged to be in ascending or descending order. Second, the view is available for each query stored for a repository independent of the query editor. The menu to the right indicates the respective available encodings.

all_link

That is, in addition to the HTML presentation, a request to the SPARQL endpoint for the respective typed resource yields the results as a document in the expected encoding. For example

http://dydra.com/jhacker/foaf/all.srj

yields

{
  "head": {
    "vars": [
      "s",
      "p",
      "o"
    ]
  },
  "results": {
    "bindings": [
      {
        "s": {
          "type": "uri",
          "value": "http://dydra.com/jhacker/#self"
        },
        "p": {
          "type": "uri",
          "value": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
        },
        "o": {
          "type": "uri",
          "value": "http://xmlns.com/foaf/0.1/Person"
        }
      },
      {
        "s": {
          "type": "uri",
          "value": "http://dydra.com/jhacker/#self"
        },
        "p": {
          "type": "uri",
          "value": "http://xmlns.com/foaf/0.1/mbox"
        },
        "o": {
          "type": "uri",
          "value": "mailto:jhacker@example.org"
        }
      },
    ...
    ]
  }
}
blog comments powered by Disqus