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/S37000027 http://www.w3.org/1999/02/22-rdf-syntax-ns#type geosparql: Geometry
http://statistics.gov.scot/id/statistical-geography/S37000027 geosparql: asWKT MULTIPOLYGON (((-4.461860523524241 55.17021452654629, -4.461887055547227 55.16758749971704, -4.464054095905796 55.16339089516402, -4.463656791251141 55.1621674567315, -4.468406781302113 55.159383625751225, -4.471825817489312 55.15615474351902, -4.475232025706754 55.155770979499636, -4.478634301830271 55.1529197495477, -4.482877772391908 55.15300416999167, -4.4894078724912045 55.1522506748615, -4.5003490487254405 55.15263336623792, -4.513586010086659 55.151704787711076, -4.515520120577806 55.15313000259593, -4.532134987242136 55.15831854033477, -4.536235286629005 55.1574961867362, -4.5485645442478635 55.158811972096906, -4.557956222865221 55.15837242615174, -4.56058224095487 55.15748394747679, -4.565241966053866 55.157536085701736, -4.5675880968649265 55.155446103060356, -4.575279078547451 55.15311289685816, -4.574626155407357 55.1496793848687, -4.578663588506206 55.149126597353565, -4.584016132144084 55.14197015760671, -4.586430564248728 55.14363138783122, -4.590353673447303 55.142658083914384, -4.590918123144707 55.140956156841305, -4.596174855935637 55.14119029753237, -4.598302457397227 55.13843466818856, -4.610430070498118 55.141883399152675, -4.614604907986847 55.14165006817233, -4.616384406918014 55.13982747287966, -4.6206689859657875 55.141151113302065, -4.6265096572865225 55.13892638442978, -4.627062684915395 55.134208596738944, -4.631923521705906 55.13296827356312, -4.634345699757129 55.13127358927385, -4.645618306448498 55.12783355271928, -4.64464524029712 55.12593099447894, -4.650322756509108 55.12117804915665, -4.656664723349756 55.120900463113834, -4.658514839941464 55.11970951077666, -4.659690892427813 55.11593077917266, -4.662354425930052 55.1118857680143, -4.6618471100860255 55.110152978591245, -4.658699661750682 55.10679680550417, -4.659881757134536 55.10523829104361, -4.659847241302042 55.10070836375167, -4.658427966793525 55.09952129893203, -4.656985684681891 55.09302659206424, -4.661255888933852 55.08876667058445, -4.658144821960915 55.087230062158675, -4.655318632906277 55.087624352149426, -4.650369290178483 55.083053264621164, -4.647016322234079 55.081045258589825, -4.6469804575532745 55.07825034472681, -4.643019896819301 55.07723518526449, -4.6373171328473015 55.07724207473684, -4.635135196334888 55.07825119064053, -4.630531046141075 55.07721361436703, -4.6289942896446865 55.07480629592649, -4.631351618050022 55.07420248360267, -4.630556734959862 55.07163975696973, -4.6267035740856315 55.07069364919268, -4.625282832902682 55.06729946603944, -4.6269807356385675 55.06488511234673, -4.629223743075977 55.063978163941066, -4.627035821646651 55.060587004673714, -4.632283965036533 55.05798802195439, -4.635541259842128 55.053341984428535, -4.633766877876638 55.051357757976405, -4.64590586796845 55.04881107952223, -4.6446454225630465 55.05213313654769, -4.64619480216041 55.05390174810097, -4.651022976587703 55.05504616287266, -4.656592870140107 55.05272676095084, -4.6617135028750285 55.05332057307499, -4.6668207267876864 55.05065116100121, -4.670114200364341 55.05096553453486, -4.677287772353243 55.04900636575666, -4.67690410605395 55.0466586291355, -4.680768232294495 55.04427226222837, -4.6877597167981175 55.04417639993514, -4.689920102525741 55.04487482969958, -4.698561418747673 55.04184275600757, -4.702411800437338 55.041599912999665, -4.71081685720682 55.039610462058235, -4.714324128981705 55.03765792116872, -4.719385999552874 55.040978877025786, -4.722146252572187 55.04428375644054, -4.725942012970319 55.045655098707435, -4.735194267118205 55.04151441529417, -4.737221280149095 55.04208460992085, -4.740355771964634 55.04717861895543, -4.743344204800663 55.046576351788204, -4.745936855239696 55.04396930327664, -4.7498123327305946 55.04409295158707, -4.752771045802028 55.041580914920665, -4.761450683264363 55.03804447533049, -4.766127906486701 55.03992938081912, -4.776012010726961 55.04183028517516, -4.782554809672669 55.038093919507816, -4.787930942251455 55.03211395213923, -4.790132482023211 55.031249854671366, -4.794137275760451 55.033360404318366, -4.791844667172198 55.03797540058525, -4.797181738666716 55.041331810600454, -4.799268020310144 55.043971796589986, -4.803959190171455 55.043220980999216, -4.808650965889832 55.043485793925306, -4.816482086939856 55.042976590546495, -4.819164722837659 55.04127372963842, -4.8242583544026685 55.04124552469074, -4.8275333694118965 55.03529274176735, -4.830470740074864 55.03466432768684, -4.833707620444366 55.03550592666902, -4.834998714012207 55.03849197721981, -4.8382818031260095 55.04241592674733, -4.841169872822206 55.044730765441656, -4.844125878925292 55.04314237633631, -4.851516500646682 55.043598630287185, -4.859699159331501 55.04143774989206, -4.86897963165112 55.04030221145108, -4.872050505147982 55.03858908592889, -4.876865114986368 55.0383854219447, -4.879447113075419 55.03978962931659, -4.884539564813673 55.0396375032696, -4.882673709050685 55.04721985350978, -4.888188600490781 55.05226731848108, -4.896233000928615 55.05361335625315, -4.894664639657355 55.05835237796266, -4.894751302107702 55.060854036827145, -4.901059284605068 55.06425939428744, -4.905212147345207 55.06201615782104, -4.908867107899555 55.06198274653657, -4.912946019647943 55.06638014947595, -4.923068180768768 55.06620037955744, -4.923697135810186 55.06494463050859, -4.933421514758487 55.06436444000462, -4.932579894430806 55.0618540179919, -4.9299006142923565 55.05927093619896, -4.931425952448901 55.057427155351085, -4.930803226956095 55.05137385989374, -4.935480889707565 55.04842468030351, -4.940030805153921 55.04641337666326, -4.943226334421619 55.043553625474736, -4.94424898544634 55.0392495207488, -4.952026687234917 55.02974719704468, -4.957752316827579 55.027481860287686, -4.956692797743938 55.02574101571633, -4.962258844907219 55.02026534546169, -4.9740727823749715 55.0235416485779, -4.978082369592125 55.02211297029201, -4.981083872131482 55.01785886908074, -4.973253275224418 55.01152814610642, -4.97849689595803 55.00924669318155, -4.986862437001331 55.01098783335747, -4.9946981204007725 55.0086553501783, -5.015480647827276 55.005750130687055, -5.028128582858769 55.00265775392861, -5.029516931043195 55.00260958839753, -5.035665322635255 54.99880162820184, -5.04019928328218 54.99764681635238, -5.041688010917852 54.999648993709776, -5.047727345455404 55.004936968580886, -5.05037488818915 55.00808854971309, -5.049927854217744 55.01012324040711, -5.055048190296231 55.01152305769269, -5.05589036246353 55.01374951934837, -5.055639181338648 55.017540837892014, -5.059356648204387 55.022383142551064, -5.060930199771439 55.027728857114646, -5.059486931589994 55.03189182324869, -5.05659098210666 55.03394256057808, -5.052260713187942 55.04446679416918, -5.053641656654063 55.0487430604039, -5.051693073489971 55.05301388807929, -5.047859969025329 55.05751171970656, -5.046041633779198 55.05780090764741, -5.043889706146811 55.06223581167035, -5.03964155479772 55.06568368132445, -5.035657518043664 55.071282676414455, -5.032322017222836 55.07469948953542, -5.030706896008689 55.07822440104036, -5.027297400502246 55.08183619638244, -5.020524593685192 55.08526854057068, -5.014966880076444 55.087305123479126, -5.012349048876263 55.09139341355045, -5.01332026813792 55.092409295961914, -5.0100458417244615 55.10025318644324, -5.009693336170271 55.10550372572123, -5.006110976116639 55.10599321858844, -5.002587667807669 55.109422761124755, -5.000161336101979 55.11471356289212, -5.000357452692055 55.11831885183901, -4.998379046242158 55.11958936792605, -4.997801840871549 55.12300278913943, -4.996366244879933 55.1249053992145, -4.997125334393698 55.12758108536175, -4.996415235113657 55.13183448448968, -4.99684137749484 55.13810186340713, -4.994021271098047 55.14006699846877, -4.991816388068929 55.14391558953361, -4.9887738900206005 55.145438615239605, -4.985007052888922 55.14579980748025, -4.984253748114539 55.14735648646436, -4.974709178850633 55.15173147639865, -4.9716552089755 55.15235712281932, -4.9667903346897955 55.155488576982265, -4.962074819915658 55.15712986220288, -4.9600087931508785 55.159272079743914, -4.955947610433029 55.15960174638273, -4.953036217717295 55.16199719294045, -4.954022377856778 55.1641623621051, -4.94323029320105 55.16406938307577, -4.937715007135537 55.16901756478765, -4.931352836972625 55.17382862112056, -4.931073160156646 55.17876986195864, -4.926237570507404 55.1842710823485, -4.9218884091480115 55.18785006489519, -4.915394969263291 55.19402884179803, -4.916111899724747 55.1946994175781, -4.9104974763193425 55.198951009348875, -4.907401099470433 55.20002728804365, -4.904627851861108 55.20230492441822, -4.895057067479634 55.207090492599, -4.89479175190457 55.20917344874709, -4.890000218898171 55.211323345032355, -4.885192961660634 55.21437060156343, -4.881573639710071 55.215329121348674, -4.881642013804795 55.21714434404486, -4.878747559099113 55.218651096656565, -4.873810228601704 55.21821831195972, -4.866552282694554 55.22167854406376, -4.865606152727173 55.22496586393213, -4.861791786145665 55.22762921938629, -4.860958637454355 55.231730109715194, -4.862788636400496 55.240403597112795, -4.86494306102171 55.245463569488905, -4.861197025905252 55.24641443796264, -4.859481025748479 55.2531775455386, -4.854180367673394 55.255762271588544, -4.8511150460376395 55.26068542011879, -4.850926817536686 55.265948683772606, -4.848377531066754 55.26754726537658, -4.84827757239064 55.2698623670196, -4.846271128281636 55.27370219708795, -4.843585792906188 55.27466288184127, -4.838586845486609 55.27811264496624, -4.839652302140219 55.28088101496061, -4.837753101761717 55.28520210806012, -4.838689409128049 55.28771125152859, -4.837594293978061 55.2901108765544, -4.83791415399609 55.29613365901526, -4.839480378067747 55.29846149011499, -4.8429383869537554 55.30045848038424, -4.840317440694999 55.30408657692865, -4.8426946623987694 55.307319624330624, -4.840979854802537 55.30996320545239, -4.840617460801455 55.315677327183515, -4.842951199503006 55.31988855286248, -4.849238549795223 55.32288086174744, -4.840533171937708 55.32971713147427, -4.830013032237756 55.333831612466035, -4.824535639325683 55.33495538418018, -4.821227276404123 55.33815302735908, -4.817990309600926 55.336996933711376, -4.811850786312497 55.33920335485902, -4.810609930790162 55.34262598625051, -4.81095906193142 55.347478463189574, -4.804214883834231 55.351397842633844, -4.797008587298304 55.352945579839485, -4.7896379151604735 55.355667507815625, -4.782066900819469 55.36002088678011, -4.778010154645481 55.3615280559042, -4.77467781825115 55.36382902228483, -4.774990619974469 55.366236184509596, -4.773320459374648 55.367356170323504, -4.771387964471665 55.37348561549738, -4.774137035921181 55.378032318830954, -4.772180131828612 55.37934000749073, -4.771196587406184 55.383395556564885, -4.773167498264908 55.391371103812155, -4.769859489321264 55.39877169075145, -4.769967208968682 55.40159727996046, -4.766973238420692 55.404098501035804, -4.761005463504754 55.40677275307073, -4.7572695145648725 55.41076310026109, -4.757241673618214 55.412673762678324, -4.754059206131596 55.416433073390245, -4.746013084178965 55.42171124129418, -4.738335804077784 55.42461751472517, -4.72937387916757 55.427168770525725, -4.724590850142479 55.4272212545599, -4.716576430285338 55.43077312588725, -4.715469775766193 55.43309874196853, -4.7097640999615145 55.43353958791154, -4.703016193600987 55.43494292894778, -4.693753633013594 55.43412825682196, -4.678770797033969 55.439526060799665, -4.6696410146653 55.44150149913477, -4.666508208476188 55.44141389506955, -4.661964216871253 55.44315787637163, -4.655895892873091 55.44747417694561, -4.653392403901323 55.44794425504887, -4.650735901666211 55.45134439306526, -4.650031728661954 55.45441588361495, -4.645055223903064 55.45756410438672, -4.646274383307824 55.459752776780896, -4.643786395521293 55.46436223650282, -4.644250184518092 55.468870652640376, -4.646526732494231 55.47016763388639, -4.641221467751762 55.471446225362484, -4.639848258366344 55.47350033753359, -4.63698228591361 55.472886005705064, -4.6330479205380195 55.47387277911941, -4.630433501323922 55.476670885214446, -4.628462124166797 55.48506989508933, -4.6302889798281095 55.48644637656935, -4.628977124656236 55.491064259423446, -4.625348747361624 55.49272239086566, -4.623089591310307 55.49543179149381, -4.623006279598614 55.499080958928644, -4.626447168059816 55.508253482096514, -4.631849254100531 55.51552748974943, -4.635089011013665 55.51657833305385, -4.637839438428941 55.519863827743414, -4.6470452126890915 55.52378738431153, -4.652218967160704 55.52393248464715, -4.6549194529895 55.528770619196635, -4.658814645678779 55.52904168592786, -4.657798553827189 55.531747906947054, -4.66010829604565 55.5369776116336, -4.665705646790539 55.540344451137265, -4.67238543922166 55.53919613765017, -4.685967349572771 55.54531028646388, -4.68709578725455 55.54877681827327, -4.682217206876406 55.55022338467478, -4.6771871156961256 55.547906188109664, -4.671299589044876 55.549066681072276, -4.665740633680906 55.55363354283538, -4.663813831924995 55.55770576239568, -4.664222103413564 55.56228298044715, -4.6637346196516125 55.56604596567295, -4.662048155265146 55.56876039596843, -4.663074872136009 55.570617343469884, -4.654314218025547 55.56959878588531, -4.6520880219210285 55.563075296799546, -4.6478309948640675 55.563358893780816, -4.643945778496138 55.565495806754605, -4.636734955222993 55.57108050581837, -4.61654121915719 55.585717389793444, -4.605875502549022 55.593242548013585, -4.599749087950223 55.59509943680395, -4.5992478182595855 55.595991780653, -4.59223042531138 55.59795074965148, -4.584336440738489 55.598563362314316, -4.575738909682283 55.598400923909686, -4.572560537858912 55.600772407594654, -4.567266423045811 55.60138852507422, -4.567160468246671 55.59845512307241, -4.569702452589335 55.59370353529007, -4.568541630611946 55.59287123959946, -4.560559513546379 55.59194982471874, -4.554478675456963 55.592776922679256, -4.54957922438981 55.59151184089082, -4.546335130351028 55.59181023432163, -4.543252909223239 55.59384817647992, -4.53609003662113 55.59169282473793, -4.539131339427921 55.588749054965874, -4.54458711923743 55.586555101870694, -4.542433045172931 55.58394726620868, -4.539512667449096 55.57821749075827, -4.537700783511245 55.57969313822276, -4.534563683763671 55.576490802711994, -4.538727541914531 55.575100375359845, -4.537259429753419 55.57361621398295, -4.53384735292307 55.57313132489909, -4.529899833369657 55.5742097125194, -4.524029258719063 55.57094043020899, -4.5169650947271895 55.57138509167405, -4.517338790366599 55.56745750875637, -4.513461321799366 55.56868857579755, -4.509475390659435 55.56881791815174, -4.504131804453378 55.56451755659607, -4.501198486633881 55.564831875019955, -4.4993918643322255 55.562959620416066, -4.491712088059846 55.56370833506199, -4.492761428263325 55.56489953106102, -4.48707660209018 55.56584923387346, -4.482513573635695 55.56412073212647, -4.47726084348701 55.56412553183435, -4.47121645151936 55.564986428145346, -4.470743217400298 55.563059004257774, -4.466677768983431 55.563303669086466, -4.464274185515636 55.565065178184895, -4.4598933598720985 55.5648377381584, -4.4545516906215274 55.56204528548566, -4.453217857132624 55.56402873534254, -4.449260240149427 55.56514514925504, -4.445430564500057 55.56513180321308, -4.441452799624359 55.56362562123243, -4.437164366344274 55.56787974046452, -4.435160305136037 55.566638776722684, -4.437040249525505 55.564801920956256, -4.436571860293462 55.56110545552418, -4.431120557790933 55.56002011208011, -4.427463719520306 55.560693056983816, -4.4263753285037195 55.55687927269563, -4.424305153644442 55.55575994654042, -4.418100052164572 55.557125677351515, -4.413774097339469 55.55642808353897, -4.4095079126595795 55.55328534381738, -4.411721127672186 55.551546645904686, -4.41167106364049 55.54767635171603, -4.408510223409412 55.5444695804865, -4.40970784919855 55.54165876651706, -4.413077228717092 55.53730231338762, -4.409639529621184 55.53411810214591, -4.409001993243555 55.53193482445652, -4.4057686582545506 55.52717804563025, -4.40785571994904 55.5257815335876, -4.407224293558752 55.523824654892124, -4.4018371898997515 55.52364192587194, -4.402077077554723 55.52019472944262, -4.403741167348184 55.517606728746074, -4.401471442392153 55.515872473567974, -4.398962144818877 55.51188954260464, -4.3998266902995065 55.51042644662484, -4.409799277520407 55.51012360188038, -4.414797565790098 55.50724591826844, -4.416645194760175 55.505220290344326, -4.413007137434767 55.50405167942788, -4.412618326376257 55.50147434071096, -4.419688694255497 55.50136981258424, -4.421936884153337 55.50311763694166, -4.427548260685919 55.50482572339474, -4.431894625362388 55.504504828324364, -4.436047878283534 55.505544019830054, -4.439594864087051 55.50438304435104, -4.441469696926755 55.502564144839454, -4.436433274525037 55.50165693183778, -4.433964559333532 55.4998355774708, -4.4349975335904945 55.49830677240319, -4.441491027358824 55.49676987896626, -4.440471154185367 55.49382410769478, -4.448268578635569 55.49099248862382, -4.4495976090966955 55.48830358133568, -4.456482129582346 55.484311290052375, -4.46064038624437 55.48332170065127, -4.4634862445583625 55.483676170514464, -4.466864215901047 55.48608443530921, -4.470807121371485 55.48630869720826, -4.475327734471999 55.48272165379962, -4.474213267780409 55.47991643146239, -4.479247647927684 55.47991525802862, -4.485533883372545 55.47785072216729, -4.4831673046543 55.47268542836611, -4.492323266314482 55.47078339011482, -4.493851629249343 55.46857522398227, -4.490970358347298 55.465541868906044, -4.492572743744355 55.4637312738076, -4.488441026497476 55.46133006542116, -4.49011187536051 55.45687013352451, -4.482132780652213 55.45806775498345, -4.479932779213413 55.455451830388505, -4.477241533349059 55.45506228123251, -4.477788936547274 55.452921892944836, -4.475125422836668 55.45097582864205, -4.474919483639103 55.44854598372762, -4.4825727995521705 55.44672075048575, -4.486624516829913 55.44268085075835, -4.490152281606901 55.4437864987918, -4.491673585455502 55.44238389737257, -4.492737947274284 55.43815111660104, -4.489043372896039 55.43787762698318, -4.4856304627705965 55.435699840758545, -4.481987539908686 55.43488674277146, -4.47838246256488 55.43527985213991, -4.47937499342221 55.43267906055258, -4.478132213532773 55.431412615688814, -4.468250379313664 55.42846561932909, -4.462932669977402 55.43102042803222, -4.4518505939069515 55.4288351079665, -4.452031860594591 55.42645587723638, -4.454074114025125 55.425390153963285, -4.452643669946226 55.42352858614123, -4.455134941873759 55.4212458616216, -4.454375556780106 55.41896548269295, -4.451269957286269 55.417147402783954, -4.450433246482646 55.41195622518292, -4.454441821550497 55.40923592829804, -4.4625633433776315 55.408083868591746, -4.466414899578511 55.405778872520784, -4.46539654367428 55.40421384778799, -4.476638910947 55.40123516353626, -4.484482286538058 55.40024361304103, -4.487450021282514 55.40162415585464, -4.492339326275665 55.40098072272646, -4.500721626337563 55.39912418075392, -4.502309053209745 55.40267271356854, -4.511826051704396 55.406205998922246, -4.516734951865171 55.40892116594531, -4.521290925053005 55.4073791738415, -4.527779836907406 55.40917060583042, -4.522685388285471 55.41079036094846, -4.525172839781213 55.41364779314875, -4.5271199668684785 55.41395181370443, -4.531351211072645 55.41851771320049, -4.531692199776012 55.421078693963985, -4.535126609695122 55.423846140488806, -4.541023410394502 55.424093145180244, -4.545561824728481 55.420717008755794, -4.552151762517112 55.423311220673014, -4.551908334796078 55.42605338515017, -4.565101849355169 55.42630496256401, -4.564678743499503 55.42458166772811, -4.569813967005042 55.422152080409255, -4.562830768458046 55.41762631405599, -4.563913054711096 55.415647692053454, -4.567333720466556 55.41291608338789, -4.56740296810914 55.40906477023625, -4.57119740595931 55.40438992337276, -4.575283310468066 55.40267695020105, -4.579324309721768 55.399918518738225, -4.587757761368544 55.401034625270015, -4.593260214507624 55.40025014068124, -4.596895465159461 55.39792566810163, -4.603459978398634 55.3950723262059, -4.601390019848424 55.392293903146005, -4.599131977013152 55.394510068210764, -4.594929985599877 55.395965635051034, -4.59231163509719 55.39560774481067, -4.5892008342177055 55.39689617923289, -4.5855926700618435 55.396207569198104, -4.585780621884748 55.39192587021894, -4.583342937527541 55.39140392358037, -4.578531728184241 55.39272173094263, -4.5758110038035404 55.39185325540961, -4.573398984385741 55.39371524329882, -4.570352797060914 55.39050836892753, -4.565249569046684 55.38905604467468, -4.5625243182293005 55.38671678361933, -4.560834723281691 55.390012482420325, -4.557294719543654 55.39153464569555, -4.556411896576736 55.39349026565498, -4.5511271895802485 55.39309100195159, -4.548077600577134 55.393751483993874, -4.54495009167662 55.39595418504335, -4.540308530357046 55.39487410673418, -4.536494860190092 55.39532453410239, -4.533233231366893 55.3925310946423, -4.529829254257938 55.39227082745934, -4.527648759343037 55.38948181863484, -4.523758442892746 55.38849889769418, -4.519994056167779 55.38420718434465, -4.523690693708755 55.380622539907996, -4.529578747385444 55.378042454874596, -4.531444185634409 55.376107208697, -4.537696717156836 55.37282696224046, -4.537411845617253 55.36906750130343, -4.542626240951519 55.366997680314036, -4.547164014668718 55.36403305653494, -4.551214977373472 55.36307659433782, -4.555569853046768 55.36390063418331, -4.5589772779604925 55.36231647605824, -4.558575316689452 55.36048946149856, -4.564045028552275 55.357448857563945, -4.547725327652057 55.35533467012689, -4.542383616372409 55.353792870206725, -4.534984380761721 55.35053541504139, -4.531843542452719 55.35063650595129, -4.527231907350894 55.34882191495152, -4.5256139990768665 55.34632955329336, -4.525528048051898 55.34274935989149, -4.51852071713074 55.33969859204279, -4.51534373799868 55.336478645869384, -4.510120198850279 55.33405131752169, -4.4973771211112785 55.33038907529924, -4.493586744199698 55.32828228605838, -4.4956237237266885 55.324068154221706, -4.486105057561113 55.32281242905941, -4.474145313719848 55.32517220291793, -4.471081926216694 55.321724106577406, -4.465244798428515 55.317208540061515, -4.46493850178012 55.31532262279054, -4.460802378843917 55.31623025916399, -4.448149479369017 55.312096402740664, -4.445830973203319 55.310531234557715, -4.437966168087067 55.30764049939106, -4.43740659716648 55.30473580977367, -4.449451362448821 55.30001123359395, -4.452434127607243 55.29708129312698, -4.450078472398083 55.29025230637124, -4.454192119115385 55.28876379024908, -4.454824084214534 55.28706125332632, -4.458642638124807 55.2852396521087, -4.438560201660871 55.27159436708341, -4.439828671978884 55.26822521435409, -4.441663460731386 55.26762221157932, -4.438751762678669 55.26213632496573, -4.440940421981133 55.258969004304596, -4.4356629325175865 55.25582683456831, -4.429499639191401 55.25558660572739, -4.430256399125286 55.25212979085089, -4.435111142348591 55.25007437866099, -4.440286303995258 55.246426765256274, -4.446375954608198 55.2435713081572, -4.447159071572072 55.23862439128116, -4.450215194161804 55.2373909766242, -4.44783417845305 55.23151344209903, -4.449554101222439 55.23091260426527, -4.453107273471727 55.22547853558772, -4.451937596722479 55.22264636027707, -4.4526449807026935 55.22034444545826, -4.4526241910127276 55.212214658640946, -4.454862331298945 55.210012311477136, -4.455111593307939 55.20780505742165, -4.460287947730694 55.20890512256318, -4.467116504544401 55.20456492410769, -4.471189846871182 55.19915208230043, -4.475400520702171 55.19875653689994, -4.473043775626417 55.19661110832607, -4.470067235656536 55.19599731521953, -4.466429461624896 55.192057471517835, -4.468310027171549 55.18910976125427, -4.466218896153009 55.184611003471694, -4.467685891451492 55.1832598881437, -4.4669355194652764 55.178414887090725, -4.465041640394828 55.17379340909976, -4.461860523524241 55.17021452654629)), ((-5.118623563394589 55.258258845267626, -5.114212742709051 55.25689081081544, -5.106486932266779 55.251627924344106, -5.109463676172415 55.25004353686156, -5.111216361687711 55.24778269568355, -5.117573680778287 55.2465890547978, -5.121665973931708 55.24760011313248, -5.1245602430552655 55.24966663069535, -5.124724429292928 55.252239971016024, -5.123289730703992 55.25577669824748, -5.118623563394589 55.258258845267626)), ((-4.73660607718917 55.52883485828035, -4.733471594574286 55.52819926726352, -4.731803771327985 55.525858855160145, -4.733336028301797 55.52464706461943, -4.7373891481640795 55.5258510016308, -4.73660607718917 55.52883485828035)))
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>
<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>