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/S12000030 http://www.w3.org/1999/02/22-rdf-syntax-ns#type geosparql: Geometry
http://statistics.gov.scot/id/statistical-geography/S12000030 geosparql: asWKT POLYGON ((-4.598204369631223 56.084233688349784, -4.605330991189378 56.0886233244381, -4.604412597947782 56.09049875309084, -4.593369666427763 56.10128770307996, -4.590875651975276 56.10413985530823, -4.58915637364258 56.10816213614919, -4.59074223240091 56.111247697406455, -4.596571687052982 56.114684421438724, -4.60301080687518 56.11581610835774, -4.621979369067169 56.11713141456559, -4.632322076084868 56.118394260792506, -4.63577162852825 56.11957089890582, -4.641309256224965 56.12369406867852, -4.642116559742359 56.126548481291266, -4.642287795265849 56.132211814504984, -4.6436480523451715 56.13491061398497, -4.650014578825084 56.14169947314654, -4.651772322482651 56.14641643884557, -4.651291852574152 56.150893825268405, -4.655026820471823 56.153680782115515, -4.657644000149063 56.15846464563498, -4.655283220534189 56.163112780381695, -4.655905013035826 56.165350917067755, -4.673461736805235 56.175286085281726, -4.686325080764493 56.186426571309426, -4.688891992833314 56.18936374931335, -4.6914207815602795 56.19428366150861, -4.69538334324304 56.19917765448055, -4.69547132921067 56.20272873142209, -4.685366935895554 56.21341625014446, -4.685890845941492 56.22021340269542, -4.691814014387625 56.234393712720845, -4.69709401413502 56.24223761280238, -4.698770728371696 56.24564798253657, -4.701475718902938 56.25494109275326, -4.700839311035672 56.257022208465806, -4.698273922865452 56.25946008847064, -4.697415622603527 56.26309656657351, -4.697790141088474 56.27059338517044, -4.696867012166986 56.274918836454795, -4.693806113354191 56.277681983614926, -4.690195145253911 56.27883009599426, -4.68452046406931 56.278432015935834, -4.679824688629364 56.27701490954183, -4.6770356770821895 56.27917842503164, -4.6720969275153745 56.28168501781381, -4.667249946977158 56.279371798742716, -4.664413526529242 56.28086653724522, -4.66095568532499 56.28086457416983, -4.660944021118362 56.28581264062346, -4.6695392545742544 56.28926318935212, -4.674580999460818 56.288677913107314, -4.678594644315339 56.289107940001635, -4.680122094476561 56.29095785965264, -4.679530564291146 56.29347383695052, -4.682124269015783 56.297848736134966, -4.680786913868765 56.29975621010605, -4.677626647737643 56.29975723285126, -4.674522529509217 56.30183313374248, -4.670674540023101 56.302522921696955, -4.677402149491921 56.3080984142803, -4.676112982727728 56.31000927797175, -4.67671823618353 56.31288140996575, -4.672580202811211 56.31406281619808, -4.667921782199676 56.318684301940735, -4.660797706509356 56.31555248404962, -4.657303842275694 56.31740267903626, -4.658806942725438 56.32215645886707, -4.667338686116301 56.32608941094864, -4.6737442182573385 56.32585240811689, -4.676867604176691 56.3264500173266, -4.682556233710698 56.32556286464493, -4.684289630213167 56.32444677492329, -4.691573764292269 56.322679786481395, -4.695716962625503 56.322481815340815, -4.703134988265957 56.32673769308486, -4.705418228191316 56.32642715337043, -4.708681662848758 56.32853541107174, -4.712522512299122 56.32874344332108, -4.715748912118343 56.32998046868964, -4.719244775028229 56.329544230359346, -4.717215761379213 56.32558006627031, -4.7170956680920035 56.32218518598728, -4.7210014174421975 56.322063461276784, -4.720700431168872 56.32715283293619, -4.728548680875945 56.329222643071645, -4.730688905867084 56.33053272738105, -4.735884127805873 56.331689857550856, -4.7426683237916425 56.331872323250806, -4.749805913350928 56.3266222267545, -4.752773511088509 56.32514958028875, -4.7674311133956255 56.32405434658633, -4.770494707200206 56.32436331321351, -4.773789440716408 56.323399686120034, -4.781019831754131 56.32397358303202, -4.785804237059651 56.32374470775908, -4.788958093618318 56.326330598543564, -4.792836503830141 56.33313720416097, -4.785639002703056 56.33561388272658, -4.784724076183115 56.33693774939819, -4.780606592468157 56.33805941167655, -4.780441648901981 56.339573160552334, -4.7835502815423565 56.343480659533846, -4.787131256968098 56.344424755324916, -4.795019649281791 56.347828763322, -4.798546631570436 56.35078718754007, -4.801266306184888 56.35564233763057, -4.807723974886812 56.35528486045047, -4.810208143565994 56.355821760745734, -4.812734069085528 56.35813280185844, -4.818781418884567 56.36021544201464, -4.822835690549894 56.36292748730905, -4.826866299704784 56.364219830435246, -4.831737709521374 56.36680053235395, -4.834765089314138 56.36656774842321, -4.839845329746069 56.368026154716254, -4.853226526461897 56.36926918138837, -4.853692873949713 56.3711729692276, -4.845314024069798 56.375230689889655, -4.836669850515517 56.376615401480585, -4.834237377843192 56.37810475703698, -4.833257139542846 56.38115620144549, -4.834603740644533 56.38259952172192, -4.83590180261616 56.38709093549852, -4.835164785798156 56.390145899476835, -4.8212309976222905 56.39444576787421, -4.812653418878012 56.39811920469458, -4.816153256487215 56.399859875691156, -4.817321063363037 56.402062424523294, -4.816394064689754 56.40607872564941, -4.814153719123392 56.40834072607728, -4.814496113994678 56.41407203491565, -4.811676352678721 56.41760998415856, -4.803802979152121 56.41628275530871, -4.798618979489852 56.416790860935826, -4.795186224769419 56.42271517648612, -4.789603398473589 56.42399134678628, -4.791422735630078 56.42568965604727, -4.789938022691031 56.427340935187516, -4.781617951419084 56.427020094351064, -4.779853708312698 56.42818312959596, -4.766043744413467 56.432114229194816, -4.766413714296877 56.43620005793206, -4.761408394995762 56.43574984356466, -4.752905429567222 56.437071430466155, -4.747457694434237 56.43565977193218, -4.736983828167802 56.433833086117446, -4.734246449617534 56.43400579332297, -4.7263519363603415 56.440793869638554, -4.723055207243889 56.44639933200085, -4.724091698115754 56.449769549557274, -4.728991404576326 56.45314018596881, -4.733340205511944 56.45493191000703, -4.730381432196992 56.45611162288542, -4.724879998173681 56.45986817321279, -4.720832450402201 56.45865826605503, -4.716192969778459 56.45927228361077, -4.704886145958092 56.46177977640834, -4.702945853198093 56.46303095191583, -4.70008787404236 56.46736687148485, -4.6935242959660135 56.465019895304025, -4.689246360827154 56.46226804749183, -4.686487930223302 56.4632086386436, -4.6789122054262915 56.46179509353854, -4.673370654884768 56.461254037486135, -4.6665140650880135 56.46151841009647, -4.664042162799153 56.46389042027082, -4.660759450712066 56.46929510980881, -4.6591934608864705 56.46965673127187, -4.655147588041966 56.47310473233818, -4.64911660884887 56.47371452456383, -4.643134697157961 56.47363085019467, -4.639080439402489 56.476049504151305, -4.633988498495218 56.47276033229498, -4.628485931442314 56.474319575358244, -4.6237331901361305 56.47745792732911, -4.620567815552423 56.48101200964038, -4.625654328376293 56.48351996147676, -4.6255751045289655 56.48589882000038, -4.622478470834149 56.48786966700485, -4.61781066268412 56.488026612874776, -4.614610417409829 56.48944227853455, -4.607963285215779 56.49413879265194, -4.603890268169988 56.49528040204957, -4.600730576278927 56.497566568187175, -4.591691631107627 56.498312776508634, -4.582625457265649 56.50035766251323, -4.578191862718478 56.50482673983473, -4.5741408487575175 56.50560291152393, -4.5691304047959305 56.50337440020875, -4.56220772110246 56.50422296394784, -4.5583722747187565 56.50615348552524, -4.555915183513936 56.50442015168505, -4.553668600498683 56.505329109748196, -4.541939663855321 56.506014742856436, -4.538716652973834 56.50703335172983, -4.531438622988327 56.50476882652904, -4.528514608859861 56.504909277124035, -4.528766552169144 56.50857101727985, -4.5306322458230115 56.50961593956813, -4.530771691391397 56.51268229984746, -4.532894652267288 56.514045578675486, -4.530153539153308 56.517673903449825, -4.528158622429357 56.5187211007369, -4.5220044740255405 56.519079938363355, -4.5112743199717125 56.52190818568669, -4.507790407320567 56.52331776172011, -4.50732172069902 56.52028500265975, -4.504790235215393 56.51851165637967, -4.502517986794969 56.51930796229988, -4.499053895717196 56.516452309695914, -4.49711965922185 56.516086822078115, -4.494367043714293 56.51266857846102, -4.490908136992642 56.51197854218556, -4.4829954487312 56.513894069147604, -4.481121262280858 56.512578984262674, -4.477701100938924 56.512975309931015, -4.470105430937076 56.51527909186087, -4.469995035256759 56.51595531366528, -4.460908736644935 56.51772644543516, -4.456931841954103 56.5176972903372, -4.450274272228939 56.519455582471515, -4.448846178316806 56.520881211046735, -4.444232305710521 56.522576299743854, -4.441733918488992 56.52493519171675, -4.437869462564841 56.526287273330155, -4.433915889233961 56.52574470626706, -4.430811342486138 56.52652445010841, -4.425980570510813 56.52485291630593, -4.417377318857716 56.52559136924421, -4.408941586121251 56.52859068227112, -4.402838317969103 56.52683960952426, -4.3963405847740376 56.528875777270954, -4.390304425337264 56.533857680027246, -4.38596887478444 56.533451209699415, -4.37850533924039 56.53360333840721, -4.373630278624739 56.53730488803363, -4.37425004903615 56.5387623428463, -4.3704948009360765 56.542437855490014, -4.371363233782801 56.54527012202044, -4.369141913207065 56.546561682856556, -4.362014371667411 56.54679622649685, -4.357720743797113 56.544334511124084, -4.341047573948245 56.54027772588417, -4.335173512516212 56.540114175868304, -4.331235529401297 56.539028904907305, -4.334869090035186 56.533451701918025, -4.3331429225513265 56.52931877134448, -4.327578742226439 56.52635864461006, -4.321532879676896 56.51697277526216, -4.318970209776973 56.51587031571363, -4.3105215499719005 56.51500782292565, -4.309159311457693 56.51158672951403, -4.311081721163462 56.50992437221644, -4.307102025580189 56.50608458748476, -4.308155777393525 56.5035037825095, -4.308025610059975 56.50015868158422, -4.304434512388675 56.49413229355598, -4.29870112199863 56.49308376057295, -4.2973540283353096 56.49122596769551, -4.300457538557041 56.48895774655926, -4.299849418719508 56.48320402084437, -4.302137599235018 56.48263584508657, -4.299681027799989 56.48028646000883, -4.296896146533379 56.4750537783961, -4.274682373584065 56.47858131478966, -4.242768352357886 56.48815589550261, -4.194452210396816 56.495329853223836, -4.154490349069322 56.51029568729491, -4.1467298930200425 56.50627390033535, -4.1373565753428 56.50301626831693, -4.130769228456502 56.50232516781448, -4.126280229438494 56.50079806614049, -4.1227119637595715 56.49800596090703, -4.116295909317884 56.49482653131722, -4.108236911871419 56.488367676776136, -4.098625162722565 56.465354778217105, -4.103765424366055 56.46715937000688, -4.110315207428271 56.463781564789635, -4.1158692836041455 56.4625143321167, -4.13157402974887 56.46411024499179, -4.134442906924405 56.46403398149374, -4.136386002857738 56.46163706948368, -4.141627718449342 56.46132652021352, -4.142383989897361 56.45919273073957, -4.148594465470232 56.456645501203965, -4.148138337894404 56.45431686749907, -4.156731789846834 56.44974194922359, -4.159831374754103 56.44502851038543, -4.163200311096068 56.444641808126036, -4.166327939535001 56.44870762979727, -4.176797699566221 56.450474431271374, -4.180122399328353 56.452707596037705, -4.194632591928688 56.45851319694477, -4.198958161204702 56.45949708669031, -4.201974147018055 56.456361184437384, -4.1959229389437 56.40128161944964, -4.1976980002585185 56.40002347965989, -4.19866428021367 56.39710817023339, -4.197812218536214 56.39286805575535, -4.196657154123533 56.39152258977904, -4.196460756619258 56.38670475654605, -4.240632857152523 56.384399823671146, -4.239163687764852 56.38020703392944, -4.2391578551005145 56.37182702984314, -4.23966523249874 56.36929706939962, -4.238107637565876 56.36689875518898, -4.239672184114197 56.36265571670908, -4.241733079635147 56.35970216467028, -4.242039451321319 56.35279025642806, -4.236246615605653 56.34784438163881, -4.223567861446467 56.34230313404924, -4.227149912973399 56.341295166839295, -4.22919256147553 56.33858929700443, -4.233802595129297 56.33483069647169, -4.236934415458471 56.33361035003374, -4.237513420572523 56.32982093200998, -4.234596612949343 56.326413669563564, -4.230506882698827 56.32645595513481, -4.225704347483018 56.32175681754503, -4.221069419471825 56.31964276523817, -4.211575756077119 56.31823101962198, -4.209448045794512 56.31457101236755, -4.197935808597498 56.31443891017123, -4.196681848349143 56.31217396973323, -4.193837144221224 56.31092134190485, -4.191454264513387 56.30714418691454, -4.188215805986142 56.30422689804912, -4.178386269878531 56.30321398255948, -4.1719783826362145 56.30295363987692, -4.165201566364259 56.30359801285396, -4.161503267724394 56.30323131190123, -4.151055476439744 56.29954006437683, -4.150045642177506 56.29853755314406, -4.139880134085058 56.29782849373694, -4.13534427400048 56.29445594893857, -4.118720899549921 56.28784895266302, -4.115702795944111 56.28103928859797, -4.107882959789687 56.280292019286186, -4.101257436097372 56.27878082807417, -4.093559905066818 56.27892655712963, -4.088529416984675 56.28088076216196, -4.083652257360922 56.281057302289135, -4.07977066900663 56.28350406035411, -4.078511587565297 56.28992358397767, -4.0612444847862745 56.27879053603846, -4.052213741371653 56.273499241503806, -4.038554578030403 56.28027164932948, -4.035373554489898 56.2750094153803, -4.0392572911030795 56.2713230852613, -4.037078015037449 56.269215692951306, -4.030085812014278 56.27090322937215, -4.025641593911302 56.27023911247037, -4.01924615597548 56.271925243505116, -4.005288262891262 56.27494249595265, -3.9764697014053763 56.2532728041069, -3.96708499802322 56.2452942245688, -3.9612053442288397 56.24488431136357, -3.955892312287655 56.24608726806637, -3.947506029661399 56.238869716918614, -3.9470439202779 56.23679033902166, -3.943957917611648 56.23521506880203, -3.940938459857339 56.23029035174875, -3.940584613253207 56.22814366989056, -3.93673794985535 56.228288417268125, -3.9318037367339485 56.23067063157341, -3.9293505133818805 56.23087512456537, -3.9217343501577875 56.22923873529381, -3.9188440645111466 56.225574963647254, -3.9163020797818535 56.224934133123035, -3.901282122741173 56.233383855745636, -3.899034095275306 56.22757281950442, -3.890452108017727 56.22472451643307, -3.887944618889377 56.22313265033955, -3.8782925165532594 56.21986854647636, -3.8762880342419557 56.21532047208014, -3.873142080587929 56.214469536748055, -3.8649594572386436 56.220142214174345, -3.855245789992534 56.22439049725506, -3.8478346281805 56.22540906439158, -3.847612591711448 56.22163371664218, -3.842923248558255 56.21920104994291, -3.8421041036032983 56.216751041314524, -3.843188561606977 56.21431309291546, -3.840372791869294 56.21175357358887, -3.8438948905618564 56.20182078427964, -3.8364170151165524 56.19562831638767, -3.8294563393114047 56.19655648555638, -3.832521504778474 56.1907662718513, -3.8419740509157263 56.1906751845448, -3.8411933291865314 56.18850766579618, -3.844090460052784 56.182219075578445, -3.8484719269867487 56.17934543386342, -3.8480439081416935 56.17613929140799, -3.851723411783549 56.17259308463002, -3.85339792835408 56.16906786421651, -3.8581799349900447 56.16452982304289, -3.8563517592688465 56.16252196503667, -3.8574780172733742 56.16083362922123, -3.856770278486526 56.15574540864748, -3.85434429034268 56.15345085405238, -3.858896630743857 56.15216389425896, -3.8641885040966306 56.152360941514694, -3.8734856170671814 56.15125607840033, -3.8753564933722515 56.14990223490556, -3.873609638580056 56.14824645201042, -3.868760521323463 56.14684891163912, -3.863752039253224 56.14208362428238, -3.860397217171192 56.14140723794593, -3.86000313472407 56.13751577593479, -3.8575024538593845 56.13531943381985, -3.8703868102341192 56.134697273461526, -3.8779436105439684 56.134887241339285, -3.8794994236448366 56.130957175616686, -3.882944777910591 56.127735225783226, -3.8799295562050804 56.12440596700862, -3.8790935321821034 56.12108652768946, -3.8767999370243023 56.119476933131374, -3.869933058092894 56.12077630923562, -3.865441573180186 56.11967779497373, -3.8633800785290373 56.11689979876238, -3.864708834654664 56.113879171842804, -3.8693253096708777 56.112393167536965, -3.871826325951618 56.10981035863686, -3.8680906880769403 56.10712788157761, -3.863684613145179 56.10673351660378, -3.859008374221803 56.108603910376694, -3.8562679494780734 56.11073898065336, -3.855422571705362 56.114225782387436, -3.856955762793734 56.1170037679035, -3.856042065340124 56.11907351857793, -3.8530949820157048 56.1199059218583, -3.848318117332499 56.11962256972594, -3.8365235056132114 56.11732372786945, -3.834496471440486 56.11481615134346, -3.8400025762311434 56.10879698908738, -3.840585246621279 56.106348510697934, -3.838092255706199 56.10360438920769, -3.830034483530159 56.10204010513932, -3.8270946346471444 56.10100893294481, -3.8215534065197145 56.10072500484623, -3.820383839859795 56.099280254396874, -3.821865945465951 56.0967224778011, -3.8231477447360254 56.09108623460134, -3.826021950900883 56.09030951058032, -3.8285676953476115 56.08660368701332, -3.833335883917196 56.08750526044411, -3.835897139360829 56.08465357830423, -3.829498993549187 56.08095728025138, -3.823651253248444 56.078786493579734, -3.817856965498082 56.0757196010889, -3.8128077039989114 56.07485031991467, -3.807785796220378 56.07291101671977, -3.8068212880044356 56.06974132503549, -3.8003069296109877 56.06809137134, -3.7982597983149877 56.06604545440202, -3.7998207367687518 56.06279575775564, -3.8021751978491354 56.06334092735942, -3.811908400991584 56.06215959188817, -3.8147353075472576 56.060039483600974, -3.815278319126105 56.05826574652993, -3.810702625822698 56.05559304394344, -3.8138017449609287 56.05346446463627, -3.8207045584698527 56.054400762199236, -3.824820160101841 56.051061697206066, -3.829283278930298 56.05128047040853, -3.833147591170118 56.05041888102872, -3.8345992598392726 56.05190693181302, -3.841379403569449 56.05076981487459, -3.857781533594888 56.04995413884144, -3.8606354197890327 56.05069658019356, -3.8656399246030166 56.049653168839924, -3.8736201240124823 56.05040841295367, -3.873256486486094 56.04877115055791, -3.879421013119894 56.047027497943496, -3.8901319832381347 56.04853528793858, -3.8931934316156545 56.04780179232557, -3.896981379834707 56.04545207728433, -3.905274351743535 56.04776770240422, -3.9146341208297666 56.04930052574358, -3.920014189195947 56.048346988318286, -3.9237477781761463 56.05003134229718, -3.9251241524447607 56.048843395535116, -3.9303394116558654 56.049902315048435, -3.934632436733892 56.04940724495847, -3.9393978035666315 56.05077299407832, -3.9428351621431426 56.05098402092655, -3.9469065431073496 56.049180890954304, -3.953635559978765 56.05002617699413, -3.961263414685222 56.048199519274554, -3.9733633289544845 56.04862841363171, -3.9759481930904967 56.04764793190402, -3.979150532917549 56.04361548798398, -3.978374810238863 56.04034965122806, -3.9870127794430004 56.03927617729864, -3.9922979523723567 56.0381952089008, -4.0012991893994645 56.03494636357195, -4.010395956360717 56.03087836030284, -4.013081772880251 56.031137401462495, -4.017855504411445 56.02976171033844, -4.0201297707821 56.02804308992718, -4.021869987101706 56.02789948239056, -4.031515841294543 56.02986453958389, -4.0341042645820036 56.02875877187893, -4.041611746860574 56.02942190029829, -4.044222030372734 56.031043071000724, -4.048354365444391 56.03030490644809, -4.052795968042726 56.03125471127722, -4.054406757438054 56.030547511463375, -4.062490955238459 56.0296415374242, -4.079000384632599 56.027149047845455, -4.080057912725831 56.02577422612067, -4.086511440426042 56.027152454613685, -4.093704166161338 56.027798964578075, -4.096690258188386 56.02737528769139, -4.097147712402828 56.02486016224315, -4.100029165877815 56.01926167593446, -4.107005877212177 56.01729132907245, -4.111673477651459 56.0147670053119, -4.1144649702657565 56.01520449591503, -4.12033428591282 56.01369269431113, -4.123475582714377 56.00998098802823, -4.129125606143943 56.00902076196237, -4.132339696005315 56.00723516736652, -4.136407860148102 56.00625262910197, -4.15238721557797 56.00804161885276, -4.156370411258337 56.01172859461464, -4.157319154882976 56.01363970447428, -4.155623739413943 56.01776295441818, -4.158107031762669 56.022586036095774, -4.156744059300662 56.025049884562414, -4.158634520897087 56.02729050042292, -4.162876191533436 56.03024474457167, -4.167675217244454 56.02895628690596, -4.169866819892807 56.0272550724569, -4.171913614456757 56.02269408741291, -4.174074223566581 56.021164132263806, -4.1736639216089 56.018717878424034, -4.190759224883945 56.012038960411424, -4.194586952602898 56.011782113623084, -4.198344737989945 56.01029523830925, -4.206683468534175 56.01698998821296, -4.2129477764503225 56.01696754952027, -4.218867872028051 56.01821817740038, -4.222543566329505 56.020335859172725, -4.2410322480858 56.016514141438385, -4.250493179181401 56.01600478232529, -4.257006869877789 56.01723376609997, -4.2617027569579955 56.02112011359279, -4.2665854056016 56.02270205234308, -4.273025477580976 56.023059860513214, -4.273386402354684 56.026059404210436, -4.2752760740833695 56.028716281570546, -4.279965117525072 56.02862068162307, -4.29095940501073 56.02699685466246, -4.296336911264077 56.02566114422606, -4.296290973565296 56.020157204795865, -4.299551621484944 56.01737772157325, -4.295259260892532 56.01372345452442, -4.293904935361282 56.01144792915039, -4.294224825069706 56.00899739463731, -4.288062733603525 56.00394424215765, -4.28303811241006 55.99911681050366, -4.2764801051346355 55.996959846734434, -4.275041752534639 55.99322520417359, -4.275491283320299 55.983302926442896, -4.274283762846002 55.97688223276245, -4.278906077867768 55.97712036813161, -4.28036899197153 55.97471700178332, -4.272666440809087 55.96535071910937, -4.28175649202942 55.96703320084104, -4.2886515799518055 55.966837912569524, -4.290344162297079 55.964487650494476, -4.293645093223413 55.962836366087046, -4.287635290295376 55.96069858530303, -4.2864158095012685 55.957788666048536, -4.295145874457055 55.95860682611877, -4.303718550628246 55.95722808761634, -4.3126519808624755 55.959032509772506, -4.31942565659667 55.9599926820469, -4.32031136302924 55.95843643680868, -4.32836256343785 55.958713181983406, -4.33095041742167 55.9582400585462, -4.335225486077293 55.95942093045776, -4.342981118835023 55.96267185806706, -4.351479821414637 55.97154682966508, -4.357731946601391 55.97320780208766, -4.3641112172720895 55.976445136249566, -4.363341534245809 55.977909541681555, -4.366389690578314 55.980417959894616, -4.375356899968749 55.98106861943099, -4.380309973643455 55.97957550039738, -4.383705246527871 55.97991427770698, -4.388211435343301 55.97877100250177, -4.3940062166714515 55.97812375166977, -4.398223564228843 55.97659468626221, -4.398167214544156 55.97309510474177, -4.402052598519751 55.97183490549033, -4.407907198469509 55.972244536007224, -4.414037682281459 55.97134716851726, -4.417832241492176 55.974238657090645, -4.430354349442006 55.97902988960168, -4.4277847203129745 55.980999419545604, -4.4337722028882 55.984314614336405, -4.435016835822141 55.987790732627516, -4.43888922907858 55.989574617889396, -4.439619160166517 55.99212615303522, -4.441910093260072 55.993235730938615, -4.445218502575444 55.99737644798407, -4.4460417544193485 56.00278868212581, -4.448708846296309 56.00450624920964, -4.469720629650352 56.00196594613166, -4.473038794818874 56.00494621236067, -4.472894200779091 56.00649771780001, -4.47922543370083 56.01089774437098, -4.482410413633127 56.01152748223795, -4.478977536504221 56.019246960399634, -4.481407914593086 56.022434634982524, -4.485485286246656 56.02265179611931, -4.4885687867311646 56.024405958488586, -4.488257566766677 56.02984454087417, -4.491772651310742 56.031260969553635, -4.492147089803942 56.03375741074102, -4.488602003721828 56.035844132694464, -4.487229788829636 56.03899328978548, -4.488239220816243 56.04075604378813, -4.498796377466614 56.04753785395815, -4.486820875525177 56.05050136394826, -4.4819051181803635 56.05072896570361, -4.477980552951959 56.055092289068746, -4.475324084350734 56.0560237537232, -4.47616960644998 56.05929005602222, -4.481654142999758 56.05917174409985, -4.484919911339414 56.061068003516205, -4.486141138237002 56.06369295054627, -4.491535794296504 56.06334240219464, -4.500377794827338 56.065072491057165, -4.503618289028284 56.06440187685545, -4.504431037261389 56.0620466987818, -4.4996788746568495 56.06112569528177, -4.501285794910002 56.05917513055013, -4.50662188765734 56.05879895359341, -4.507720439056543 56.060849253024784, -4.510236115703954 56.06126899939781, -4.513535465408604 56.06543243437397, -4.524522846736173 56.07144474978601, -4.532761396923991 56.07345266049382, -4.553458791059794 56.07135427127689, -4.560778863419994 56.071485665938226, -4.567444272639284 56.07385027508952, -4.574502357270754 56.074503154724944, -4.581308900326134 56.073192456563675, -4.587891629330426 56.073342165111015, -4.59360773954364 56.076498222654706, -4.598204369631223 56.084233688349784))
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>