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/S01000723 http://www.w3.org/1999/02/22-rdf-syntax-ns#type geosparql: Geometry
http://statistics.gov.scot/id/statistical-geography/S01000723 geosparql: asWKT POLYGON ((-6.084687309646926 55.78377685560766, -6.081787782527398 55.781424902714825, -6.074650596051963 55.779217077615954, -6.069947935507475 55.77703715122409, -6.064160879527236 55.775578179345246, -6.062247129919461 55.77470715820506, -6.060466494622493 55.77246127671299, -6.054719916887916 55.769256368717464, -6.051313611570751 55.76570922232594, -6.046901925321884 55.76364343811758, -6.047641090488082 55.76171915865481, -6.04715631678724 55.76024014218124, -6.047971155538953 55.755852845909835, -6.047065274774947 55.75510408239721, -6.049114603607364 55.75410208517925, -6.048382712043872 55.751837015550024, -6.051272669160108 55.74510753328282, -6.052314650103051 55.745041966824346, -6.053217807103473 55.74417119189961, -6.053322032139659 55.74251700815268, -6.051410895756167 55.74005732071348, -6.049858190813046 55.739454529454925, -6.049640336071684 55.73841832637669, -6.050242387316962 55.73783782646956, -6.049427866386622 55.73636970715944, -6.046327021316566 55.73360661233575, -6.044411842751578 55.733763216441936, -6.043591203995256 55.732232976591646, -6.040881665171275 55.73057810064473, -6.038685249535913 55.730681585386684, -6.036806377873173 55.73012051868179, -6.034059567892395 55.73077152204794, -6.034723630228097 55.72972186956465, -6.033400165580151 55.73026373164704, -6.033301288605458 55.728771981234644, -6.031150325387837 55.7287804096591, -6.031656395106412 55.72726877486815, -6.030570537206799 55.726370095926114, -6.030194220904808 55.72432684197585, -6.029142664802469 55.72322457756028, -6.030698676253547 55.72279969777858, -6.031679769525456 55.7216150560909, -6.032226256865396 55.71835793160162, -6.036717183592662 55.71537591506245, -6.035858309938909 55.714002620072456, -6.040252620175456 55.70955978545097, -6.039976801160625 55.70475682848619, -6.038406895259511 55.70343812356745, -6.037088019417634 55.70348155688735, -6.037246934546725 55.70288455866784, -6.035150602632325 55.70127169155298, -6.033350062837693 55.701455522739714, -6.032144884185905 55.70099682928121, -6.030754586217881 55.701416293245366, -6.032554571319459 55.69855397744611, -6.034138416315579 55.69840843340343, -6.034872925272947 55.69751217600745, -6.03634552725658 55.69522119975071, -6.03596188857354 55.69417487197046, -6.034238453278048 55.69349967195016, -6.032202503152231 55.69353551099917, -6.029030847525819 55.69485447228102, -6.025209860120797 55.6957586308526, -6.024710261224283 55.69465378332539, -6.023840778577623 55.69477576443252, -6.023644658384244 55.69394126187777, -6.024544795432506 55.69251016602834, -6.024157681096746 55.691962244133805, -6.026068337180744 55.691245449597986, -6.025939900814074 55.690533321154255, -6.024326975689338 55.69092887912673, -6.024222229378149 55.6893750316968, -6.022933872805337 55.688638676158824, -6.025557203426263 55.68627892096543, -6.027583801934707 55.685620576685515, -6.02755883633855 55.68484275249431, -6.030273795026692 55.68391257380216, -6.029118896455225 55.682330965314, -6.02449631441825 55.684538447129356, -6.020786766340591 55.68490934777545, -6.019837030602262 55.68478477224112, -6.019883109336022 55.68416034405249, -6.021681797509427 55.68235717912521, -6.023611192708534 55.68182667951392, -6.023957999523179 55.68091206878368, -6.02292404255244 55.681039439331, -6.02419175605498 55.679970015827976, -6.025477929190536 55.67961632584753, -6.026363305024707 55.67804552395689, -6.028842776397127 55.67643790881022, -6.032759377380594 55.67487639068665, -6.033033407660238 55.675396853806056, -6.035195767970348 55.67392411070955, -6.03504972046561 55.67464527139016, -6.035957638700729 55.67436621653467, -6.036488528120549 55.67310289189024, -6.037796292019996 55.67349585398026, -6.039038187767336 55.67164846401519, -6.039899816578975 55.672523299972646, -6.038558643494829 55.67340844660235, -6.037982033296532 55.67529620131656, -6.039354867956679 55.675250963116035, -6.043486132874356 55.67097231059717, -6.044981449677812 55.67104754985995, -6.045485972734043 55.67006537235382, -6.044691630875752 55.66984242315404, -6.046297081764988 55.66938452621244, -6.046869290000549 55.668524684599575, -6.047865582760305 55.66856964382349, -6.048624911741089 55.667921636988765, -6.050226109245471 55.66902113561035, -6.049346685204307 55.67063865557856, -6.050767818683935 55.670529392455926, -6.05347184495426 55.66897611746348, -6.054295897102262 55.66788987877058, -6.055484439725201 55.66766367826244, -6.056731975580103 55.66534871677069, -6.054361707800062 55.66533371980188, -6.054346150788057 55.66411952573032, -6.051762203162862 55.66523281564968, -6.050993931306062 55.6647287323762, -6.054179531087637 55.66144647177495, -6.047321841158321 55.66544184938114, -6.046893340517451 55.663960981931226, -6.049784557698 55.66209013313589, -6.052477847048276 55.66150276124369, -6.052252129527927 55.660918444370644, -6.058440252678986 55.65685150339901, -6.058930824489177 55.65733359549752, -6.056572985978065 55.65956077508229, -6.054670857150725 55.66034009174314, -6.055277633160181 55.660880648393814, -6.059298354802101 55.65875415009294, -6.058842780229031 55.659672483627915, -6.05966593472725 55.66017470134746, -6.060957732421966 55.65935323788722, -6.061312496746034 55.66064962349213, -6.065772073168251 55.65797887871034, -6.065377867741958 55.65948697928122, -6.06674061061437 55.65828934223953, -6.066582205024096 55.659415872196696, -6.067492763945491 55.659167621308285, -6.067298823881607 55.66048221544978, -6.065467787682064 55.66194456167038, -6.065619467180613 55.66234443904884, -6.067408444757931 55.66153755382418, -6.067702106031644 55.662773656427404, -6.070522613298379 55.66341194395428, -6.073364206545189 55.663192931756676, -6.074177913958594 55.66201345758118, -6.072040373234978 55.66105667525727, -6.072395569319572 55.659705568135244, -6.076738308014235 55.66015294536806, -6.07824282784097 55.6592619166041, -6.077955268930619 55.65755842751914, -6.076402231122302 55.65639539601583, -6.073183439268422 55.65563033808436, -6.072492574966466 55.65428285368577, -6.073971140343562 55.6526140835573, -6.07389043313238 55.65183810429038, -6.072482960212702 55.65207177168787, -6.072424873290119 55.65151306841765, -6.070484766270807 55.6519201566278, -6.071340298679342 55.65061472082087, -6.070952976280821 55.65006695041885, -6.074585999285818 55.64581926407121, -6.074198686574665 55.645271510639674, -6.073081939844621 55.64512176005492, -6.073317572412568 55.64421067680018, -6.074027611010576 55.64415591960877, -6.073375671036827 55.643710397282625, -6.074166411555303 55.64231365899437, -6.074986138654551 55.64225524122539, -6.075528350289797 55.642704405520156, -6.076577185272185 55.641672814776896, -6.079181619402682 55.6418352891356, -6.080162629222414 55.64121083724342, -6.080133463545077 55.64040199028528, -6.081601894947852 55.64075798565742, -6.081008278437961 55.64193018122296, -6.082137672949279 55.641145037157266, -6.082712174548077 55.64137506615526, -6.082454139731874 55.642068889866124, -6.083880598690773 55.642021343296314, -6.08337700813034 55.64141519369798, -6.083809298175126 55.64080899296235, -6.08299273264048 55.640369017038566, -6.083334586324638 55.63942322533606, -6.085102899341842 55.63895935883854, -6.086139082042918 55.63992148939083, -6.087126213359594 55.63882956898576, -6.088543026796007 55.63921833811498, -6.089123807028433 55.63898093156985, -6.089830085353724 55.63783606619955, -6.091659815840177 55.63796183758125, -6.092422062615718 55.639462567791206, -6.089935003853884 55.642006229371056, -6.092184641949077 55.642460593166575, -6.090281248204248 55.64426838638814, -6.08940986299373 55.64435976816601, -6.089558061887819 55.64366959474175, -6.088738511625984 55.64425758819775, -6.088612393684326 55.643576571633425, -6.086265952847856 55.643249958056515, -6.085359138229627 55.64352937826211, -6.085436810700336 55.644274309091, -6.08643752080205 55.644895013351075, -6.084669384733935 55.646947366340825, -6.084708368329033 55.64784931975714, -6.084902254229656 55.648652674746344, -6.086158014217451 55.64907799244899, -6.08728444832603 55.648791244468995, -6.088429520861424 55.64657276256544, -6.089962422191719 55.645960955864716, -6.092118505855549 55.646044687369915, -6.093905934781995 55.64470794719046, -6.096947309140137 55.643780877576006, -6.103134956924801 55.640303352444185, -6.105471590115658 55.64053653605558, -6.110323839497002 55.63903448513505, -6.110158305912853 55.637981042655376, -6.111813256232977 55.63748943391571, -6.114228536319506 55.635850975999155, -6.120529826661758 55.63400393070063, -6.120377716306135 55.6336041332385, -6.123371561521334 55.63328534807757, -6.123767960137839 55.63548346821653, -6.130319189111713 55.633923385192816, -6.130505125243126 55.633076142131465, -6.128390023362204 55.631808111261414, -6.130396439475045 55.63152243713223, -6.131542425534855 55.63195099037117, -6.133118302337394 55.630714221842105, -6.13577048020636 55.63081158158808, -6.137257735470371 55.62873676156842, -6.141469610465869 55.6269280158209, -6.14268261481276 55.626949281982654, -6.14480725345964 55.626223294709966, -6.147681778581331 55.62634401311699, -6.149306171533958 55.625572585774265, -6.151461217744631 55.62565528851521, -6.151916333460573 55.62579559551084, -6.150756963391041 55.62680047859121, -6.152100400601117 55.62753363091828, -6.150651380479352 55.62892209571714, -6.151397168661724 55.62920830028698, -6.153244270954302 55.628460419566366, -6.155505865309898 55.62850829601794, -6.158514327068504 55.62781437676139, -6.157809135957068 55.628430122611576, -6.161152398175177 55.630372330723716, -6.163432682993987 55.63007680623116, -6.165404904652748 55.630508103182265, -6.166691831288797 55.62967006019114, -6.168391891936011 55.629612209149414, -6.167260833003059 55.6288097013452, -6.167988992962619 55.62841114785014, -6.16974585190186 55.62785298256104, -6.170114073840808 55.628572185709146, -6.170135262598547 55.630132901625906, -6.174902861725295 55.62877428528365, -6.176293903217409 55.62944636944897, -6.176126474707104 55.631754516883014, -6.179907746913448 55.63024046001752, -6.184905646079703 55.63108538682264, -6.187286163329801 55.63323522548569, -6.187585402692883 55.63425030504559, -6.190219713699715 55.63479877885265, -6.190617925050436 55.63584644045535, -6.192883312555853 55.63576890919001, -6.194050412207415 55.63652097569581, -6.193364137862688 55.63706713560818, -6.195587632796394 55.63752589473031, -6.197246280988772 55.636127399947675, -6.199918583928694 55.63557734753967, -6.199026080948018 55.63499842116513, -6.199467505405188 55.634569269527816, -6.201221632428545 55.633792595092146, -6.202719403474934 55.63369198388806, -6.202197050622702 55.63288236256986, -6.203365163211068 55.632341141124996, -6.204440254234975 55.63284359126253, -6.205562496993944 55.63251611797517, -6.206873104842728 55.631247918295074, -6.211581029646439 55.631187235771634, -6.21777283066348 55.62989060762825, -6.220191644350364 55.62659035358274, -6.218891389607597 55.62494482766287, -6.214790932388138 55.622418107987855, -6.214473265353971 55.620729089255974, -6.211471422548532 55.620187055802404, -6.212896907800436 55.61999354883707, -6.213107760852029 55.619263934403804, -6.216999724782559 55.61748297622117, -6.219154333770199 55.61505384752901, -6.220570116497136 55.61445605285917, -6.220198765547161 55.613534602092265, -6.221624388912377 55.61144838939179, -6.223301455682944 55.6109089719145, -6.224271630553638 55.60854467641396, -6.226594011012781 55.60720760446337, -6.225968010048 55.60644905511731, -6.228115534186344 55.605700705651245, -6.228711973800277 55.606026838234406, -6.229942559160685 55.60560869387141, -6.231123828950484 55.60583755401093, -6.233080515439378 55.60426738724323, -6.23598154620163 55.60073338029537, -6.234597212445435 55.59893682521655, -6.234391271753142 55.59655531264538, -6.236207638430669 55.59542336620586, -6.237781082725889 55.59534963727265, -6.239490107817602 55.59432729612218, -6.238046289352459 55.59355379673929, -6.241165053875869 55.59173134477818, -6.24280124566591 55.5914531114632, -6.245030681936588 55.59194407517132, -6.248328704164504 55.59099651418766, -6.250887197253715 55.591071414463116, -6.255797698219184 55.58931636213569, -6.257218688363739 55.5890935798152, -6.258885327265881 55.589411226639015, -6.25946561251698 55.58755137874499, -6.260604064740366 55.58723243720941, -6.262310623081997 55.58556933319947, -6.262702859113106 55.583388533937125, -6.264725443495224 55.58275943302551, -6.267442060644785 55.57866274168006, -6.268159253822272 55.578849626133234, -6.268282315590099 55.5799818825861, -6.269317599869895 55.57981092751204, -6.269657630604922 55.5802806469051, -6.2717476728797 55.57964907187701, -6.273757154022841 55.5801519957757, -6.278434576607514 55.58033530608773, -6.281782910939765 55.580020746821134, -6.287261810707803 55.58084989649733, -6.291061631511462 55.57984503028299, -6.294469381408708 55.57976402327318, -6.301809224046891 55.58237171896815, -6.303333561413826 55.58418189529474, -6.311024675889268 55.582543475088876, -6.312413526730501 55.58187809581838, -6.313168865321095 55.58256423537379, -6.312748185199629 55.58368674521298, -6.311661293587225 55.583542033124225, -6.310935081788056 55.58389510579177, -6.310644932593012 55.58419428262697, -6.311540192196661 55.584451702652984, -6.310785116347565 55.58531628459077, -6.311367237721886 55.585353568215545, -6.309862750858605 55.586206008893896, -6.310870885474828 55.58733597252812, -6.313647171009296 55.587536741305904, -6.313061245153067 55.588857700666885, -6.31535702937455 55.58917168655208, -6.315873740733699 55.58876818705304, -6.317582061373169 55.58915100124418, -6.318369717487814 55.58873793112845, -6.319635633199426 55.58896295927346, -6.321966619627769 55.58836053661265, -6.32452813790577 55.58861680066072, -6.325857658434306 55.588338647131955, -6.331700664774617 55.58977961631662, -6.336553797243336 55.58906824498508, -6.338008560542703 55.58961399329383, -6.338245775405865 55.58991387536001, -6.33685687090268 55.59088795263241, -6.338908771058476 55.590988634018046, -6.339069822977855 55.59152242147938, -6.334608350930631 55.59362656457173, -6.335487259518755 55.59419273803126, -6.33457456537954 55.594552611594295, -6.336722032038874 55.59520872055016, -6.333621677685776 55.595780962682866, -6.332175299517259 55.59716163651606, -6.334217005780117 55.59809128142302, -6.333998969513071 55.59919726846138, -6.331694681804393 55.60082025543107, -6.332895651896628 55.60122090372755, -6.331372787098405 55.602527205102085, -6.332739044341698 55.6031917627482, -6.332256129195001 55.60374834973228, -6.3327560433165 55.603961870865845, -6.33199350758709 55.60445128969093, -6.333160760966346 55.60546969940833, -6.332851572020696 55.606675240971974, -6.330063799268705 55.60762166358724, -6.328362618807255 55.609782009664656, -6.328335044620967 55.61076564107934, -6.331356204366111 55.611313890049566, -6.330544837548427 55.613828124504664, -6.33121015084084 55.61430555143481, -6.332710257852639 55.61432954749632, -6.330638133485895 55.61621402489576, -6.330763187875853 55.617038116942865, -6.331089531148291 55.61783581585917, -6.332759376809554 55.61877865736114, -6.333212995176942 55.62011134926593, -6.332676926640891 55.620804688171944, -6.330068254754182 55.62060795770718, -6.327972393593106 55.62135642563475, -6.328966301781847 55.62234247706852, -6.327976569086639 55.623861082063364, -6.328338954255162 55.6252933549131, -6.327198715418309 55.62544925251973, -6.32536101857912 55.62761436159212, -6.321806434444418 55.62841423296553, -6.322503175575451 55.63226243840285, -6.318962710643676 55.63412144195882, -6.318129707051879 55.63366912657409, -6.315964905686713 55.63503636374169, -6.316547512460311 55.63630675616139, -6.314850546728827 55.63914108508824, -6.312474192634933 55.63828067859709, -6.310234201843524 55.640825771778324, -6.310851046882941 55.64117014448971, -6.310502932404514 55.642030170738934, -6.309257803954904 55.64309516252362, -6.31031558923002 55.6437322998713, -6.308956100066892 55.6443774302075, -6.308495284172178 55.64576163328174, -6.306226097931654 55.64618825185991, -6.30349831512703 55.64740162674402, -6.303099199116425 55.6481092800596, -6.303959944350773 55.648502919711774, -6.30180499709795 55.64904104071416, -6.300487332563299 55.650069950251485, -6.301549785355125 55.650128974739296, -6.301602486639098 55.65060881017118, -6.300060292693153 55.651144644858704, -6.299509593546622 55.65016207042333, -6.298130966616889 55.65032605716279, -6.29541891212338 55.649823900697236, -6.294254144215027 55.6503849583393, -6.29019683101506 55.65066199954076, -6.288668011179053 55.650387996433395, -6.285172151852352 55.651126893136556, -6.280896388662879 55.651276394852296, -6.273104356905605 55.649795146432076, -6.27327693513118 55.65075248624836, -6.271128570742751 55.65073107468972, -6.270114252740671 55.65111324783074, -6.269607595199984 55.652402538553886, -6.266758075653688 55.65313763794196, -6.267735029332657 55.65366234818522, -6.267500715961026 55.6543255906688, -6.262637664274577 55.655342655529736, -6.259333991122332 55.6572301301606, -6.25961068386358 55.659147208491284, -6.261869266349885 55.662681231125944, -6.262327400401211 55.66532414398086, -6.266183167940775 55.674438134375166, -6.26790311402132 55.67801971947962, -6.269762322614572 55.67943851211152, -6.268729160478089 55.680591997332854, -6.26959868269901 55.68106264903573, -6.269538251214387 55.681758372912725, -6.275978790328859 55.69109030612738, -6.291865516857535 55.70565981627662, -6.29827218365227 55.70994389679777, -6.306846914011548 55.71438272149504, -6.312896180220383 55.71632802605291, -6.314325935649654 55.715988702714114, -6.318871851435271 55.71698469608689, -6.323711154819375 55.716621456963864, -6.324252865815663 55.71565823579861, -6.324703220615628 55.71602770247176, -6.324981507843026 55.71576740741028, -6.326787178268334 55.716050513254224, -6.32803607015222 55.71407967438152, -6.330907893540935 55.71351583171003, -6.334723470593305 55.7156160270088, -6.335350163516674 55.715728740213606, -6.336979172279049 55.71472701408495, -6.339514134874066 55.716660416927574, -6.340302010892515 55.7160737588221, -6.341317537972543 55.71630754973706, -6.340649214515842 55.718277254537654, -6.337992015563072 55.71954662729182, -6.337622579413209 55.720214794890474, -6.338451409453644 55.720917643101316, -6.337782771174435 55.72257905283366, -6.336351044333429 55.72351600835637, -6.336677510537757 55.72768553670318, -6.337410894746674 55.72844956776972, -6.338928180296327 55.7285885693538, -6.33855015276761 55.72917996879896, -6.339971877667311 55.729380138898556, -6.339066801597975 55.729836061616226, -6.339698003657327 55.72998713093798, -6.339139315364974 55.73048859423878, -6.333227923902808 55.732894134840166, -6.33163268987404 55.7366691410234, -6.332187874917449 55.738595552573315, -6.331595106604699 55.739714745097594, -6.332721815455082 55.74033004183982, -6.331812363449608 55.74167235966789, -6.33243947085038 55.74178508070624, -6.327050995191192 55.74369012547852, -6.323158629462611 55.7433842316859, -6.322608041130217 55.74365411458477, -6.322990698195573 55.74525909877913, -6.320565092869459 55.74432339520448, -6.31662999993909 55.745174851009956, -6.316049516510194 55.74579256379824, -6.317046441495932 55.74677866022255, -6.31568579997297 55.74682654341089, -6.314924296248527 55.74889567775292, -6.31400779075765 55.74956374046445, -6.311350444912666 55.74838552541847, -6.307729120673326 55.74777204712999, -6.305822005831463 55.74802796118601, -6.299347200714968 55.75202680423479, -6.295855685387004 55.7555130100092, -6.292382140101217 55.75684883250181, -6.291574366998666 55.75617554016637, -6.29214757276243 55.75587666121405, -6.291760568372396 55.7555484187494, -6.293147241241162 55.7549602378943, -6.291204371457088 55.7533256700473, -6.289096671165091 55.75402404567875, -6.288965237817207 55.7544949144548, -6.288176288035849 55.7539918332382, -6.286642202136511 55.75396450276212, -6.286736984410695 55.754536824873284, -6.284912671581154 55.75477145208405, -6.285193314805966 55.75514840367922, -6.281608819193062 55.75591215993754, -6.280302144774543 55.75490543141036, -6.279174718704525 55.75538157989122, -6.276026916499704 55.754460909573915, -6.27410843817059 55.75529227719981, -6.277201573348636 55.75615584614129, -6.275242424897884 55.75690770112726, -6.277221143699766 55.75807993357921, -6.27715229411412 55.75960703608285, -6.270642446418267 55.760536330807945, -6.271352069476809 55.76187311465747, -6.264925230456117 55.76393151609865, -6.261829393228912 55.76392216959934, -6.261376942154806 55.76489126938824, -6.262310863309581 55.76599209199404, -6.260808843040703 55.76611621633147, -6.260733026609103 55.76886325765549, -6.258116261259058 55.77030805053329, -6.254261136168281 55.77116388865564, -6.252078213040543 55.77316517166391, -6.252878699320089 55.77707893468587, -6.255272835982074 55.77798883298396, -6.253040810561802 55.778925027497216, -6.24988998293401 55.781165984655324, -6.252397403091942 55.78174322558262, -6.246437164760137 55.783424436662905, -6.240006934257386 55.786668770365836, -6.242061076318735 55.79058215862485, -6.238032314685639 55.79126097964982, -6.236762051393106 55.79264494891776, -6.239054128935408 55.79404982780243, -6.239259937187815 55.796381173774314, -6.240318965203265 55.797163052862246, -6.242831997890081 55.80308424990543, -6.242532798094771 55.805028312281294, -6.245077729744463 55.80830411866201, -6.243382803199597 55.80857857279227, -6.242352313675887 55.80923477613906, -6.240533491678594 55.81218470259604, -6.235403341258699 55.81479917033198, -6.233247890094734 55.816717278848095, -6.215395849580543 55.82091106383868, -6.21209336704445 55.81844313740524, -6.212352120036497 55.81552022953904, -6.217270816514641 55.8115289544406, -6.215501600425262 55.810825228956254, -6.207890321836287 55.80941346256069, -6.209093368397317 55.807393561749734, -6.204751202370366 55.80267665706461, -6.214101763030975 55.797301428206595, -6.213276089955043 55.79571985765961, -6.211599082243553 55.79468014803746, -6.208010926869013 55.79663797008954, -6.204198791038912 55.79593216340177, -6.19838304167419 55.79766917001413, -6.193284808085004 55.795693902130566, -6.189085888381313 55.796286960780236, -6.17851651711199 55.80208844705391, -6.17099547352627 55.802533082390866, -6.165540835790808 55.803338853445126, -6.167270939963826 55.80130151393762, -6.164487973109205 55.799615194950704, -6.165160952352844 55.79814436969878, -6.164227412394451 55.7964312590688, -6.156309369416777 55.79060187803686, -6.147607448374595 55.79148081784622, -6.146098065576255 55.790497539460226, -6.146492310794355 55.78505204860879, -6.143989215624774 55.78237553350071, -6.140539303396062 55.781448707030194, -6.136595955831439 55.77963006302551, -6.130044523796362 55.77563270652786, -6.126603612333398 55.774480359609996, -6.121155289024069 55.77154267761022, -6.113105964253636 55.76844015599865, -6.098555960688611 55.76752400211904, -6.097238577748255 55.77047288726357, -6.10577741746217 55.770808046433714, -6.084687309646926 55.78377685560766))
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>