add cart choropleth column cross cube error file folder geo help home lock obs poi rdf remove search slice spreadsheet success table unlock warning

[this is a icon-] developer tool

SPARQL 1.1 Query: Results

Edit query
Query results
s p_blank o_blank
http://statistics.gov.scot/id/statistical-geography/S12000021 http://www.w3.org/1999/02/22-rdf-syntax-ns#type geosparql: Geometry
http://statistics.gov.scot/id/statistical-geography/S12000021 geosparql: asWKT MULTIPOLYGON (((-4.75094123425606 55.8497682371921, -4.753605268246773 55.84821645580924, -4.7596775529852815 55.84698823112454, -4.762133414390148 55.845795974448656, -4.767693613048862 55.84568891409617, -4.77118820658971 55.8446169551005, -4.7759083320021185 55.844941908967634, -4.783534161870175 55.84356058395473, -4.783728210746652 55.83979436386561, -4.779111495268351 55.839458303482, -4.765053184363069 55.833483137517625, -4.757944095906915 55.82928775954638, -4.748956500578737 55.82707565360339, -4.744926972632468 55.82428024156157, -4.722368177845772 55.82079101669269, -4.7303689654727 55.81101806523336, -4.728357552413293 55.809534642823294, -4.718517105813468 55.80472803542064, -4.70999220155812 55.80400396703095, -4.698013197619519 55.80352152753564, -4.68895872086644 55.804596393742166, -4.686162768957613 55.80385751324274, -4.681911912151319 55.79655818580244, -4.6793845991384275 55.79519038447759, -4.678301062621618 55.792632503188116, -4.672829339393382 55.78810363912878, -4.673208238797198 55.78515885582399, -4.676799004117531 55.78248658675115, -4.676785957853691 55.77899561832902, -4.671180568651991 55.7785163752997, -4.6690750152928535 55.77429072765259, -4.664625306323982 55.77099142825673, -4.665589288018123 55.769135928210176, -4.6584514265799415 55.76626512637404, -4.656666602539218 55.76449701959106, -4.657615144869423 55.76142844798858, -4.655065184220758 55.75984500281901, -4.650472651996231 55.760854749220954, -4.6486717605496235 55.76243694145807, -4.644555214830611 55.76890478228853, -4.63868677540171 55.77478989756127, -4.6353212130695765 55.77558308517832, -4.631863835505913 55.773903514966314, -4.6346655963726215 55.770879087458475, -4.6344267309654015 55.76826130694918, -4.629961071140939 55.764787704922675, -4.624098609049383 55.76414371905217, -4.618114730425139 55.764681262023785, -4.616554449755475 55.76150025748217, -4.610699557476185 55.76668084157972, -4.6069683405414334 55.767391976172576, -4.606158184197475 55.769609534914515, -4.597537091972453 55.77172193972853, -4.594528662180443 55.7742959777869, -4.5895558082207195 55.776256115537386, -4.585312716791453 55.77664929342527, -4.583091012827636 55.775297390939215, -4.578779474115834 55.78189286530373, -4.57465923782614 55.78345698721954, -4.572140789651626 55.783000066479715, -4.573274151383576 55.780547663122555, -4.572377237465261 55.77896473496467, -4.56715051767129 55.77874060265988, -4.5646574706821434 55.77715951504518, -4.564644774919298 55.77507356032961, -4.5605687318669235 55.7713286879093, -4.5574555192250825 55.76993201284333, -4.558053620760294 55.76667301393384, -4.550952820441794 55.76638658529277, -4.542617248082072 55.764838111842195, -4.540141483892356 55.76202029394659, -4.5417743605392555 55.759898506909316, -4.541333093516354 55.75735497998872, -4.537360595124776 55.75617156871301, -4.540277686879674 55.75127381388977, -4.534683142220472 55.74978950582164, -4.533001612857943 55.746886778298204, -4.52992477933295 55.74457735403776, -4.533177360069994 55.74325463835701, -4.536456215619614 55.73991337050546, -4.5406704908214035 55.73944875317418, -4.5450706355525 55.73401318160171, -4.547537043674038 55.73370135412614, -4.552036143138142 55.727341248649466, -4.554378284802379 55.725695316812605, -4.558759501076629 55.72554656889138, -4.559502753289442 55.722862474711484, -4.5640349085773835 55.71843817603203, -4.5664188138747726 55.71696006249034, -4.571721450555969 55.715872949685, -4.574720001830043 55.713555811292125, -4.578276174071407 55.71298864862466, -4.579861343203669 55.71022822266516, -4.578293599584294 55.708156050351434, -4.578871543438371 55.70588603111463, -4.591297503551683 55.69828794068569, -4.592949640257548 55.695790184751715, -4.590858460036395 55.693530548931015, -4.594689691117399 55.690805219890976, -4.5946871109746175 55.68915680751777, -4.597478304083171 55.68834625772223, -4.599774952708591 55.68545545574879, -4.605710634622286 55.684825336583955, -4.608985212749907 55.68234499330917, -4.6098394460352585 55.67780831930632, -4.613734108198457 55.67600494710841, -4.620714624640454 55.677011980903366, -4.6240363465401355 55.675284403146065, -4.629636091061445 55.67486696777893, -4.631978337340475 55.67255872551836, -4.6344424183187645 55.673156601096494, -4.637658055413658 55.6718263971883, -4.638208751535734 55.669256404482866, -4.632671513921248 55.667964204092286, -4.626728589705719 55.6685598744249, -4.62120351467721 55.66748714830106, -4.62260209419977 55.66224652956014, -4.616731271865991 55.663055037068865, -4.603219410955078 55.65869096688004, -4.5967761709434605 55.65507933061093, -4.5990052234285725 55.65167675090996, -4.603804442144093 55.64734398345259, -4.596233374320885 55.6454434853925, -4.593458578054339 55.6441736263254, -4.590515558541804 55.645913154759114, -4.58594047052353 55.64571039665941, -4.58368624344562 55.648574016879444, -4.58160481618017 55.6464147705807, -4.5786334948464065 55.64850954445297, -4.571601948550008 55.6500441733759, -4.572226143617102 55.65311405731051, -4.570218097005464 55.65517142451891, -4.5651850946262185 55.65578369084263, -4.5546652101126295 55.66385914906772, -4.551490017617031 55.66352078629286, -4.546504260457965 55.66700944636509, -4.539848414409191 55.66722202173317, -4.5347207417364395 55.66644990386798, -4.533195363138048 55.66364109512917, -4.5306946835426185 55.663183129795534, -4.529771457649052 55.66036006044192, -4.5259450186063095 55.65940789287418, -4.518929805424355 55.65957642580321, -4.510608226203711 55.66119239883626, -4.502250880033396 55.665149936385546, -4.49263802103324 55.66507060177025, -4.492474156084757 55.66326915483458, -4.496210303783893 55.65649325838725, -4.510456109230509 55.656483838080916, -4.514654104667513 55.65404294186046, -4.519164187612711 55.65263441998705, -4.523564421064985 55.65275790841392, -4.523998791378146 55.651330653896736, -4.531407625694515 55.650215212844074, -4.5348587765007995 55.64776026040931, -4.542409692115817 55.64676709677191, -4.5481188233050505 55.64546839919304, -4.553649218329566 55.647580773919536, -4.557315466697425 55.646668418020276, -4.557975974385482 55.641319995087024, -4.559908811348745 55.63998623054233, -4.560717093528409 55.63632449461976, -4.563619987155765 55.63371920641743, -4.567032300468468 55.63404867179785, -4.5695575819759044 55.63274547297673, -4.56760345018497 55.630538404628844, -4.5611580718106435 55.62891422651189, -4.55898523793926 55.62707112209962, -4.559274236245738 55.62453483870906, -4.561455731473972 55.622641234620566, -4.5672830788306475 55.62158452987721, -4.570270558980939 55.62192009483476, -4.5727252431098995 55.62364746092129, -4.576607403659013 55.622361449465686, -4.578090847248655 55.620884869335825, -4.5832084310389245 55.61887606278085, -4.5884639588542795 55.61822046737621, -4.588247627364779 55.61571183458322, -4.584187336198383 55.61434770319426, -4.5838556594191715 55.611840597634504, -4.58714829432097 55.610379661309295, -4.587946358346763 55.60774177777548, -4.58550134882462 55.60499882605515, -4.583115920969598 55.605423930988046, -4.579778120622834 55.60290645124316, -4.592504706002231 55.6017462131631, -4.594102751509855 55.60065177730331, -4.59223042531138 55.59795074965148, -4.599247818259613 55.595991780652966, -4.599749087950253 55.59509943680394, -4.605875502549035 55.59324254801357, -4.616541219157218 55.58571738979342, -4.636734955222993 55.57108050581837, -4.643945778496122 55.565495806754605, -4.647830994864081 55.56335889378077, -4.652088021921055 55.56307529679951, -4.654314218025561 55.569598785885304, -4.663074872136023 55.570617343469884, -4.664029741576686 55.573681836357636, -4.669050355606189 55.582200915843636, -4.675675788911347 55.58942993187525, -4.681911601302317 55.59498442986472, -4.687268317702333 55.59873227412108, -4.694293910434841 55.602467484047104, -4.700380280458335 55.60423111149887, -4.699786488592279 55.60564102379717, -4.712393089119645 55.61227062351091, -4.719426252211216 55.61439343843527, -4.739348902266289 55.62178995596493, -4.7509930257254505 55.62460432985804, -4.757887378129306 55.62758208035614, -4.765409034656762 55.62977399793876, -4.779812369789696 55.63282771278184, -4.780260320880034 55.63188311711535, -4.789933141888457 55.627872672819386, -4.79700362649097 55.629839290743405, -4.7996661138425445 55.63293863307126, -4.798693204912046 55.634246739322776, -4.80368450747763 55.6365264932314, -4.807326771570731 55.6374467799173, -4.814219420350723 55.63747303204786, -4.815447583007027 55.635631272927945, -4.820798270599828 55.63681485032211, -4.823838530351491 55.63668463259797, -4.825525277934963 55.63953938463932, -4.824421211002456 55.640952033190004, -4.818441041664925 55.639506482593646, -4.820164777123898 55.644846404391735, -4.826533370834536 55.64792596723649, -4.826937559112217 55.65007045363578, -4.833511776406635 55.651488221953436, -4.833187320515141 55.6545879970213, -4.834131395286127 55.658805477921746, -4.841716650641695 55.664918693076125, -4.842707013506146 55.66649132345869, -4.846847440600511 55.66671889683339, -4.85050919845537 55.66841101275439, -4.850949815996048 55.67208365132532, -4.859913360001818 55.67393180290117, -4.861726447039523 55.679435872835406, -4.863562461271891 55.68233070809939, -4.867298842091908 55.683707778729584, -4.87411787921265 55.68738661795445, -4.8821773756734945 55.6889396569965, -4.883320188300438 55.69235659694804, -4.891805951657693 55.69474849006243, -4.901671732653785 55.69500772108764, -4.905734443758072 55.69892261172398, -4.904817959245588 55.703402572193006, -4.905586554270263 55.705306293438795, -4.903615768342681 55.715210990585724, -4.902454875275932 55.71678335424192, -4.904992610163909 55.72194070815661, -4.902168206966583 55.7245505989679, -4.902252281195422 55.72737808231725, -4.9049029376927304 55.73027915258805, -4.902021121582548 55.73179765019872, -4.89507983534184 55.733426805826454, -4.895502228165248 55.73702064075369, -4.8898389624956025 55.739488593910956, -4.8849197112739295 55.738597497538464, -4.884242890748145 55.74440875608406, -4.88645231998909 55.74554215176826, -4.880050303398545 55.746939658018206, -4.87411465036379 55.74699424941899, -4.873579479141464 55.749446442069015, -4.870332174449162 55.748416728456505, -4.866040706148291 55.751631363211374, -4.863272902210237 55.75272660771009, -4.857603578190474 55.756920712465785, -4.857055304477026 55.75966706480529, -4.860972900136327 55.76350500996294, -4.85770754920054 55.76808153185143, -4.855202505170535 55.77428845394531, -4.8600294167559195 55.77527520008511, -4.860197870482129 55.77973495040765, -4.86281046142222 55.781538433455616, -4.863433146813543 55.78474112673603, -4.867636093063519 55.78740364867742, -4.868134124776324 55.78881769824766, -4.872541215597995 55.79112202125982, -4.870511365396827 55.798377848556626, -4.872209883454242 55.80088998887513, -4.876790726117029 55.80146950337996, -4.878558797569642 55.802739701181544, -4.878759280053764 55.80586493405847, -4.883442950899352 55.80980760797067, -4.885140666852925 55.81383634112853, -4.8885384153557165 55.81864581874, -4.892565647837678 55.838493994185065, -4.889747557259756 55.845327648811036, -4.890756407147846 55.85239186083836, -4.890118947104762 55.85335331057371, -4.891662367803392 55.862628674971276, -4.890564876749465 55.87467502184089, -4.886504769732141 55.87546610706837, -4.8801940103971 55.87549353471498, -4.874417223660882 55.87376703075777, -4.86942141972127 55.87375427496521, -4.865049452521467 55.87493843063071, -4.860529244435113 55.87515605761636, -4.858045433870524 55.874319377272954, -4.84724112874238 55.876997001141106, -4.8452754456321765 55.875154804009306, -4.841442866726508 55.87620521264959, -4.837548385281724 55.87969744448309, -4.8309052401795585 55.88223701103821, -4.826541614612391 55.88303846665034, -4.821754983224002 55.886604583619246, -4.814150954656149 55.88772259077081, -4.812598136120011 55.88980311042145, -4.80270070478951 55.8924020697332, -4.799488005320642 55.892326849626315, -4.798704966219447 55.88800754292264, -4.800679276584449 55.88577383191096, -4.800276862804826 55.87963468490224, -4.7957133668630645 55.874992397022204, -4.794188260573146 55.87223601171972, -4.784096495319835 55.86961990316173, -4.781057323235208 55.869931286615966, -4.77780555207162 55.867492404406825, -4.769390564199441 55.86470693310016, -4.761594448846794 55.8554260838417, -4.755356458031512 55.85173682726154, -4.75094123425606 55.8497682371921)), ((-5.2623355139590515 55.72154159150056, -5.2543681752751015 55.72054842646848, -5.242031220343057 55.71583590930557, -5.236908158514893 55.71474397647981, -5.229203715955505 55.71170142033216, -5.21925681029721 55.70945002527182, -5.216103004035812 55.70779316621241, -5.199764658434961 55.70203056274759, -5.196269080723557 55.69987414399055, -5.193983918573378 55.69693996629815, -5.190472107713773 55.6940870020239, -5.175555095730366 55.686989742299964, -5.167854294864254 55.68396143471963, -5.161194850557633 55.67903587019174, -5.155218562427634 55.670028848825226, -5.151649361266634 55.66728425306666, -5.150737184786576 55.66513926952023, -5.152740985724848 55.66136044872788, -5.149175978465585 55.65804389591288, -5.146081690030576 55.65311493738592, -5.141287058914913 55.64891901222436, -5.139757391658782 55.64496575849581, -5.138396750275574 55.644371294093794, -5.137164038551462 55.63798566415948, -5.137440247199068 55.63519884133448, -5.134140735978111 55.62626624829579, -5.131951321046505 55.62441632400088, -5.1325156432222965 55.62213183121253, -5.128583750998526 55.61526047053627, -5.1271231494699565 55.609189022998095, -5.128364640610714 55.608325715916095, -5.132425529429468 55.60099840409055, -5.141404427639507 55.59692074046359, -5.143640038047412 55.59658468823282, -5.1450162832720565 55.59348818939832, -5.153188575964176 55.59013603166099, -5.153479790893192 55.58601193080281, -5.149504804720339 55.579095587737584, -5.147949467339591 55.57808366208719, -5.1413301641725 55.57707147679581, -5.129892960357825 55.57668905687838, -5.122025936011407 55.575740971284326, -5.112867924277167 55.57361413589078, -5.105690925551883 55.57064083401638, -5.104347434976876 55.56789245755802, -5.09685852409982 55.56113726268045, -5.090396409040491 55.5580326804786, -5.082618511755763 55.552493128887924, -5.084854274792345 55.55016227266962, -5.093489005629091 55.54868939334385, -5.096485718444457 55.54541948122902, -5.104126254407805 55.54255777390848, -5.111635641056469 55.54164066855502, -5.1153567852351145 55.5394963230392, -5.115552169347448 55.53823902351677, -5.119438993288283 55.53723381839826, -5.123619426407082 55.53465670530212, -5.125591667748296 55.52948828073385, -5.121386840565814 55.524810140341344, -5.117504354420953 55.52253116131747, -5.106440781006825 55.51878488806101, -5.098453895817966 55.514887877896406, -5.092104039761232 55.51234962570064, -5.083203212141642 55.510401394354666, -5.078986224395603 55.51003914580591, -5.079256944662187 55.507278658378446, -5.082528017329591 55.502641074798156, -5.087008013378305 55.50139533954865, -5.091451536360055 55.4972268043375, -5.0910100517514465 55.49446359684214, -5.093336045179097 55.48923193547874, -5.092645938729617 55.486246644106416, -5.089897744678674 55.48172309877385, -5.087692392329718 55.47996186626479, -5.086123752524192 55.475732912371704, -5.0825637001094295 55.46916553203664, -5.078468028059426 55.46423424163123, -5.081766720005209 55.46220032304538, -5.080999960142553 55.46028228957559, -5.082922912236776 55.45451612611419, -5.084711092255829 55.45290224887858, -5.095334956209337 55.44938825569277, -5.098117170531166 55.446623484091184, -5.099220570531452 55.44383461421326, -5.103734677230087 55.441886981350144, -5.108453834936639 55.44072154876372, -5.109254056518749 55.43923396535995, -5.115478734532789 55.43944047821747, -5.1219028304317264 55.44170937863213, -5.124440299227459 55.440799440845765, -5.129459044474935 55.44077002465599, -5.134345816328707 55.4431432373082, -5.142039701374287 55.44107215226353, -5.143098458996427 55.442155191859165, -5.1533790747562795 55.44157128550079, -5.15797033250281 55.440841419361234, -5.165344229951089 55.437045604611676, -5.172301896653472 55.43477943232571, -5.18024215507859 55.43306269491959, -5.187862576680741 55.433562728616224, -5.1919366396398425 55.4324396063825, -5.20593751153018 55.43233931751389, -5.21366829196438 55.433047055594834, -5.219232611711633 55.43273875887642, -5.218815450010802 55.43474121500286, -5.2233881262436315 55.43580299673159, -5.227624888217721 55.43579006593298, -5.2346467028628725 55.43705637800539, -5.238190194836519 55.43697612939048, -5.244032533313373 55.43802588856303, -5.245412109138781 55.43682054881516, -5.249820078626052 55.438213792400845, -5.2604342510669495 55.44256136729373, -5.263292180903296 55.444418093164174, -5.263021998147378 55.44603013448281, -5.2680645282572005 55.446565322012695, -5.269931566650628 55.44781454203388, -5.276326412035331 55.449488236511506, -5.279220334790612 55.44962995728353, -5.289311781132036 55.452239482234354, -5.292741773488529 55.454556709142, -5.293941540225378 55.456421442584805, -5.297276408343961 55.457270190333595, -5.304422947992027 55.46119862766204, -5.3153019990696935 55.46453826698731, -5.318224157328407 55.46801125953337, -5.3197769520942515 55.471739875737725, -5.323925681945784 55.478900770695724, -5.32761903465656 55.48327335830265, -5.326459720905384 55.48623588520515, -5.329058856141105 55.490952782942834, -5.326210756495411 55.4947345155502, -5.328374406701597 55.497570698330264, -5.331464159988879 55.498241877701766, -5.336563281296751 55.502066026773434, -5.341060259575306 55.502627483518694, -5.346558785627227 55.505242812179866, -5.3512952347116585 55.505706566313926, -5.356433116276148 55.507161598229814, -5.352675968830404 55.51020461732456, -5.351164699536935 55.5130197333461, -5.352642573269483 55.51725895680415, -5.351954586207133 55.52183615177998, -5.355063593427609 55.52679942990294, -5.353327007889561 55.53292934367093, -5.34953992992608 55.538445544068686, -5.344511438802695 55.54354603032348, -5.343780962669179 55.54642596991042, -5.346650327261834 55.55249374767881, -5.3441883130588685 55.555081163428675, -5.34719247028674 55.56070913963452, -5.349135207716958 55.566571111939275, -5.348508266566745 55.56871003201074, -5.350160620066658 55.5708765804964, -5.356688168204225 55.57512589917795, -5.358010824072497 55.57751261280576, -5.365615938203436 55.58069791173112, -5.372943652443776 55.58581444063667, -5.375509014004072 55.589344584897574, -5.379449168655645 55.5927019298236, -5.3808683144409075 55.59627716588063, -5.382957313818011 55.597671557929395, -5.385210140165111 55.60151584358398, -5.389367111331457 55.605887354699455, -5.393217488127555 55.607988941188594, -5.395494069661126 55.610527913716346, -5.397565543477417 55.6147321532308, -5.397861636991409 55.61805962607751, -5.39571746002751 55.62320793570674, -5.396126372269751 55.62719760177107, -5.3935618836973065 55.631076303256854, -5.389303684766642 55.63301932407791, -5.386696145914246 55.6358606307681, -5.383863033529897 55.64180089805773, -5.3839577137418875 55.64451806118687, -5.382348616486803 55.64860658857734, -5.382087876556243 55.653654967308846, -5.376847002460699 55.66323535389718, -5.373412200637135 55.667308299219854, -5.372681846262579 55.671203501962935, -5.365655143797639 55.6782025596316, -5.3629897422722514 55.67968279212974, -5.357361904015234 55.68122603743461, -5.353967361180156 55.68302272455244, -5.3456079790703495 55.68575947536636, -5.339199914776342 55.68666233618456, -5.330931306699191 55.68852347057596, -5.3277532292547924 55.69260611607769, -5.326615487977828 55.69734808247986, -5.320445483347696 55.70384015450911, -5.316794814643163 55.70613262444955, -5.301979460002844 55.70808316247865, -5.295698546575813 55.70608981680484, -5.287564005523287 55.70586577925493, -5.290512465669765 55.708529762857964, -5.295229267610975 55.71015896075068, -5.295376555918372 55.713380784292305, -5.288635627339749 55.71815583755148, -5.284953235438894 55.719634483209326, -5.278333425098461 55.72037345031775, -5.2623355139590515 55.72154159150056)), ((-4.903879062288999 55.79308028345081, -4.898071643208842 55.79175663485423, -4.898083939166059 55.78311865022459, -4.897003962153294 55.78146398103273, -4.899399254426803 55.77787292461989, -4.898888813904928 55.773278858737214, -4.896628920708907 55.76857059561667, -4.893745335564942 55.7659607279291, -4.894307762813755 55.76365425839199, -4.897827904335766 55.75974184443256, -4.898541155265651 55.757537922710064, -4.901692686543899 55.752881716904874, -4.904372355756547 55.75009997465745, -4.913888281602117 55.74440626062845, -4.915978165976663 55.74736091028304, -4.9146597757221615 55.75233186395844, -4.9186348323804765 55.75333229522083, -4.93111468377539 55.751386390293035, -4.93746518820734 55.74687836140967, -4.940676030877066 55.742975629933284, -4.946358790408596 55.74223887871999, -4.948488462025206 55.743281806392474, -4.951214199365473 55.749978106106944, -4.950964852278951 55.75332369945725, -4.948784681611739 55.757718872809114, -4.946547137377126 55.75865706802755, -4.943919230549777 55.76505498974147, -4.942525376366616 55.766764882936904, -4.937368209687907 55.76947096325792, -4.935149910829552 55.77510729992169, -4.931694550089619 55.7775593627778, -4.932110893947673 55.77985165164135, -4.930353441682341 55.78068460462477, -4.930083599051311 55.784120473619275, -4.927904259822025 55.785030941349255, -4.925352948533572 55.78815080700714, -4.922048072939279 55.79024841692258, -4.918890657804941 55.79050509802545, -4.915036333688093 55.79234497529497, -4.906816667328984 55.79160574910572, -4.903879062288999 55.79308028345081)), ((-4.938277845943909 55.73507477492814, -4.9379492582488504 55.73036500789163, -4.939451272304092 55.727396644306815, -4.942207899891459 55.72719579430364, -4.943719314920896 55.72492839117648, -4.9447267380887805 55.72085717581707, -4.942668083471451 55.72090924871288, -4.948312120485292 55.71173758432427, -4.953744193891176 55.709491709429415, -4.960865363093354 55.71360361195702, -4.963961605313942 55.71623833377634, -4.968096370555429 55.71847293488489, -4.968352328481114 55.72090022505081, -4.96634483680023 55.723179045078396, -4.960869700723809 55.72670120039415, -4.954525460628437 55.72908615019199, -4.950883215976197 55.73108221837911, -4.947311251120956 55.73183953483732, -4.939247046675813 55.73537698560777, -4.938277845943909 55.73507477492814)), ((-5.082273348473011 55.537456996874674, -5.078926989537425 55.537338903104754, -5.075174607390368 55.535877948159396, -5.064187325190564 55.52394056251522, -5.060202969741664 55.51814279834525, -5.0597650391470435 55.51658499497217, -5.061389235325089 55.51281351603537, -5.068201324269455 55.511182089390516, -5.071071006810061 55.51218527267606, -5.072379840020817 55.515500337064076, -5.077062426595704 55.52159482472246, -5.087248325653374 55.52559505156482, -5.088385818668629 55.53161214981172, -5.089902560862405 55.53447772999306, -5.089076677416298 55.53617519033044, -5.082273348473011 55.537456996874674)), ((-4.8420205009415165 55.6488588406579, -4.839219431630467 55.64736590008491, -4.839747017813581 55.64321506732431, -4.843864801697874 55.64169568984714, -4.846725177321416 55.64792985167372, -4.8420205009415165 55.6488588406579)), ((-5.118084126914722 55.42798881688009, -5.115515233754651 55.42578430411823, -5.117410905622814 55.424063719374146, -5.120010729048799 55.424055890388836, -5.12221859102421 55.42699322390781, -5.121039505841875 55.429378832555884, -5.118084126914722 55.42798881688009)))
SPARQL API: The Basics

The most flexible way to access the data is by using SPARQL, a query language, analagous to SQL for relational databases, for retrieving and manipulating data from graph databases like ours. We support SPARQL 1.1 query syntax. Many online tutorials are available.

To submit a SPARQL query from your code, you issue an HTTP GET or POST to our endpoint:http://statistics.gov.scot/sparql, with the query itself as a url-encoded parameter called query.

For example, to run the following simple SPARQL query and get the results as JSON:

SELECT * WHERE {?s ?p ?o} LIMIT 10

Option 1: POST (recommended)

Issue a POST to the endpoint, with the query in the body, and an Accept header of sparql-results+json:

POST http://statistics.gov.scot/sparql HTTP/1.1
Host: statistics.gov.scot
Accept: application/sparql-results+json
Content-Type: application/x-www-form-urlencoded

query=SELECT+%2A+WHERE+%7B%3Fs+%3Fp+%3Fo%7D+LIMIT+10

Option 2: GET

Issue a GET to the following URL (note the .json extension - see the formats section for more detail on this):

GET http://statistics.gov.scot/sparql.json?query=SELECT+%2A+WHERE+%7B%3Fs+%3Fp+%3Fo%7D+LIMIT+10

Scroll down to the end of this page for examples of both of these methods in a few different languages.

Results formats

As with other aspects of our API, to get the data in different formats, you can use either (a) a format extension or (b) an HTTP Accept header. Available result formats depend on the type of SPARQL query. There are four main forms:

SELECT queries return tabular results, and the formats available reflect this:

Format Extensions Accept Headers
XML .xml application/xml,
application/sparql-results+xml
JSON .json application/json,
application/sparql-results+json
Text .txt, .text text/plain
CSV .csv text/csv

CONSTRUCT and DESCRIBE queries return graph data, so the results are available in the same formats as our resource APIs:

Format Extensions Accept Headers
RDF/XML .rdf application/rdf+xml
N-triples .nt, .txt, .text application/n-triples,
text/plain
Turtle .ttl text/turtle
JSON-LD .json application/ld+json,
application/json

ASK queries return a boolean result:

Format Extensions Accept Headers
XML .xml application/xml,
application/sparql-results+xml
JSON .json application/json,
application/sparql-results+json
Text .txt, .text text/plain
Results pagination

We accept page and per_page parameters for paginating the results of SELECT queries (we automatically modify your query to apply LIMIT and OFFSET clauses). For other query types (i.e. DESCRIBE, CONSTRUCT, ASK), pagination like this doesn’t make so much sense, so these parameters are ignored.

For requests made through the website (i.e. HTML format), the page size is defaulted to 20. For requests to our sparql endpoint for data formats (i.e. non-HTML), there will be no defaults for these parameters (i.e. results are unlimited. For performance reasons we generally advise LIMITing your query if possible).

Parameter Substitution

You can parameterise your SPARQL by including %{tokens} in your queries, and providing values for the tokens in the request parameters.

Note that the following tokens are reserved and cannot be used as parameters for substitution:

  • controller
  • action
  • page
  • per_page
  • id
  • commit
  • utf8
  • query
Cross Origin Resource Sharing

Our servers are configured to allow access from all domains. This means that if you’re writing JavaScript to request data from our server in to a web page hosted on another domain, your browser should check this header and allow it.

If you need to support very old browsers, you can additionally pass a callback parameter and the results will be wrapped in that function. For example:

http://statistics.gov.scot/sparql.json?callback=myCallbackFunction&query=SELECT+%2A+WHERE+%7B%3Fs+%3Fp+%3Fo%7D+LIMIT+10

This help topic on the jQuery website has more details.

Examples

Using cURL

Here’s a couple of examples running a query using the widely available cURL command line program.

Request the results as XML, using a POST:

curl -X POST -H "Accept: application/sparql-results+xml" -d "query=SELECT%20*%20WHERE%20%7B%3Fs%20%3Fp%20%3Fo%7D%20LIMIT%2010" http://statistics.gov.scot/sparql

Request the results as JSON, using a GET:

curl -X GET -H "Accept: application/sparql-results+json" http://statistics.gov.scot/sparql?query=SELECT%20*%20WHERE%20%7B%3Fs%20%3Fp%20%3Fo%7D%20LIMIT%2010

Using JavaScript

This example HTML page uses jQuery to issue a POST to our SPARQL endpoint, requesting the results as JSON.

<!DOCTYPE html>
<html lang='en'>
<head>
	<script src='http://code.jquery.com/jquery-1.9.1.min.js'></script>
</head>
<body>
<script type='text/javascript'>

	var query = 'SELECT * WHERE {?s ?p ?o} LIMIT 10';
	var url = 'http://statistics.gov.scot/sparql.json';
	$.ajax({
		method: 'POST',
		dataType: 'json',
		url: url,
		data: {query: query},
		success: function(data) {
			alert('success: ' + data.results.bindings.length + ' results');
			console.log(data);
		}
	});
</script>
</body>
</html>