-1

I have a list of about 900 postcodes for each solar farm in England and Wales. I would like to find the house prices for each postcode, to see how house prices may have changed after the solar farms were implemented.

I have been given a query which gives me the HPI corresponding to each postcode, but i would like to get the individual house transactions (houses sold) in each postcode.

I am new to SPARQL and have no idea how to do a single query for all the postcodes. If anyone can help it would be great.

This is the link to searching via postcode: http://landregistry.data.gov.uk/app/qonsole.

Many thanks Reece

rjo93
  • 15
  • 1

1 Answers1

0

There is an example query there, with transactions in a postcode. It uses a VALUES clause, so simply add all your postcodes to that VALUES clause.

Note: they store postcodes as typed literals, so you'll have to append ^^xsd:string to each quoted value.

Add ?postcode to the ORDER BY clause to make a bit more sense of the result.

TallTed
  • 9,069
  • 2
  • 22
  • 37
chrisis
  • 1,983
  • 5
  • 20
  • 17
  • thanks, worked really well. But when pasting all the postcodes with quotation marks, says the line is invalid, but if i just delete the quotation marks and then type it back, its fine. I don't want to go through every postcode typing the quotation marks, is there a resolution for this? – rjo93 Jul 30 '17 at 18:58
  • You don't actually need the `^^xsd:string` in there. – evsheino Jul 31 '17 at 10:07