Function to create custom queries with the `/landregistry/query endpoint`. All necessary prefixes have to be included and output will be parsed from json to dataframe. The most prefixes from land registry can be include with prefix_query.

sparql(
  query,
  endpoint = "http://landregistry.data.gov.uk/landregistry/query",
  ...
)

prefix_query(query)

Arguments

query

custom query.

endpoint

land registry's web service endpoint.

...

further arguments passed to httr::GET.

Value

Returns a tibble that has been parsed from json.

Examples

custom_query <- "select * where { <http://landregistry.data.gov.uk/data/ukhpi/region/newport/month/2013-10> ?property ?value }" sparql(prefix_query(custom_query))
#> Response [https://landregistry.data.gov.uk/landregistry/query?query=prefix%20rdf%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0Aprefix%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0Aprefix%20owl%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%0Aprefix%20xsd%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0Aprefix%20skos%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2004%2F02%2Fskos%2Fcore%23%3E%0Aprefix%20sr%3A%20%3Chttp%3A%2F%2Fdata.ordnancesurvey.co.uk%2Fontology%2Fspatialrelations%2F%3E%0Aprefix%20ukhpi%3A%20%3Chttp%3A%2F%2Flandregistry.data.gov.uk%2Fdef%2Fukhpi%2F%3E%0Aprefix%20lrppi%3A%20%3Chttp%3A%2F%2Flandregistry.data.gov.uk%2Fdef%2Fppi%2F%3E%0Aprefix%20lrcommon%3A%20%3Chttp%3A%2F%2Flandregistry.data.gov.uk%2Fdef%2Fcommon%2F%3E%0Aprefix%20trans%3A%20%3Chttp%3A%2F%2Flandregistry.data.gov.uk%2Fdef%2Ftrans%2F%3E%0Aselect%20%2A%20where%20%7B%0A%20%20%3Chttp%3A%2F%2Flandregistry.data.gov.uk%2Fdata%2Fukhpi%2Fregion%2Fnewport%2Fmonth%2F2013-10%3E%20%3Fproperty%20%3Fvalue%0A%7D] #> Date: 2021-05-27 10:50 #> Status: 200 #> Content-Type: application/sparql-results+json; charset=utf-8 #> Size: 14.2 kB #> <BINARY BODY>