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/S02002030 http://www.w3.org/1999/02/22-rdf-syntax-ns#type geosparql: Geometry
http://statistics.gov.scot/id/statistical-geography/S02002030 geosparql: asWKT MULTIPOLYGON (((-3.5907769935325526 58.506094774872366, -3.5900810502498057 58.505317418432725, -3.5906982021431415 58.505112151951835, -3.59123002104049 58.50567595678749, -3.5907769935325526 58.506094774872366)), ((-3.538653350624394 58.61532193087351, -3.542056902022242 58.616491236591116, -3.544191875020306 58.61649256320598, -3.544969737179617 58.6157825826584, -3.5461768896950203 58.61621720278113, -3.5479290164173833 58.61538747174289, -3.5467621558607134 58.61503932420466, -3.549847078714711 58.613803869384284, -3.5515321731593823 58.61435304217954, -3.554840032230792 58.61301986704444, -3.5563238830250548 58.61235435336354, -3.5589245149011237 58.613297632587695, -3.5603480797831297 58.614284656473785, -3.5624310529765544 58.613944590989476, -3.561257277996499 58.61275968281098, -3.559421595535636 58.61155281941122, -3.555975215425447 58.610062814492686, -3.5564269702425 58.609769917503066, -3.553814083865352 58.60868769872441, -3.553153958042075 58.60855194687437, -3.5546663386663475 58.60692140981417, -3.55517758731087 58.606768866691546, -3.5591123868610217 58.607452516024, -3.560838985141637 58.60691416801603, -3.553662231006533 58.605695120801336, -3.5538332763031373 58.60431691645939, -3.5495246531518236 58.60355659337134, -3.548203991598308 58.6028808571363, -3.54712125372135 58.60252561214537, -3.547671553631437 58.598660241369, -3.547319484311431 58.597663728185886, -3.539038141278109 58.59834700262894, -3.5372365719701633 58.598467366023165, -3.5319368145264316 58.59798016499053, -3.5321160874610262 58.597454219137404, -3.534087497841166 58.59708171321248, -3.5340410228902677 58.59645037289679, -3.5375780172739035 58.596837464190926, -3.5446765090882186 58.59587208045234, -3.538946088557731 58.591943634341064, -3.538543091211773 58.59177779271395, -3.5421574566222667 58.58979602221763, -3.54449771188549 58.58844966617951, -3.54709978820141 58.587067139858036, -3.543556058811551 58.585586021049004, -3.5324397342458056 58.58218276898813, -3.5318482259768245 58.58278537424322, -3.5320322627732614 58.58388692331434, -3.531557975835959 58.58508846982161, -3.5302790563211164 58.58495100340771, -3.530368489666751 58.584635553630044, -3.5255823499070518 58.584934983237446, -3.525350638483898 58.58435387666607, -3.5223634622790887 58.58448810337965, -3.5219359173955573 58.58533751359237, -3.517894799884435 58.58871504472666, -3.514833268878147 58.58770479761982, -3.5138342154511344 58.58913903794483, -3.51330452642285 58.589409654297434, -3.511849695487838 58.589184251218946, -3.5104941709084865 58.588775825431746, -3.509666378301614 58.58946050530093, -3.5102137761231487 58.58963281482696, -3.5084015639713058 58.59128226795401, -3.5083052656004963 58.591570295048996, -3.5049027871783673 58.593667139245476, -3.5036048170587195 58.59429312979299, -3.5041514272307506 58.59460111720554, -3.5074624079410746 58.59597256139659, -3.5103629752438827 58.594204914755046, -3.509732653002743 58.5939518308845, -3.5110335979848566 58.59339760156719, -3.5115285405404846 58.59287137921065, -3.512515769749622 58.593056794425316, -3.5147238938871115 58.59199782658727, -3.5172201434419907 58.5916360363217, -3.519153103576735 58.59235495634974, -3.517250265080781 58.59304681408291, -3.515259247421151 58.59347630469184, -3.514442043022558 58.593875771141214, -3.5137196366129784 58.593921108350415, -3.5134942754641774 58.59439982823511, -3.513170577566219 58.596585458684494, -3.512416405485711 58.5978491719083, -3.509028294760572 58.599289340860864, -3.5072437105899863 58.60044744424001, -3.5055801280892562 58.60194094302705, -3.505093000946638 58.6025394823796, -3.503516950913818 58.6031498612029, -3.502302818605913 58.60341196768486, -3.5001028183725817 58.60492692944593, -3.4977843971439464 58.60532762550967, -3.497110186357789 58.60570105934208, -3.4945045201662057 58.60630983722404, -3.49365573999384 58.606748157900505, -3.491798723168827 58.607317640316765, -3.489771501820132 58.60829776314623, -3.4887459366061053 58.60822431041061, -3.4871179502960308 58.60892131530097, -3.4853216092582833 58.60905974806997, -3.483118674543128 58.609758850939045, -3.4815846663694616 58.60963012517207, -3.4792865950592167 58.609220944306635, -3.4773394019937176 58.609293633538385, -3.4772445346814296 58.609615391362595, -3.4758430325924614 58.6100159280754, -3.4747435939732942 58.609905485844784, -3.4724653934877026 58.610499276532735, -3.470921531670386 58.61062742962868, -3.470410263649054 58.61107790023809, -3.467272773042497 58.61142183391375, -3.4660534291011524 58.61128484048363, -3.4623021242933483 58.61185391855702, -3.460840879450446 58.611612737699126, -3.459903844927198 58.61238327917531, -3.4585582891717928 58.612315912724334, -3.4569540533790764 58.611989181863, -3.456471961557463 58.611573376013624, -3.454013297749293 58.61106496259667, -3.4522380929467835 58.61022452598503, -3.4525533481000785 58.609234714253084, -3.450446201688851 58.60848063992385, -3.4492926660207757 58.60847388700984, -3.4479853887384992 58.60878682655056, -3.4444422164585693 58.610228807036464, -3.443204553496902 58.609936411075665, -3.4396663564661027 58.61037668399227, -3.4388238030449867 58.610775943565464, -3.437002863909406 58.610531332045895, -3.434867102475285 58.610374641383096, -3.4336923202430065 58.60980839341609, -3.432646498640866 58.608943386868496, -3.4323051016421333 58.60838220938401, -3.4343318490652908 58.607141626911805, -3.4350017484848614 58.60660420086406, -3.4355796068561437 58.60655104233456, -3.435714555645929 58.60556059296056, -3.4346158859143996 58.60378180249526, -3.432414380986433 58.60289106204457, -3.4310443972721534 58.60255241974339, -3.4288873106073003 58.60274617683545, -3.4277127747816385 58.60319037202135, -3.4244991474857662 58.603770341821225, -3.422710631486037 58.60346499087378, -3.422128902079238 58.60295584890908, -3.4183087833785515 58.60220312589694, -3.4176903616040604 58.60180574835169, -3.4165480433681976 58.601517436913404, -3.4138681349104396 58.601293640678634, -3.410304804436445 58.60122499461724, -3.4073170345335635 58.6014751052621, -3.405282298172096 58.60201743117675, -3.4037182913738593 58.602283323990484, -3.4029160098575932 58.60214657035825, -3.400744165623361 58.602361572609844, -3.4004973041546482 58.602213361758444, -3.3984357485702885 58.60238939830972, -3.398191403578413 58.60204534465228, -3.395025185778974 58.60179410857522, -3.3926231603016404 58.600851875398796, -3.390177714708675 58.60011306418763, -3.389407200501912 58.59973336541033, -3.386966121170045 58.5993618164584, -3.383914129529208 58.59842194276233, -3.382856739757702 58.59826984684963, -3.381612609644284 58.597702080132294, -3.379991276434031 58.59664343590367, -3.379398860092676 58.59584409687075, -3.3788468760774806 58.59559043528237, -3.3771305938958767 58.5954381732515, -3.375814727689178 58.59461602750727, -3.3740293724181596 58.594280330130935, -3.371649875563082 58.59458868038126, -3.3690437321060207 58.595130240827935, -3.3683525441084816 58.59536305155784, -3.362318914596171 58.597987037786794, -3.3584754317164287 58.600266049897535, -3.356978172849868 58.60137318698814, -3.3555471099358645 58.602192181142726, -3.3548466762461038 58.602325313847594, -3.354673669727754 58.60341396906296, -3.354022870121324 58.6043863986199, -3.3522348666139843 58.60599504456399, -3.3509788433135403 58.60756663823975, -3.348635932315058 58.60974693077954, -3.348136858798018 58.61009614700613, -3.324924920934127 58.606606323553876, -3.32436508974962 58.607276761419136, -3.3036390099588755 58.607192174452436, -3.2923889423114603 58.604566247582525, -3.3016357978978306 58.59960472072167, -3.3014530806796545 58.596076643979345, -3.297093808991286 58.595447055090695, -3.2986418325889346 58.58429373574844, -3.2915745575357804 58.58401707162349, -3.280741530026186 58.5795244592707, -3.282762240545273 58.577139317683894, -3.283317827441908 58.578098796433615, -3.2837392802144163 58.57832791229865, -3.2914834028319615 58.580009596549814, -3.294088479807084 58.578366627243696, -3.295126461684532 58.57760168077938, -3.294614564174504 58.57631342826157, -3.304508171773558 58.571381034845146, -3.2944811324523258 58.56804232782034, -3.295850837516802 58.56649258376308, -3.2993484119434506 58.56391535022275, -3.3111971908844766 58.56633688124161, -3.310220840462743 58.567352841214216, -3.3162391335917887 58.567381147175375, -3.3238705966617275 58.56915304642165, -3.324884477858633 58.56868450959952, -3.327497212360182 58.570031799739716, -3.331846752596134 58.56685203759606, -3.3329705168299384 58.566112824702245, -3.335156534657088 58.56392544842478, -3.3435471084003296 58.55588879658527, -3.340887472109846 58.55330278918982, -3.348217076874686 58.5526332434453, -3.349352393671252 58.54998057165388, -3.3509896731924207 58.54698128674258, -3.3501798880104 58.544690371588544, -3.3658212392064013 58.54220757516732, -3.366170190352902 58.537048088174394, -3.37015267590777 58.53653858167618, -3.3713489575885434 58.535941968387924, -3.3712837613625153 58.53515223096445, -3.3718905596254944 58.533537934847374, -3.3725159618364 58.53283961239867, -3.3734100778828373 58.532425861291756, -3.373408836370796 58.530198286434114, -3.3723285790418593 58.527604995927994, -3.369669344134295 58.525468680222026, -3.369293866560465 58.52420619365373, -3.3738319866925472 58.52213670998678, -3.370054385672687 58.52081178420753, -3.370152813284435 58.52025383611804, -3.3681010484390304 58.52047332783209, -3.3671834132325844 58.52027651323477, -3.366907651703361 58.518042878272645, -3.3650716938128666 58.51630190136189, -3.365067020056205 58.51485581414103, -3.3634631710412317 58.51466626983456, -3.352941850856377 58.50802298392646, -3.3518196992341904 58.506067705250054, -3.3529833739737898 58.505534474522754, -3.355638732068344 58.5018506908558, -3.3543638541247343 58.500316218620526, -3.3548946684202603 58.499909407276164, -3.355077911266108 58.49914308535495, -3.356733278988654 58.49878408985092, -3.3573944795136934 58.498428497103234, -3.3590013077666865 58.49916536823128, -3.3628356299570266 58.49759772323778, -3.363482057717173 58.497896252165454, -3.3692579297832195 58.49552631134301, -3.3729946403104702 58.497193019404584, -3.3742017830463937 58.49647048999224, -3.3763771924659203 58.49579112745767, -3.3791327811295133 58.49467717335399, -3.3807585294552105 58.49534455122306, -3.3814109943086357 58.4948333984605, -3.380503553724584 58.494405611428405, -3.382591044495236 58.49266389142854, -3.381550370589835 58.492232786954574, -3.3768858413788845 58.48921099172395, -3.3753053007438396 58.487395560917236, -3.375690766639256 58.486286608588024, -3.377220001074824 58.48503962934059, -3.3762314384906045 58.48432267357042, -3.376195202802722 58.482957764971644, -3.3758469401696116 58.481946494003765, -3.3735944317902056 58.48091970631731, -3.3722457289936445 58.48063772575028, -3.3681665695565948 58.478938736604235, -3.365206368401383 58.48043438462482, -3.357734674718388 58.477468700386865, -3.3553062290088818 58.478976453207245, -3.353250351003472 58.48081257159154, -3.3429704115899592 58.477480411046244, -3.3444980316368667 58.476170966615435, -3.345899060564575 58.475141280774544, -3.3424635138257024 58.473632339479785, -3.344689557866286 58.47175868006433, -3.348414772872463 58.46874644582924, -3.3431454896242125 58.46589149027856, -3.3427631304370804 58.46260799154888, -3.337321683304364 58.45879350552077, -3.340800949476413 58.458343989146194, -3.34822700965615 58.45802360371944, -3.3571671122903144 58.45785743487718, -3.3641401547573917 58.45248389665616, -3.3641183439640643 58.45147810214038, -3.366094542876319 58.45073847681955, -3.364205306921661 58.45018372544553, -3.3621072442502538 58.44910120965982, -3.3636409792153423 58.446228532772864, -3.361487574360069 58.442820179268715, -3.363027235106139 58.44054924867057, -3.3625810974743704 58.43875753793701, -3.3679958171136097 58.43703813544523, -3.3694154564928254 58.43786731536509, -3.3729187887658836 58.43721904127877, -3.3742124122147583 58.43788783648669, -3.375700174512363 58.43694669691127, -3.3794641888038153 58.43727452010291, -3.3808887008151918 58.435597456114145, -3.3832704644903755 58.43518552416593, -3.3842358479697094 58.43316305395354, -3.387825771261793 58.43168705409601, -3.390642718302814 58.42972531027331, -3.3946895696854154 58.42812738337228, -3.4003489131867415 58.42531705759339, -3.398567527781325 58.42400711631078, -3.3970384550833415 58.42171531935124, -3.3932873900585947 58.419510560968426, -3.389943365339127 58.41676233707887, -3.3864363367400037 58.41203068414523, -3.383459868750559 58.41164068629167, -3.382376233891602 58.4110685277933, -3.3793693482516547 58.40814573207421, -3.37800774806667 58.406148331039994, -3.3769933196693662 58.404272938101656, -3.375309503127514 58.4027819858792, -3.374964473430264 58.40095328315759, -3.408651913216056 58.41798623212906, -3.4122158441691868 58.41464146849437, -3.415743287406869 58.41424324318552, -3.417534970013489 58.41069334180894, -3.4176415894032317 58.40780878711006, -3.4217580903157425 58.40675713397217, -3.4222355051744704 58.404164885777575, -3.420271671755057 58.401716496653215, -3.420803931705859 58.39836013423392, -3.4204803216099835 58.396270807986944, -3.427049537330979 58.39540732801721, -3.430761542561381 58.394548510177664, -3.4370247828060667 58.39080454788231, -3.4438927944013518 58.38724208379982, -3.4507755587785662 58.38323892818119, -3.4565291394017055 58.38050579664937, -3.4638465928000577 58.37880549076125, -3.4699584655548046 58.37773840572038, -3.4726524124330194 58.37672834810688, -3.4778790850362036 58.374135033584665, -3.483335322767784 58.37091903916715, -3.490842113982021 58.36811010690298, -3.4944118579342383 58.366415680148556, -3.496676905571478 58.36177213668709, -3.498096054607912 58.35774927009147, -3.499631667828919 58.355674257451184, -3.4965352622502865 58.352368948563026, -3.502321194306983 58.35099868323048, -3.5043360476415653 58.347750223419915, -3.5011012207433683 58.345605416334806, -3.497930146323613 58.34334300856135, -3.495728517891801 58.339757724899584, -3.4939259799239974 58.33833257153985, -3.4983543529911514 58.33440026909208, -3.502911351766099 58.32990038251575, -3.5003874945123012 58.32756755572207, -3.4998381187854215 58.32628947097942, -3.503120029898868 58.323151914520686, -3.5060232410053307 58.32115953358093, -3.5078393075432026 58.320105125132606, -3.5112032050196356 58.320918786609006, -3.526502313232345 58.318186009449136, -3.5381908713574206 58.31687822466836, -3.550385677459279 58.31545542665724, -3.5702194263307403 58.31925574885944, -3.586194131689564 58.3233344918215, -3.5956762269581315 58.32043186333846, -3.603353085411737 58.318413521003514, -3.6093064151945184 58.31717995718436, -3.613924790992425 58.318127852689834, -3.6161396276501003 58.319150889992095, -3.62361744203437 58.32026888525746, -3.6327166749542754 58.32173406229173, -3.6408061881066884 58.31834277595223, -3.648322541893844 58.319907987443194, -3.653338100216632 58.32092121557835, -3.6535246283078533 58.31504391326445, -3.6662717525772655 58.31095288326247, -3.6722661907460803 58.308853450313975, -3.673385797244884 58.304733542163675, -3.6711336327919994 58.302211803467095, -3.6716410477428547 58.30066906551702, -3.6697495883439797 58.29674122811909, -3.6693695076109365 58.29519211937872, -3.6730965737551746 58.29282576427987, -3.673790041491727 58.29125363860559, -3.6777716365247985 58.28923413923588, -3.681065962842463 58.28424116715802, -3.6852683411720246 58.281868185717784, -3.693148386382147 58.28224015367131, -3.7001510611716117 58.28316229931227, -3.7000956280292883 58.27951586585528, -3.7003397275313015 58.276781746628096, -3.7007858705991663 58.274350355653375, -3.706068296038035 58.272150935080916, -3.7125020429282554 58.2712114808199, -3.7152737122710633 58.272467890519124, -3.722335876909311 58.27218426151183, -3.7304269848253173 58.27342244571626, -3.7357483732888968 58.27414979127299, -3.7411388835026926 58.27245948018312, -3.7454271305182814 58.27090077907185, -3.7544800615593594 58.27123496863811, -3.7594216051898703 58.272550449401095, -3.75953676925299 58.27280937937888, -3.7651148481107914 58.274915400870476, -3.7700940632704087 58.2762838645436, -3.7754504373850457 58.278365564205345, -3.773492662926727 58.282866435688874, -3.778572815460503 58.28383791318832, -3.7816663275310423 58.28532199672632, -3.7891970502095673 58.28616904338731, -3.7914941822934978 58.287071137616245, -3.7922402124297347 58.288668698844205, -3.7982143119603156 58.29008502137289, -3.803499340654382 58.28901341546674, -3.809261600402488 58.28860858812438, -3.816154738497921 58.2883042220229, -3.8230293540692952 58.288305183348584, -3.8291476397756696 58.288855605247434, -3.835044092391993 58.28742358030776, -3.83581576929739 58.29441958218334, -3.832050550227142 58.29650384858058, -3.827227120292137 58.29792937169615, -3.8219134776762713 58.30011629178824, -3.816966094803691 58.30147132720016, -3.80754502801176 58.30244929450124, -3.7974745339327813 58.30409147752362, -3.7955866338614985 58.307585567939974, -3.79517346867687 58.31054688277543, -3.79642669057471 58.31237086572165, -3.797953859342616 58.314208952653715, -3.7975872495410408 58.31741216870757, -3.7985857472886893 58.31858392932658, -3.8017203110980904 58.320462242846794, -3.8023319259297317 58.3230857399487, -3.8042515439902806 58.32691252310602, -3.808088453218989 58.32647206357854, -3.811383460371128 58.327790913925654, -3.818052140635548 58.33061589805429, -3.8203530555884333 58.333844133816754, -3.8240935023234077 58.33549769417904, -3.825879279089323 58.33998186556328, -3.8258554981859 58.3431623114844, -3.8255734990518944 58.347298674622984, -3.8237092020132977 58.35057722607436, -3.818773811081136 58.352965162397915, -3.8118548375040833 58.355345074666495, -3.8082351068065075 58.35875601092134, -3.8104666508368705 58.36061095607824, -3.8084263196008066 58.36349647642834, -3.8009849901612998 58.36909916022914, -3.8060771717547177 58.37071627341053, -3.80631480912902 58.372689248928864, -3.8063015870276455 58.37644443177428, -3.803494107847344 58.38074207291338, -3.796529817079363 58.379330794501875, -3.792645753821473 58.381316628387765, -3.786298062336869 58.38498964305572, -3.7787170596292365 58.38763741637042, -3.7737289826417357 58.39050037184774, -3.774001867619326 58.3925267891479, -3.7749876840742616 58.39580097072339, -3.7764918760332584 58.40019085202809, -3.7842334516919585 58.407772846877066, -3.7875392699481356 58.41255072719089, -3.7845241342627043 58.416904681594715, -3.783773435343201 58.41864889443579, -3.783624382191137 58.42077996903733, -3.784316030848977 58.423959350839695, -3.7840346181639544 58.427197212839154, -3.7843747508460437 58.43053420832273, -3.788031731539355 58.43172291250085, -3.7932264474119384 58.4331684851662, -3.798479008327347 58.435403558079685, -3.797283009627679 58.438151218253154, -3.792914180844399 58.44150922335673, -3.7912209689723104 58.44561124401054, -3.790442126228017 58.44815536991876, -3.793552534777319 58.4503486925226, -3.794177663020246 58.45353794329123, -3.7919377909015006 58.4570098090387, -3.790782837163001 58.459577153217126, -3.79161116827611 58.46473986892496, -3.7918348033392117 58.468797103930925, -3.784999693366169 58.468578016320876, -3.780721807626961 58.47145817912875, -3.783491303884745 58.47332410981991, -3.782975350358519 58.476340617821265, -3.784440397619051 58.47783838489485, -3.788778129090798 58.480850180880985, -3.792485136641122 58.483924549048766, -3.7912509844389577 58.48528925273389, -3.7911931432442456 58.489206687298214, -3.7940776237907246 58.48958858608861, -3.795219677942269 58.49213279133499, -3.7962321644455144 58.4954962622209, -3.8011063958012716 58.49886845677174, -3.806244891133713 58.5020211586057, -3.810350112191232 58.50542180348778, -3.81194619975478 58.50941472668126, -3.811141553297432 58.51212101622611, -3.810789922686456 58.51762363396091, -3.81567272066987 58.51609040808346, -3.8184632662246116 58.51693124647965, -3.827252626863134 58.51690523204902, -3.8269168087133663 58.52068292687672, -3.827431123982732 58.52462818096911, -3.8315174944785264 58.52625877126723, -3.836118567478825 58.528528659795256, -3.8356053546342834 58.53053923833606, -3.8368758042085847 58.53184158804832, -3.8394282745555817 58.53466168110209, -3.8427915525084475 58.53786534976266, -3.843608329988266 58.54033297174206, -3.8473269812524595 58.54145631791335, -3.846924975946305 58.543285679328676, -3.8510213098963098 58.544394505966736, -3.8518546947824417 58.546511497510686, -3.8574137085640787 58.548946498121325, -3.860647896856932 58.55759483447807, -3.8582236036437765 58.56389524623407, -3.8568507061562003 58.564773967077016, -3.8557281599770303 58.56532917660702, -3.854731760268371 58.56518187024542, -3.8544849323401724 58.565553742252426, -3.852117732601824 58.565331874625, -3.850277891129509 58.56451397421147, -3.84944132165914 58.565114415730584, -3.8477163066269973 58.5653323762709, -3.8466579093913102 58.565639546658616, -3.845370917321476 58.56503371464425, -3.844023609727041 58.56605917037357, -3.8445663577209963 58.566244515168435, -3.8441571906155527 58.56696454677494, -3.8422773143992197 58.568491697522, -3.8410589522128773 58.56870230011194, -3.840270484693701 58.56907741248528, -3.8395882539752098 58.56869192715337, -3.8382688989507057 58.56861649022383, -3.837365316388644 58.5687641628549, -3.83532294588822 58.56834420236285, -3.8346139740340153 58.56777491997577, -3.8335285396275474 58.56740414375667, -3.83340403742091 58.56814702494552, -3.832944917838219 58.5686727984259, -3.831497657723886 58.568353878921464, -3.8311209930104844 58.56871407977305, -3.8301235784182417 58.56887651317061, -3.8299421472177904 58.56918901365114, -3.828772516025843 58.56901702420372, -3.828978019851691 58.56850655517404, -3.827696201367759 58.56816098345647, -3.8250481103970406 58.56815820642624, -3.8240610490233453 58.56851986951014, -3.8234885276480375 58.56838875975269, -3.8231024745496085 58.567610916126064, -3.82125379382082 58.56810156180625, -3.820353138577142 58.569101564343875, -3.818102959222114 58.56914690299192, -3.8176209985262335 58.569402553084984, -3.814875997242575 58.5698545800087, -3.814581944256026 58.570020428302726, -3.8103903916602593 58.57073262851987, -3.8078589408584884 58.570761088944096, -3.806589035607822 58.57154520377919, -3.8065375861147297 58.57194836636096, -3.8053849758576233 58.57213973695249, -3.8036680839813295 58.57276122151385, -3.802174157078417 58.57310467531268, -3.800764192174143 58.57364366242003, -3.800113510616189 58.573262918375484, -3.798125259034345 58.5728883217199, -3.79691638866694 58.57285582817349, -3.7956782269611575 58.57208353420819, -3.794259292560397 58.57194435925679, -3.7938624901060605 58.57104531329652, -3.7938610398027297 58.57000869658093, -3.7935155783373933 58.56944040502825, -3.7938595207601424 58.56876906506828, -3.7938206510311456 58.568042883763084, -3.7933929158723703 58.56764731582491, -3.7944936922146915 58.56674711942658, -3.7938710063555336 58.565666178727106, -3.7922105475410746 58.56449641334757, -3.788905638969891 58.56347530021156, -3.788516028672306 58.562780052347065, -3.7873911817184287 58.5631747907049, -3.782285300052397 58.56348108742633, -3.780311413913133 58.56371327037153, -3.7781801163111193 58.5641982264379, -3.774708060833262 58.56570866533832, -3.7749803968009172 58.56650348728792, -3.774945159484332 58.5675397084701, -3.7758255210381515 58.567913809157716, -3.7767764375590076 58.569035208213606, -3.776934283412305 58.5704873651104, -3.776312411086883 58.571381683535954, -3.776265600131819 58.571985086583204, -3.7754091300536023 58.57276406832873, -3.774174054062243 58.573334478553264, -3.7728224425839927 58.57367562301714, -3.7723072624233485 58.574234282846696, -3.771480806155776 58.5746570987258, -3.769351327260429 58.574955030758375, -3.768512125080992 58.575603474020845, -3.766771366586325 58.57542620474168, -3.7654539683030848 58.57603988056382, -3.7629624822429912 58.57642622008254, -3.7624531917048607 58.57672964298334, -3.761370705591739 58.576784011307154, -3.760511812903295 58.57718114902974, -3.7607460871818077 58.57753096717404, -3.7587847640322307 58.578306104265735, -3.7574622267468656 58.57820472739492, -3.755340047890003 58.578964045057866, -3.753738240661728 58.578609533814706, -3.7516698689173613 58.57893328390786, -3.750376142739318 58.57882335672674, -3.749551344672324 58.57925229350079, -3.74921933552488 58.57994041065791, -3.7485645471206652 58.58005442216743, -3.747570139757965 58.580877306880716, -3.747266126343481 58.58147251405172, -3.7455928754622665 58.58241240556942, -3.744067214493592 58.58265589608204, -3.7423552754570806 58.583131855314136, -3.7408917827473407 58.584039196030304, -3.7391812119607732 58.58548074980507, -3.7369425750107417 58.586440750833596, -3.736391276942974 58.58708418600985, -3.7351399734382835 58.5874190790156, -3.734140870806282 58.589652222860096, -3.7335894317995684 58.589356042544296, -3.732753965331376 58.58943917194572, -3.7316536763090284 58.590081901339424, -3.731159842891711 58.59129943898367, -3.7289183553795624 58.59221352045769, -3.7283140972357085 58.59328790773481, -3.72751682605741 58.59331030368214, -3.7265768878198338 58.59389424042298, -3.7244897961875383 58.59448997306313, -3.723919962977926 58.59497370576661, -3.7221395456930626 58.595299394849164, -3.7219302997651114 58.595698339669184, -3.7204056997336084 58.59618855520831, -3.7197553960092793 58.59682246002036, -3.718795635896359 58.59690177005316, -3.7174499529172214 58.5975332816817, -3.7165407915154463 58.59759213646521, -3.7147087702545507 58.59890651573992, -3.713726908365416 58.59913339970093, -3.7116678185568506 58.59900992413343, -3.710757654103358 58.59933104785986, -3.710034571779499 58.60027667358949, -3.706966372805424 58.60162444439767, -3.7060431957567253 58.601680715144646, -3.705445655438637 58.60132035097368, -3.7046040808856433 58.602133673261996, -3.703391972604848 58.60247761069498, -3.702192858672594 58.603230977711725, -3.701588992162603 58.60334227374215, -3.700407374085061 58.60438643270979, -3.698899940947109 58.604321924867925, -3.696934338122634 58.6053512571286, -3.6953497996133597 58.60518801681551, -3.6944397972690903 58.604629610892, -3.6935948550091346 58.60502430727845, -3.692413421995629 58.605188080739396, -3.6919141032116745 58.60557641879238, -3.6901108620841394 58.605767216391136, -3.690059601169884 58.60623858470429, -3.68671693869783 58.6068106671719, -3.6851011861783904 58.607930440336204, -3.683632815691834 58.60792901766439, -3.6823985598177176 58.608429342502994, -3.6797402540707753 58.608526081780056, -3.679114014649751 58.608317779290786, -3.677688640929122 58.60889061910593, -3.6770946242723452 58.607737805863906, -3.6756674822402498 58.607266858267806, -3.6747886111706465 58.607353764794205, -3.6743905886350365 58.606877477335175, -3.673533700179911 58.60655986834071, -3.6727826126135295 58.60661904803124, -3.67142057077158 58.60758174061232, -3.671861364813247 58.607981128007374, -3.672120189910469 58.6090754451221, -3.672021686687494 58.609752223398026, -3.6714994029138746 58.61071117792089, -3.6714515611304255 58.61158401735169, -3.6723340224536436 58.612795084143315, -3.6716668723384567 58.61432632219717, -3.6701552376431974 58.61486696058271, -3.669262946785227 58.61575974668483, -3.66930239593431 58.61651467636835, -3.668716332881048 58.617222930744724, -3.666981820065167 58.617317289615535, -3.6666069988395837 58.61776229821902, -3.665647317987259 58.618219374094345, -3.6635340354726518 58.61867789754113, -3.661605432978645 58.619219334649394, -3.6615352950794304 58.61973674276559, -3.659901884176333 58.61996892944186, -3.6582247525383074 58.619460591712844, -3.6568932227993067 58.61952266828545, -3.6551006986713475 58.61995895295543, -3.6530047888257005 58.62013412508398, -3.6509949957131864 58.61983567156085, -3.6501798262270397 58.61905386796831, -3.650322548845911 58.61868464728451, -3.6499246810555057 58.61787862242881, -3.648479244677435 58.617458808994364, -3.6486326381032166 58.61673104696162, -3.6476003462432907 58.616527796989125, -3.6471137842576336 58.61687177679184, -3.6462105184890885 58.616995626510054, -3.64501714105346 58.61673513280024, -3.644152249898876 58.61694291361419, -3.641166430383634 58.6157252885997, -3.6403394360115957 58.61519868153624, -3.639413140554769 58.61523474799097, -3.638716772097431 58.6157322780421, -3.6360670967719075 58.6151066965556, -3.633688680008662 58.615348027889425, -3.6312977140341016 58.61506219649671, -3.6308891113069475 58.61486527154337, -3.6295165256865918 58.61496710976312, -3.627457340083284 58.61578006270862, -3.625713532200444 58.61563774060407, -3.6223493941171583 58.615750293814024, -3.6215436852998737 58.61627156470078, -3.620202910858765 58.616467218545736, -3.6191364621972024 58.616340523549816, -3.6182148095441335 58.616626991717666, -3.617266630955624 58.616190691199186, -3.6149586223333303 58.616320303519004, -3.612789927754558 58.616895457732504, -3.6119229629829235 58.61653894254776, -3.610068017391715 58.616599908751866, -3.6088184055367547 58.61679520003743, -3.60835472205382 58.617120778795595, -3.6072728489818764 58.61699507677779, -3.605659742212037 58.61748681224628, -3.6040630921017285 58.616873471117465, -3.6031891056256202 58.61711342499734, -3.600764022338014 58.616981951637115, -3.5998319604308664 58.617307939363954, -3.5985340220602464 58.61810555974152, -3.596190423284325 58.61787417916963, -3.592659959657957 58.61880273056327, -3.5906286864130497 58.61900303107816, -3.5894850330932018 58.619412402081885, -3.5881083053707687 58.618670391098085, -3.5879719582613148 58.61832175769543, -3.586586847486938 58.61777295795926, -3.5845690128847294 58.61769903133078, -3.583991785482702 58.61806993361768, -3.5816056497440423 58.61879993732211, -3.580706625076667 58.61852804348544, -3.5799955060319855 58.618604151413884, -3.5796591523212133 58.61935382913104, -3.5770788963142643 58.619601078400535, -3.5755181975391306 58.61993010423892, -3.573768745291309 58.619700017101394, -3.570283628012118 58.620313007037495, -3.569221815069078 58.620249617462306, -3.566338271058061 58.620648561028254, -3.565121850680325 58.621170879495274, -3.5630770588417 58.621267608947, -3.5596606358241196 58.62188396448604, -3.5579703084503187 58.623561711402985, -3.5561038788318005 58.62360676454098, -3.554824341531934 58.62290813791617, -3.552889017154495 58.62237012038987, -3.551348406277293 58.622577344926974, -3.5496908211797455 58.62305992402162, -3.548591963667573 58.62352228109168, -3.546079256684252 58.62316626977162, -3.5458624155309613 58.62390992470927, -3.54480953645257 58.62385520812815, -3.543572267835141 58.62352424183267, -3.5435513851111016 58.62324603810749, -3.540902943489364 58.622738854532315, -3.5392127565672653 58.623266599995745, -3.5383498647036564 58.62283229638522, -3.5372359466612284 58.623151017325696, -3.535324585422809 58.62276066033162, -3.5354791655309215 58.62235909869164, -3.5370786938810577 58.62094322941303, -3.536813435312632 58.62019637009728, -3.537237568114389 58.62005207372038, -3.537203259649538 58.61927101577253, -3.537588030648847 58.6190149087286, -3.5375906243308637 58.61809418236102, -3.537896972837389 58.61734677663561, -3.5383481901054035 58.617153647377016, -3.53829938418553 58.61635659434843, -3.5379389090762072 58.616028557475445, -3.538653350624394 58.61532193087351), (-3.601139485683074 58.5358028400442, -3.6012069466147296 58.53550799743882, -3.6026726629356904 58.5351457660279, -3.60313028582743 58.5347887424833, -3.6039957168564043 58.53527476355253, -3.60543997499004 58.53537573332945, -3.6071294914793914 58.535156709867756, -3.6067896234740764 58.53463278429494, -3.60772135613649 58.53370713732537, -3.608469848950287 58.5333531885967, -3.6091037426988084 58.53259402726178, -3.60862143556155 58.532151567450114, -3.6089646251032343 58.53064114669779, -3.6101194311400193 58.530362759202745, -3.612280254918011 58.5291512787966, -3.6145946181167448 58.527995408619006, -3.615170442637235 58.52731536391428, -3.615110621516601 58.526219871996275, -3.6155231634442417 58.52544423778416, -3.61402266010084 58.5254900597344, -3.614924598488936 58.52475112082499, -3.6138813675464307 58.52428366753656, -3.614939558218157 58.52395596647528, -3.61495698497617 58.523221952973884, -3.6126728846676937 58.52227326354253, -3.6115527368238483 58.52237266611946, -3.611246928989735 58.52188245835475, -3.612341866576235 58.52160821297375, -3.613158764089057 58.52088831901915, -3.612879305859209 58.520411257830375, -3.6119612251972404 58.51986137329374, -3.6107308619725496 58.51942768469851, -3.6105582534740654 58.518845977202396, -3.6098062902584522 58.51817272732857, -3.607692826375486 58.51813633697316, -3.6060029748688307 58.517789202028396, -3.604378659752033 58.51699658444289, -3.6032477085709522 58.51610346739711, -3.6019505885773246 58.51570646071607, -3.5998440231970803 58.515818069952, -3.5989448513957596 58.51680838280397, -3.5975094568967156 58.51657923279321, -3.596763299019459 58.51602710204506, -3.595660275063654 58.5159330274276, -3.594684540772163 58.5156172873285, -3.592577821237554 58.51534701708913, -3.589923852203467 58.514553517276674, -3.589566638435156 58.513677643801486, -3.588850000646427 58.51339458158826, -3.588111295912935 58.51186320286542, -3.588393039278692 58.51088060941948, -3.5878122944945097 58.51056442069445, -3.5883712448454115 58.510018546321646, -3.5877909201955807 58.5097113350057, -3.5862994216056845 58.5097522352089, -3.585489346751693 58.509488275004834, -3.585430885700492 58.508572768981296, -3.584702755236885 58.5072702979504, -3.5868099405711713 58.506992747085896, -3.586000199017746 58.50654464234609, -3.5867819075613587 58.50599152982897, -3.5886045584247226 58.50701545797862, -3.59010783048885 58.50837567611543, -3.591316585841244 58.50758818666551, -3.5932249764589272 58.50765882697284, -3.5941021362235905 58.50732006782492, -3.5939735640496964 58.50675575790929, -3.5960535190782466 58.50606968188922, -3.5959968281842936 58.50519906940316, -3.5970630006096704 58.5046782852177, -3.5983068179914253 58.50315820397633, -3.5972481152640365 58.50270877879269, -3.596732174329603 58.50211785270325, -3.595536516306914 58.50167460913964, -3.5949404735046127 58.501964972559875, -3.596044584528152 58.50322678227801, -3.5949899358519826 58.50324438638569, -3.5936493438123183 58.50244362036123, -3.593287594451944 58.502034910306975, -3.591842638862522 58.50176988949978, -3.591310208611584 58.50232892618446, -3.5916186536320387 58.50269788086234, -3.5910502327596996 58.50341006765912, -3.5920702663488644 58.5039543410457, -3.5925903917623145 58.504828186849956, -3.592256205771582 58.50540722319678, -3.5910275633344693 58.50518442147639, -3.5910183057153064 58.504600664257005, -3.5901985206704965 58.50430990667561, -3.5891890450699475 58.50475806991616, -3.5872636022361863 58.50487621717149, -3.58596072759525 58.50452852853226, -3.5827965797702706 58.505151464661736, -3.5820333223974847 58.50420871756685, -3.5815326765180386 58.5045247892134, -3.5806390102182135 58.503924981056905, -3.5786245942594808 58.503567117416885, -3.577679060286742 58.50376019442363, -3.576278467053653 58.503794472845556, -3.5755541694266655 58.50363988387403, -3.574692683698532 58.504330441928325, -3.5748224092267495 58.50477438772106, -3.574233914419703 58.505391527584145, -3.5750227328305444 58.506410896955835, -3.5743008951876467 58.507040452338906, -3.5750255274412903 58.50781394660695, -3.574832638860271 58.508795418165974, -3.5742489567421574 58.509444835554554, -3.5746125449479487 58.5097062603967, -3.574819303830208 58.51079250534011, -3.5752690713078024 58.511256686291325, -3.5756239054209766 58.512409649720865, -3.574670553246628 58.51264842996929, -3.5744067777008763 58.51323625368841, -3.5734948951333783 58.51372710696628, -3.5730450908278404 58.51422872941795, -3.5717061257321676 58.51426085195897, -3.571777836859066 58.514712696641766, -3.574584351920919 58.51454050497929, -3.5755481896181154 58.514863728418575, -3.5773227818947593 58.515808461210234, -3.5779251144805304 58.51655586624919, -3.578545177000393 58.51669609586819, -3.580949348391399 58.520094270187904, -3.582243307003104 58.52089942746279, -3.58572719124689 58.52435399786222, -3.5877335288508347 58.52627159948051, -3.5884107997713377 58.52731140256634, -3.590489639437715 58.52956383578036, -3.591655177478733 58.530353604973946, -3.59312459308627 58.531548302630796, -3.5958397716840578 58.53430871649263, -3.595941304986844 58.53460388087821, -3.5972804663388427 58.535718589487644, -3.598688945790144 58.53567141788063, -3.5997285513451924 58.536493674016874, -3.600399711011801 58.53638093238642, -3.6013138273410363 58.5368986122386, -3.601139485683074 58.5358028400442), (-3.6457301234838067 58.48842438793399, -3.646317279852205 58.48804945880314, -3.646028242833075 58.48751824315756, -3.646888936735268 58.48685639446543, -3.646752131903917 58.48515052365709, -3.6460983149678174 58.48474121556229, -3.6463073129625814 58.483525857700634, -3.6461693873833143 58.48277756517607, -3.6455946111205195 58.48222351586988, -3.646246124028954 58.4809351090784, -3.6457263817622505 58.480236988832964, -3.645785811086391 58.479487151601106, -3.6463928839348525 58.47912319338776, -3.6465445129809475 58.477796824225976, -3.6457957253766433 58.47717260840015, -3.646134817759916 58.476539461451694, -3.6448007988821627 58.47459832667042, -3.644264725950055 58.473162563597555, -3.643893059184989 58.47274953817554, -3.643136666435313 58.472634909096044, -3.6424400151415965 58.47104444624015, -3.6417688959522785 58.469889767516946, -3.6410395699476634 58.46950835045426, -3.6404610475075505 58.468838000239465, -3.6375372970289646 58.46922524565943, -3.635599079534974 58.469946144948615, -3.6352715727833003 58.47046233978407, -3.6357782666894147 58.47121941437786, -3.6356038191466773 58.47184522373831, -3.6343475362472635 58.47183887180131, -3.6330916142018577 58.47268290205061, -3.632779344556089 58.47247910634932, -3.633981011582409 58.47148207508878, -3.6331273987066224 58.47118133518062, -3.6319266490165263 58.472094896766464, -3.6310744352575046 58.472020401390054, -3.6312061983254895 58.471533656063976, -3.6304029573237426 58.47122049009618, -3.6293720848667963 58.47117520297505, -3.630202283859019 58.47058975582764, -3.629568908783886 58.46973411200483, -3.6286645784487113 58.46941009321814, -3.628556551701099 58.47005472097115, -3.6290167599906917 58.47125553125323, -3.628858396935975 58.471998081774466, -3.630151672911272 58.47245881480395, -3.630311698535211 58.47346303018702, -3.6333097043679112 58.474740682763745, -3.6340984899662283 58.474884241005235, -3.6347807676628268 58.475400140510864, -3.6355808054421423 58.47564145859945, -3.636803836996607 58.476681332835284, -3.6376120473528992 58.47765013905597, -3.6384232230026825 58.479602516339774, -3.6380185321975373 58.48048799659942, -3.6383301969511406 58.48073553394262, -3.6373811700947156 58.48116535040092, -3.636829499312913 58.481657460618244, -3.636905738207546 58.48292754934559, -3.637716809779718 58.48413885339012, -3.639635734853183 58.48482847101511, -3.640695511617142 58.485852431213935, -3.641179975025577 58.48667714057157, -3.6426621455735213 58.48737679232582, -3.644964997230659 58.486916111528494, -3.6451140060669793 58.48771815936343, -3.6457301234838067 58.48842438793399), (-3.5838414471781124 58.39640511661191, -3.583732430749013 58.39590486657648, -3.584375773885931 58.39544031551318, -3.585068909023832 58.39563933139348, -3.5871195036913313 58.39552213368676, -3.588511884372406 58.39532871989611, -3.588176051537117 58.394705437198574, -3.586815122254763 58.395084221781204, -3.585726403976183 58.394926583696694, -3.5842383007462186 58.39492748262056, -3.584985219479352 58.39443829181619, -3.5850209311288452 58.39382369730531, -3.58458427177472 58.393227883112985, -3.58448424516233 58.39250097655722, -3.5840929771606604 58.39216896238841, -3.5838757924941587 58.39133175862265, -3.58534345188157 58.38972813803584, -3.5848276940812136 58.38928987374714, -3.5846088995218226 58.38841675965905, -3.5850190688687946 58.38783678542259, -3.5852544925511567 58.386603229438215, -3.5851252099209536 58.3858188357188, -3.5858029407520235 58.38434175839612, -3.583344927145798 58.38292594525571, -3.5826537356741084 58.38276830830056, -3.582918373418537 58.381803878715274, -3.582267022052113 58.38177150637832, -3.5830881824650542 58.38082265518686, -3.583861659725489 58.380337002009874, -3.5856790688039397 58.38005849894404, -3.5870542211723624 58.379453088534966, -3.587454418398272 58.37903491869145, -3.5883307428499163 58.379127353413566, -3.5875797472919317 58.378018307983574, -3.5882957742838033 58.377398597098875, -3.5886121655394825 58.37625834671895, -3.589255877383337 58.375742829457145, -3.5900426937288406 58.37555789572878, -3.5888069564115086 58.37488605115781, -3.5875951194139604 58.37512565370206, -3.585710784762168 58.37495093434868, -3.585366321377042 58.37556647990276, -3.5842639322011935 58.37615053310822, -3.5836404497708485 58.37673763680662, -3.5816837311454823 58.377911621231505, -3.580150190349488 58.3786087564975, -3.5778549160367676 58.37909967498902, -3.577046726588375 58.3793836064806, -3.576394624618454 58.37990814628784, -3.5747437867885106 58.3804719174964, -3.572814508323146 58.381313061906894, -3.5710404239299787 58.381415685544624, -3.570610173726042 58.3817398518231, -3.5721141772327036 58.383446086944396, -3.572302837612858 58.384418400844865, -3.570713099850131 58.38578532461283, -3.569962367936638 58.3873665134163, -3.5700506416555746 58.388582594839875, -3.569772665984595 58.38944834699645, -3.569233428056214 58.390209506825606, -3.5690502840061606 58.391285189620824, -3.5694064364469438 58.3929090391737, -3.5702941882849726 58.393097934127724, -3.570372308570402 58.394085078873864, -3.5706991035953393 58.39470088135753, -3.5714450558863042 58.39531603236489, -3.5725053397205397 58.39568927746347, -3.5725844327574454 58.396312607635494, -3.573580956189167 58.396651684010315, -3.5751143731061257 58.39783742332079, -3.577330798567449 58.39795486024678, -3.5797921316597314 58.39783613580968, -3.5817717992516442 58.39756099449935, -3.5838414471781124 58.39640511661191)), ((-3.5429302142286687 58.62399903106451, -3.541728470906985 58.62349695541094, -3.5420612250530605 58.62323247641821, -3.5433128165837395 58.62369352997284, -3.5429302142286687 58.62399903106451)))
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>