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/S02001985 http://www.w3.org/1999/02/22-rdf-syntax-ns#type geosparql: Geometry
http://statistics.gov.scot/id/statistical-geography/S02001985 geosparql: asWKT POLYGON ((-3.6593803300417855 57.43030679736927, -3.661686306921296 57.42846229729307, -3.6670590052814607 57.42903817530322, -3.677596130472332 57.42708349823746, -3.685466010050862 57.423285935916205, -3.7149627779741743 57.431059347888066, -3.7153088085267263 57.42968424517134, -3.7162557423794462 57.422160482808884, -3.7298348728051316 57.417716167081274, -3.7303921619991303 57.40623550136241, -3.7238183719376026 57.402013165596344, -3.722677363637662 57.40233424663112, -3.7225376017552696 57.40167580904656, -3.7228819172443943 57.401033210369725, -3.7226452477067906 57.4006007072428, -3.7211019248123964 57.399987117575975, -3.748754804220254 57.39580254277848, -3.7578889354535514 57.394372616438076, -3.757297040536017 57.3931320432694, -3.7584796658993547 57.385514702283366, -3.763922123880561 57.38002094250935, -3.771828195935253 57.37874193327152, -3.771516861303458 57.374011495952864, -3.7762791346143074 57.366217718279046, -3.775955373548593 57.36433554225854, -3.7783414988764332 57.361417821701934, -3.7801581341316717 57.359792894561615, -3.7835596374102556 57.359313475192906, -3.7891627268082737 57.35932378454508, -3.794095541754617 57.35888519019774, -3.797465466699879 57.35504562832831, -3.8016216109415684 57.353018562951725, -3.8064190258462944 57.350182541355586, -3.8091549214809124 57.34802286147394, -3.8099981438272716 57.34827128723073, -3.81202543521155 57.34860149109117, -3.8135290526049395 57.34741182976973, -3.8294151263369325 57.34469310355152, -3.837887068209651 57.34429110532254, -3.8439063604912707 57.33971967941296, -3.853237562052666 57.34683320772935, -3.8655515814775416 57.35041581540684, -3.8723375448173365 57.354421034275035, -3.876300820189379 57.358791466483694, -3.881569138812543 57.359081178150255, -3.882915070077491 57.362636968833556, -3.881929896896988 57.36677569258694, -3.890757380080488 57.37286980618424, -3.8959547431039856 57.38173144719695, -3.905814005525801 57.38418814005195, -3.909784132814733 57.38311269720586, -3.9145879184291696 57.38463003377145, -3.915695155733317 57.38512532159407, -3.9211131226364984 57.390739109125825, -3.9282357310543676 57.3983571415023, -3.933970805581493 57.39949111925124, -3.937860668008057 57.39687963224094, -3.940183098946116 57.395478176983374, -3.9481123989684916 57.39531082009414, -3.9589179737821896 57.40694027337191, -3.959872214389684 57.41171434474981, -3.9590232854290406 57.41265299006437, -3.9595542986700663 57.41480108876058, -3.9566331895688203 57.416850116945604, -3.9577201946677465 57.41974430831388, -3.9614819759904916 57.426559175307325, -3.992056537598627 57.429511628574424, -3.992934930863365 57.43126775836944, -3.994271195440061 57.43255840630852, -3.9945945763744772 57.434520967931846, -3.9970428932687545 57.43542560619709, -3.997092225450734 57.43816521482372, -3.9976214924617626 57.43962136104491, -3.9974270722049057 57.440945221135195, -3.998155680957593 57.44147276198844, -3.9979147606757475 57.4419437961528, -3.9988226344035573 57.44239661175197, -3.999261387558847 57.44310844183995, -4.001024837335483 57.44427544019668, -4.007410734089741 57.448899927173045, -4.009079277853978 57.44863074481722, -4.010905866391649 57.449419236894755, -4.0158475245157605 57.456231711703886, -4.028116538805296 57.45262060941845, -4.0323831125938465 57.45921869578609, -4.0351979230551045 57.46389481881007, -4.036037344114344 57.46511088794693, -4.039918254077625 57.46911673312856, -4.040978873933393 57.47038762060754, -4.041355688068053 57.47172440949174, -4.043043854638797 57.47310746517294, -4.045582609543217 57.47469369618614, -4.049533832663721 57.476512635639985, -4.0470182625734346 57.47763261602288, -4.045380228952986 57.4780606395776, -4.044613105654236 57.4786906716976, -4.0448645688993325 57.47908802286813, -4.04635660136325 57.4789304333581, -4.047809826499228 57.47910573790202, -4.0490802169527305 57.47901276859406, -4.051465637484912 57.479393179606, -4.0522827689514695 57.47788400163189, -4.054632099539321 57.47885709425117, -4.052560464014505 57.48033082163072, -4.0543090525566114 57.481440351873665, -4.052674989926167 57.481567929420684, -4.050287480868644 57.48242440681639, -4.046107613683906 57.48403078026606, -4.043233005118675 57.48446773650876, -4.041754037731375 57.485196822147834, -4.040705112200953 57.48651074086661, -4.038823278789354 57.487145579911115, -4.036458744052966 57.48751117276263, -4.03330927111311 57.488689126784244, -4.0325039433933965 57.48934427886739, -4.0321156994260114 57.49077339400812, -4.030637652733635 57.491527513860035, -4.028643808521109 57.49221762180953, -4.025482025908743 57.49259257436842, -4.024188977102285 57.49289033986293, -4.023468097448608 57.493369975939345, -4.0176041328489145 57.49560784240286, -4.014671746750608 57.49783815705939, -4.0143046135652805 57.49823284959643, -4.01262833430233 57.49906718669176, -4.012013238778329 57.50000420956835, -4.011431002683962 57.50153890659622, -4.010544286068794 57.50214902669009, -4.009215607001199 57.50255197396343, -4.007035307658288 57.502513963671525, -4.006453807099598 57.50268682915193, -4.0057860973093575 57.50344282121277, -4.005135592232491 57.5057437991146, -4.004304924975589 57.50682412779555, -4.0022762829780065 57.50763458337738, -4.004452244358557 57.5091221598999, -3.999857786484241 57.51273647836929, -3.998805780379831 57.5137827908536, -3.997362361598792 57.51434956481078, -3.998335748433375 57.514875708030324, -3.988881507667015 57.521100493102445, -3.990588955399018 57.52244669850092, -3.9898683834477606 57.52299587471389, -3.992477823260332 57.524031500519165, -3.998339727447089 57.52271345175318, -3.9995260261317416 57.524217056915724, -3.997583562569889 57.525287507262036, -3.995470660343839 57.52576652199699, -3.996060747611359 57.52646269081611, -3.994740594417272 57.5275603831783, -3.9938645307508174 57.52794554275757, -3.993073605229313 57.52862640553484, -3.9948759799653764 57.529549294038304, -3.9929810355368476 57.53131301712205, -3.9912048693211366 57.532742678131925, -3.993347295162874 57.53363979198809, -3.9931145321489474 57.53411688421956, -3.997271414685997 57.535981970083206, -3.9936442181218497 57.53795126067709, -3.995961333434964 57.539978955200716, -3.99679967308583 57.54045353043854, -4.002352508267671 57.544870650574715, -4.002887353083017 57.54502866114726, -3.986554223869752 57.551112929176305, -3.985369251599127 57.55060248010387, -3.98468547593158 57.549654330060115, -3.9848362348908224 57.548388348934665, -3.982259617248545 57.547276118081754, -3.9845295757283465 57.54654216587025, -3.9852130610615597 57.546974777895024, -3.985521175404173 57.54619405585589, -3.985368747031457 57.54528757696704, -3.9844005607136577 57.54454910108103, -3.982034926554267 57.545417564487096, -3.9790237772874963 57.54617417362014, -3.9749886164501462 57.548290972763006, -3.975622145953777 57.54862378889031, -3.9768356686907906 57.54890988309283, -3.97861213742161 57.549887707064215, -3.9737797458632933 57.55255203896884, -3.977280523169384 57.55457738921296, -3.972384650959945 57.55640584745761, -3.965157007278473 57.55930743815632, -3.9627027695447734 57.56019868217315, -3.9609249734603273 57.55974411925679, -3.958103755825249 57.559314209795296, -3.958164859920131 57.5595481116515, -3.954667465903828 57.560238995813826, -3.954732823584004 57.56200192794818, -3.9541600600564024 57.562639413070364, -3.954272897478453 57.56329524262034, -3.9495568234576446 57.565214284257166, -3.957572688129701 57.571875919755236, -3.9581554313068166 57.57185071214751, -3.962954486671852 57.57550852728695, -3.9638965912090556 57.57521650587974, -3.965718229836247 57.57512929581888, -3.9686188353001035 57.57473087084599, -3.9709503078483217 57.57461602250421, -3.9745775444386715 57.574147266926836, -3.97563588230287 57.57413071368855, -3.9753215722208166 57.57574473884458, -3.977555382600854 57.57585815940404, -3.9785744673762466 57.57576766884628, -3.9824660733548924 57.57614299458075, -3.9787124079753733 57.58303078610467, -3.978208813714896 57.58317604139426, -3.9749828436451757 57.58467239250433, -3.981839824360131 57.58989382204592, -3.98043531525211 57.590397674767495, -3.9797539312359347 57.59094460163962, -3.977263185240467 57.59138479762135, -3.9754859306285675 57.590976850051106, -3.975553823672355 57.59016177951911, -3.973743975511149 57.58887292459133, -3.9715230620449447 57.588641664216084, -3.9716913713944515 57.58822754063071, -3.9728828913985685 57.58752340717104, -3.9717064680699976 57.58745552455366, -3.971659601586668 57.586713226506376, -3.9712813465828978 57.585968014763615, -3.9705226136471827 57.586384163039945, -3.970813517832527 57.58687557621462, -3.970190134644794 57.58753668769664, -3.968474778538675 57.58795965502895, -3.9663930827587737 57.58816728061838, -3.9645992245949815 57.588190702581, -3.961669828797026 57.58853272443035, -3.9602224010976874 57.58799904814209, -3.959697526909726 57.58825606643094, -3.9583121079519357 57.58828384291912, -3.9558525627715158 57.58852859777071, -3.956081777599111 57.588840407783465, -3.9574823945491766 57.58887710959871, -3.959794811854864 57.58857171374875, -3.9610835785925858 57.58923454152126, -3.9623495078512225 57.58909987753548, -3.963852630011447 57.589330780984604, -3.968832759961568 57.58956861357367, -3.9709196537061984 57.590074247255025, -3.9721986072541067 57.590952748205005, -3.9741322457779193 57.59193151767608, -3.974611279008904 57.59240380994885, -3.9762816741864686 57.593339043753936, -3.977413487367198 57.59353696276342, -3.978828633324692 57.594299161727015, -3.9802293904266013 57.59479562526198, -3.982625917267869 57.59507878662418, -3.9853579188174537 57.59657315367975, -3.986400356548605 57.59687841707153, -3.9896994886035535 57.59821103439605, -3.9927781330046193 57.59890464169873, -3.9940600948691825 57.59942529051149, -3.99505842417562 57.599625160801324, -3.9957554034231944 57.60018917143466, -3.9971616830293946 57.600716810214024, -3.9983055928871507 57.600945800184164, -4.00154173342763 57.60120903481337, -4.0026189373177825 57.60162412759024, -4.003251461607921 57.60162218570213, -4.004239774605424 57.60203328358368, -4.005550457921289 57.60212838626406, -4.007077825976961 57.60260188299897, -4.007687932312126 57.60313396653521, -4.005173340595341 57.603030146625095, -4.003545606324895 57.60280080538847, -4.000512666003506 57.6021264984648, -3.9937985382052017 57.60030272906612, -3.989915550913158 57.59910250397941, -3.9873026035024277 57.59817149487962, -3.98233942790171 57.596670870827566, -3.9798110644199394 57.59578061036166, -3.9758076324599583 57.59453243177429, -3.9721994421939577 57.59347112800772, -3.968435380530431 57.59243191821088, -3.9637762620522223 57.591296904009745, -3.9588471721039467 57.590300676492575, -3.9539318587557504 57.589400181016345, -3.9484610169697403 57.588587131503, -3.943210673113078 57.587700375404616, -3.938858826797114 57.586842740122194, -3.9359958120920706 57.586389809807564, -3.932886278480597 57.58605019952777, -3.929550261596129 57.585823584806285, -3.9276207828984977 57.586253756912775, -3.9258230429653884 57.58648692611019, -3.9239256632638373 57.58657603785232, -3.9170777588927113 57.585831123206184, -3.9138166873748483 57.58581858462449, -3.9120885630061357 57.586040619918165, -3.9063960841146343 57.58655792253498, -3.902633756089869 57.58701366475571, -3.896188415964189 57.58569930513657, -3.8964565189815454 57.58554816819559, -3.9016557798848863 57.584707042102366, -3.902135601314981 57.58511064148655, -3.903190143412173 57.58522386291328, -3.9059652423526767 57.58481815372522, -3.905987427291735 57.5844069939806, -3.908684215150613 57.58414304926932, -3.9082878585117897 57.583294935858206, -3.904653550706984 57.58380783281265, -3.9042479882940255 57.583156175503554, -3.9044505964826364 57.58264007912019, -3.903894410153876 57.58180692306653, -3.902583427665094 57.58200636859155, -3.9021188793037487 57.581438358477115, -3.9013394372324384 57.581566893294585, -3.9018132520424786 57.5832853020777, -3.9005902736021767 57.58370661162125, -3.899344842859321 57.58245043082426, -3.898868899610399 57.58230485117551, -3.895977164377826 57.58009319082362, -3.8959409994227605 57.57914314002789, -3.89888514023269 57.578764720570796, -3.8997365280822036 57.57873394753414, -3.898105454881151 57.5773851668403, -3.8966069764321314 57.57599976639054, -3.901697206444504 57.57528134670183, -3.9027683213318785 57.57557527645648, -3.903673945304206 57.57494050247582, -3.9008087703665764 57.57427947444524, -3.8994410069574847 57.57466841882495, -3.8984540859151426 57.574741883131374, -3.8968089165588173 57.57386849739706, -3.894710212001728 57.57261009212998, -3.892251993732754 57.57341968858258, -3.8924142631279324 57.57390653365558, -3.890889231410629 57.57407729834154, -3.8899796804499487 57.57522843810344, -3.888191067560134 57.57581274280008, -3.8864978496168847 57.575329626137396, -3.879888444934613 57.577530547310644, -3.8774584111122765 57.57678504977234, -3.876557941018255 57.57680716618067, -3.876984785552716 57.57549401797927, -3.8744893654340387 57.57525069634514, -3.874375489797371 57.57572572260282, -3.87310629718282 57.57557464925763, -3.87242508885522 57.575210711379434, -3.871927722320999 57.57583316790767, -3.8688121165188627 57.57531588927908, -3.869233080549921 57.57635019014847, -3.8683823552633796 57.57667407139061, -3.866879463801088 57.57753829863752, -3.86494794254863 57.578403231244444, -3.864063643573032 57.57910402505385, -3.864259474877653 57.580125950049855, -3.8655624273231406 57.580252608273334, -3.8652213367023345 57.58135122845848, -3.865237970199591 57.582285603817674, -3.8620572285795154 57.58304160448455, -3.858840247998026 57.583592116911866, -3.859618257835807 57.582448639665486, -3.859680752239752 57.582034428329976, -3.8588851000378823 57.57988090195143, -3.8619622882524345 57.57584974895632, -3.863337792184801 57.5737106851083, -3.861826450741899 57.573325093022866, -3.861574341416301 57.573945957860055, -3.861890899402237 57.574586820892826, -3.86080942898579 57.574982648715014, -3.8601651264565437 57.57573831364689, -3.8587099674153786 57.57525933948224, -3.8570928117119885 57.5756681203434, -3.8564809456572333 57.57686351144283, -3.85541003349044 57.57737423562963, -3.854442261329479 57.577325595215086, -3.8538635829976506 57.57802550095316, -3.854742098695075 57.57880921371012, -3.856158614535921 57.57922021973496, -3.853568300890604 57.57959068539513, -3.852473544817699 57.57963273060513, -3.8514307643765884 57.58014511834061, -3.851573718266978 57.5805045630947, -3.8527168931340694 57.58086394763, -3.852750209430459 57.581506390240236, -3.852232501020074 57.582527610389306, -3.8499631334059368 57.58253682840784, -3.8468085893816344 57.58271948461481, -3.8418336814248675 57.58292725502465, -3.8417713214889555 57.583050989512685, -3.8432641226307793 57.58559822652861, -3.8502478781422402 57.58468859251485, -3.8510041841479157 57.58536898448515, -3.8489471309338112 57.58573868644816, -3.849015926775425 57.58610638883627, -3.847491919793703 57.587329799818896, -3.8485196970150066 57.58787402163559, -3.849212886720233 57.58859831119671, -3.851918795829856 57.58728795478173, -3.8523152143796495 57.58768950250946, -3.8580689159491413 57.58660300327184, -3.8601427430147406 57.58616943064688, -3.860533435526373 57.586612904922454, -3.8615595284809134 57.58672355901767, -3.8625464387974153 57.58639455619547, -3.8633503358640082 57.58659580845767, -3.860980323620525 57.58887756660863, -3.8601274156874616 57.590227006319914, -3.859874569149872 57.591533465226476, -3.859962021263303 57.59236143619827, -3.858279782602203 57.592576663090895, -3.8536085404941174 57.5938626753553, -3.849528512063442 57.59516591199513, -3.8483057611955593 57.59517392517496, -3.8450997416913553 57.59613090599546, -3.843472480460648 57.59641251287003, -3.8384185525323735 57.59766220951249, -3.8360771028778307 57.59785348643019, -3.8357295874251776 57.597532405601015, -3.8341250406087206 57.597171181829744, -3.8324839107777766 57.59724620800654, -3.830984101816037 57.597902246657156, -3.8293889927923614 57.59832785180021, -3.8278174834518746 57.59905766297769, -3.8258461848480803 57.59962522595491, -3.821849330396651 57.6016864221633, -3.8194096661745736 57.603100665752926, -3.817633036504491 57.60371919949247, -3.816715654879299 57.604284926567836, -3.815449114826959 57.60472988423691, -3.814094271316416 57.605418672017976, -3.813302457022883 57.60598706257503, -3.812153342955859 57.60643928524876, -3.8118671515013425 57.60691057108724, -3.8109365474578736 57.60738210936697, -3.810389150735273 57.60731358734624, -3.8100932414086306 57.60809496493191, -3.8093522570875678 57.608172959471304, -3.809384163716695 57.608814876755794, -3.8076797808546976 57.609885936204684, -3.806744400537617 57.60958935752804, -3.8056682624026648 57.60982934611946, -3.804772585972971 57.60965796502653, -3.8029694563957492 57.609921788178504, -3.80277558781469 57.60955620044759, -3.801357100745502 57.60964381178545, -3.800439688167066 57.60954009180292, -3.7992775673111243 57.61007323822207, -3.7992789495933974 57.61077848062578, -3.798882871507555 57.611062630862605, -3.8000236199338806 57.6119582856327, -3.7998344929286882 57.61236526985517, -3.800480912202052 57.612742383123276, -3.799726694827122 57.613570691741266, -3.7975205807550614 57.61466222991207, -3.7962059716850183 57.614653969645, -3.79589092420863 57.615224452965016, -3.795100286383796 57.615487244383814, -3.7945018697534323 57.61676251740317, -3.79403128691089 57.61621666968932, -3.7927911775134184 57.61687214725476, -3.791835076960734 57.61785600131283, -3.789822647356155 57.61898059076732, -3.7876655761508875 57.61903807383997, -3.785936299216918 57.62013613362409, -3.7852883615603354 57.62006892248255, -3.7831637506584603 57.62147349705532, -3.783289676202036 57.62182210343617, -3.7826693835323844 57.62317398906348, -3.7824722522585086 57.6244480305542, -3.783161451033836 57.62415979953232, -3.783670977542547 57.62345184388625, -3.78469504408452 57.623504768995545, -3.7851997129985655 57.624063645349516, -3.7874358769973675 57.623564863211485, -3.787673870704417 57.623296463635874, -3.789112926762734 57.62293470182048, -3.7899509288998314 57.62294978914002, -3.79219207996015 57.62272486910104, -3.7946941966413252 57.62202004075222, -3.7973527975317225 57.62143422352541, -3.798104094719289 57.62223660819793, -3.799168524784384 57.621412880659356, -3.800631822242645 57.62103716455119, -3.8021045421777178 57.620176148800546, -3.8027066963151657 57.61931855183035, -3.8038068960932057 57.61905129523429, -3.8042744535594992 57.61936356111243, -3.80496500314774 57.61843281684467, -3.8050574360303377 57.617595963017045, -3.8074995980842514 57.61738137284589, -3.8086877035487086 57.61669504832372, -3.808783284082425 57.61609173606731, -3.8108795512765434 57.61565742362091, -3.8126408705499255 57.614549569712544, -3.8147609182512454 57.61375548017338, -3.8149898345322364 57.61347817261233, -3.816018217284427 57.61345441373786, -3.81676100652097 57.6125722633882, -3.8182435656169544 57.612425160170076, -3.8193844654176248 57.61247612088319, -3.8202514332750677 57.61173590940049, -3.8209135906298304 57.61091778464806, -3.8218390078329914 57.61101225706153, -3.8221351363868528 57.610239831450954, -3.8230068506425594 57.60993077694878, -3.8229568058444756 57.609432871323776, -3.8236056899171507 57.608853006326896, -3.8247313702081134 57.60876937324043, -3.8250431735784876 57.60831116358762, -3.826341594216794 57.60783420421451, -3.8268153359684134 57.60793516736586, -3.8264447303854427 57.60872215821167, -3.8247908537338913 57.610623769128054, -3.823081988406951 57.612099396507965, -3.8218029722098223 57.612800647537895, -3.821049744644269 57.61347184853387, -3.819251972527871 57.6143467563095, -3.8173820514164865 57.615622474935975, -3.8149976394678164 57.61692442164115, -3.813033414037096 57.61772436370529, -3.809014334234858 57.61956083811311, -3.805761010670618 57.62097745959944, -3.801608064810934 57.62249217203008, -3.7992650214551977 57.623194873617074, -3.79688221113546 57.62377231738121, -3.793089270554988 57.62445058644976, -3.7882879201981186 57.62505766226593, -3.783837840897618 57.62548889777696, -3.7819150997643782 57.62555195609285, -3.7798311307626986 57.62591373315381, -3.778156283393692 57.62608105307253, -3.7752052103429503 57.62686372804546, -3.7732521381094757 57.62716515990344, -3.7702114432448877 57.62800287867971, -3.766555416803917 57.62910517218261, -3.7658214478251804 57.62951072976412, -3.7634607316614943 57.63021749617999, -3.7623514437874572 57.630690259002776, -3.759909030016341 57.6281539297193, -3.758977870174584 57.62704567235725, -3.7568059881339684 57.62299259389652, -3.7511953843994754 57.61288246291473, -3.7500702120599536 57.6107193996035, -3.7484044948523305 57.60771929918305, -3.747041818457967 57.60583171528921, -3.746791554533869 57.60515058475412, -3.7460166083575617 57.60501036245815, -3.7448632020801393 57.6051799242116, -3.7440150515949484 57.60501374821808, -3.743390616637886 57.60459112774071, -3.7426227896837916 57.60330531105031, -3.743085822697798 57.60259456865973, -3.742388468905896 57.6013814481461, -3.7399570914881255 57.59960016276959, -3.738753719440953 57.59819454344759, -3.739355946448654 57.59756006038348, -3.745013285868411 57.59458735681124, -3.746345659743366 57.59421407201925, -3.749355520363236 57.59278168245262, -3.74868327705481 57.59090701357087, -3.7464725058930783 57.588414849030556, -3.741135614734652 57.58581843759189, -3.7277523847940164 57.58015534248515, -3.726909197685279 57.58043280412624, -3.724955770794808 57.58068230407155, -3.724515654726492 57.58007649583064, -3.724818754668385 57.57835279674652, -3.724355551492467 57.57697556742035, -3.723230102094753 57.57598650421123, -3.72249051257775 57.57452679176035, -3.720529464878599 57.573510467771115, -3.719899394947959 57.57273833051901, -3.718478100195203 57.572668736520534, -3.7179041066741636 57.57294337416955, -3.716543597354471 57.573028356568926, -3.7157879888972536 57.57271340014695, -3.7159773590842775 57.57215381235372, -3.7169628774569388 57.571172828258916, -3.7172166717385986 57.57066806383231, -3.716277952700062 57.5703340385848, -3.714458449891794 57.57022129734091, -3.7135696682236436 57.56966826042471, -3.7131837528891367 57.567860503486884, -3.7123298844053174 57.56701679788677, -3.71308175734644 57.5666148927223, -3.7149306614250976 57.56650354861991, -3.717270279621609 57.5656649783161, -3.719198583868348 57.56511137082028, -3.7204272972490062 57.56425911168317, -3.7214968708343314 57.56439277218474, -3.7228109318040707 57.564074779879405, -3.7245918162397564 57.562846594239325, -3.7254645050016117 57.562600185539, -3.7273512793937265 57.56251688927201, -3.728653496294733 57.561880958295674, -3.7297325701419894 57.5609821397383, -3.7271727011867615 57.55955815750515, -3.725326366845518 57.55840827503084, -3.720634348298787 57.5566359478509, -3.7196602003771977 57.554231588563596, -3.7165999242623227 57.545918885133496, -3.716520276451557 57.54593074920887, -3.71191059534962 57.534079476370074, -3.7223091630104665 57.52866698127973, -3.7123593748335377 57.52804861314404, -3.7065726828943433 57.527662521394994, -3.697012184047157 57.52390850866374, -3.690887414182293 57.52024165381945, -3.6922079425505574 57.51980349342538, -3.6940711627445353 57.51814248018114, -3.6944618432805387 57.5169180865218, -3.696554507017452 57.51621256046565, -3.6986081259583656 57.51420212765812, -3.7001316060347045 57.513288582325295, -3.701080813189076 57.51252021992845, -3.7017665354747926 57.51233218745863, -3.7036278455817184 57.51254514714406, -3.705346188642918 57.512341349970505, -3.7050798224812165 57.51189214823565, -3.7054357362535177 57.51100509220117, -3.6997072957522104 57.50811493263395, -3.698559695254535 57.5074502886809, -3.696154916700576 57.50569928986813, -3.6845321703182994 57.49699127850585, -3.6862220408816504 57.49401291237153, -3.6827098382386976 57.48984625427796, -3.6862039055595455 57.482221443920594, -3.689840865291318 57.474832682582054, -3.691570030646564 57.46786471429897, -3.6935067514364643 57.459811324259945, -3.694528046779061 57.45540431707864, -3.692495555150391 57.448033119690415, -3.6913966265223497 57.44354228340178, -3.691492845407861 57.443280449287606, -3.6951462382725158 57.442292505775335, -3.7030003253617743 57.440669169181476, -3.7013037240162117 57.437286155467035, -3.7006056420518165 57.43624442087188, -3.6979965334164864 57.43602355622862, -3.6980063301237394 57.435336128900445, -3.689812447787452 57.43466465404621, -3.6868208076301294 57.43445318103553, -3.6832329027806385 57.43395312465898, -3.67847838155205 57.432165801475776, -3.6762724306980084 57.43146295540142, -3.6735266492148333 57.430973879658836, -3.671425796175694 57.43074571689303, -3.669098748983378 57.430304895118894, -3.667515840591415 57.43011023397751, -3.6660388889479933 57.42979106850407, -3.6650507375389467 57.42978167079957, -3.660815643623716 57.430310136726355, -3.6593803300417855 57.43030679736927))
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>