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/S16000114 http://www.w3.org/1999/02/22-rdf-syntax-ns#type geosparql: Geometry
http://statistics.gov.scot/id/statistical-geography/S16000114 geosparql: asWKT POLYGON ((-5.039774945767209 54.997783680691356, -5.029516980126662 55.00260958158802, -5.0154806969220695 55.00575012389087, -4.992475801227863 55.009060681111976, -4.986862487677382 55.01098782655008, -4.978496945068908 55.00924668642044, -4.973253324342722 55.01152813935028, -4.981083922828488 55.017858862278906, -4.974072831527672 55.02354164182109, -4.962258894052451 55.020265338716044, -4.95001677471472 55.03136026289565, -4.9442490346491095 55.039249514020334, -4.943226513353584 55.043553615608246, -4.930803276195946 55.05137385317809, -4.929900665118614 55.059270929446576, -4.933421565599015 55.06436443324888, -4.923068230052608 55.06620037284922, -4.912946068933957 55.06638014277734, -4.908867158737146 55.06198273980443, -4.901059335450596 55.06425938756278, -4.894751351380721 55.06085403014574, -4.896233051743838 55.05361334953307, -4.888188651303371 55.05226731176872, -4.88261382667715 55.04714936789148, -4.884551657173606 55.03958778032139, -4.873297412976981 55.03829441043088, -4.8698016985177235 55.04008499932665, -4.851225893643324 55.0436954003055, -4.841076421650834 55.04473743681667, -4.8352407838792315 55.04103045326734, -4.833758690164141 55.0355631483826, -4.827456601863689 55.03531429240995, -4.82438226780964 55.04122466759896, -4.81916477362935 55.04127372299234, -4.802373289873464 55.04438568824767, -4.7918447163957865 55.037975394001315, -4.794100795090615 55.03306007513167, -4.789231545029309 55.031459336042595, -4.782554858898087 55.03809391293264, -4.776012061527188 55.04183027857057, -4.761093205299201 55.037967207774855, -4.740355822786178 55.04717861238514, -4.7373606316093 55.04217583255163, -4.722024274219416 55.04421458474039, -4.715190316868399 55.037503778161735, -4.710965973929689 55.03961612012993, -4.688445539327122 55.04412978492892, -4.680768283117001 55.04427225571536, -4.677287821626704 55.04900635928141, -4.6668207760674925 55.050651154535906, -4.660872107954467 55.05350073654809, -4.651023025882643 55.055046156422385, -4.644588479495776 55.05198150391686, -4.633766927163659 55.05135775154245, -4.632284015906722 55.05798801548807, -4.627035870961337 55.06058699824621, -4.62922379240006 55.063978157511485, -4.625240198298523 55.068441964992644, -4.630556785870225 55.07163975050514, -4.628879644622504 55.076282950404114, -4.634734173440593 55.078228414199465, -4.643019946179496 55.07723517882192, -4.6469793087125995 55.08143257912762, -4.6591244883191925 55.09030101096586, -4.656985734085491 55.093026585608484, -4.658699711193812 55.1067967990469, -4.662364836839563 55.11227654975082, -4.658333437690983 55.1199291475671, -4.650322805995121 55.12117804270741, -4.645618355954483 55.12783354627454, -4.62671262880041 55.13437340827881, -4.626382184093228 55.139374056521405, -4.6163844564632806 55.139827466462755, -4.610778047459822 55.141804042842104, -4.598302506941255 55.13843466178876, -4.590604240240211 55.14264825600058, -4.584016187504784 55.14197024098847, -4.575467840227629 55.1529965699335, -4.564982045182873 55.158008939297765, -4.532135038421842 55.15831853396533, -4.51358605968217 55.15170478139175, -4.500349098325668 55.15263335993113, -4.4786343530023975 55.15291974322963, -4.463735604251854 55.16204454412869, -4.459997908031304 55.17005713665633, -4.45479852593185 55.17105638511375, -4.4468699866238435 55.16455510921513, -4.447467645289379 55.159446499549, -4.442456815748893 55.15414033545887, -4.440930311320323 55.13971520320742, -4.435464002623092 55.13833425993046, -4.420658553020095 55.143734956971116, -4.409579258297194 55.15154563645413, -4.406649426675306 55.15879899016109, -4.412864865680363 55.16813214076571, -4.409140663320078 55.17342368961502, -4.409230815947414 55.1792106511194, -4.401096451097142 55.186865911077106, -4.397319345653277 55.18644135468101, -4.39230031398501 55.202270897898835, -4.377396647889292 55.201451507718275, -4.381568569831041 55.20728447470099, -4.377248611922662 55.21249231274275, -4.37529591975169 55.21992787800494, -4.369628586345769 55.2273449631979, -4.365552996496339 55.22942039829917, -4.3613432584403 55.23786300356976, -4.361646752562985 55.242954556482374, -4.355356879484923 55.2526569104534, -4.359246489126311 55.25575915532281, -4.356357358384813 55.2626462219261, -4.348151820392893 55.2642920238589, -4.3449529261699595 55.270775712578626, -4.339052868301791 55.27230915938346, -4.327564384067123 55.27897343213094, -4.324146108322367 55.28433721174926, -4.319774876541516 55.28620907842099, -4.3108554750215164 55.29356443076526, -4.310522634408663 55.30098151621211, -4.3034227494809745 55.30610418401859, -4.30127924486978 55.310445512725956, -4.285797355169541 55.307585983470744, -4.2689607572040265 55.310484130085364, -4.249202017352278 55.30635119683126, -4.242296613048255 55.318005502299776, -4.232770853762876 55.32280436130261, -4.226706239490128 55.318102017057214, -4.201544532327298 55.31783925143624, -4.19476179682855 55.314887436364266, -4.179843812621425 55.30294897718203, -4.1735522131166025 55.29565052519309, -4.149672376340548 55.28517555918802, -4.139341653951 55.28458855009482, -4.130608144248488 55.29602114271199, -4.124085359329777 55.29629214543955, -4.116392069696937 55.29957600904643, -4.112469845192042 55.3053916458531, -4.10258148796971 55.30518486713632, -4.092495616060442 55.303048218700376, -4.085864102477197 55.2973690995456, -4.07495689402463 55.29498448488299, -4.074160804548185 55.291620380506465, -4.062923866208776 55.278009162770026, -4.065074184687028 55.27424195484282, -4.064348227605202 55.26798973754984, -4.0778971009428595 55.26598205310157, -4.081715622622313 55.25996521901617, -4.0796491417640395 55.25671085933005, -4.080577965519246 55.25069564246953, -4.06984728332309 55.24570121400639, -4.071538870358899 55.24192905673458, -4.068994062130339 55.23745579619406, -4.056787185300886 55.23346943896243, -4.053969420599982 55.22472682113791, -4.060706653659146 55.2197012799737, -4.0582252634996605 55.215186387123104, -4.062433771283288 55.21297166212387, -4.058395469714247 55.20249708878268, -4.063406788395612 55.20064182737764, -4.063568074917569 55.19592315386559, -4.052953653715784 55.195542387744695, -4.0533466528485365 55.19249334586311, -4.040506326331726 55.19117649707687, -4.035411796583054 55.18816542596009, -4.039839772725622 55.1812111978405, -4.030543499667593 55.17948974653471, -4.029404297905071 55.17676111070521, -4.0193042134845856 55.171446228015796, -4.015021278289086 55.17105428126092, -4.006569260163083 55.164255137223364, -3.9925259322398583 55.160667547628144, -3.983918994733529 55.160550004794736, -3.97064278037277 55.16353725530869, -3.9662991363472933 55.16265202100757, -3.970521652731211 55.15684956095836, -3.96281656170173 55.149445767124966, -3.9538047835359347 55.144557467380515, -3.9396314507885632 55.14205620997013, -3.9428912286434215 55.13745643062649, -3.948423011615814 55.13571436402551, -3.953342995817769 55.13767575332285, -3.962060538387247 55.1310061184668, -3.9574038473025936 55.12576475554695, -3.958847104862497 55.12320700652478, -3.954878997299888 55.11887123713373, -3.9461216522779514 55.11502088081456, -3.9348970707048365 55.11345156223831, -3.9144074688653667 55.12086759612457, -3.901259204155883 55.12746195039851, -3.896726162609718 55.11942212501741, -3.876386445314107 55.11874403931592, -3.8514728581669617 55.11171955481982, -3.847127756490571 55.112351768029484, -3.838426327600768 55.10764804755184, -3.826277548374362 55.105022212067844, -3.819532513073592 55.101995500430725, -3.809151221294219 55.10782310057532, -3.785456776006972 55.11442358626627, -3.7817117906011437 55.11377203288942, -3.766165650963076 55.10367903538648, -3.757238543247967 55.10139052104093, -3.7462380735445553 55.103074838097065, -3.741351063833209 55.10074163350014, -3.7365474515692063 55.10288357266092, -3.727571023435962 55.100027464793925, -3.709851746370822 55.1025908645094, -3.6911642019461035 55.09869068430156, -3.6666918021922905 55.09901640205908, -3.659532377908941 55.09515792791233, -3.641042246410705 55.09513887894819, -3.6253978363876462 55.08746598195173, -3.6085159495786856 55.075469295807856, -3.618399433578112 55.07111612633642, -3.614801635305373 55.06706659426404, -3.6042376431008156 55.058627014261766, -3.609186185014424 55.05576128220241, -3.6124104195080227 55.052778836822085, -3.612201545995414 55.051204332998466, -3.607702882676277 55.0468780427604, -3.607876331838248 55.041910266771914, -3.6046780288510156 55.03202510362627, -3.598638467204213 55.02660527073902, -3.591226391972853 55.0234562220015, -3.5807739214628223 55.01400932734748, -3.5768508243148562 55.00769723401803, -3.5841382969709468 55.006837723321034, -3.589365191431471 54.999985001834304, -3.5884193434436864 54.99547582897486, -3.576117247017931 54.98066028938735, -3.5839622803183393 54.97463927470919, -3.5826179491705408 54.966480973903316, -3.577864516903165 54.96210120337578, -3.580405836591991 54.95414581662436, -3.5870426153641604 54.944315204997665, -3.588985798149174 54.92977602873924, -3.5811160274563276 54.925541351533525, -3.5725795282052295 54.92369197568447, -3.570257849322628 54.91540774104567, -3.5629675973327912 54.90720456049972, -3.5707375344757897 54.901128596178445, -3.5744010239750077 54.89361618917134, -3.590793244327849 54.88683454586566, -3.5961001694358874 54.88032806642118, -3.593638910233553 54.875946624444886, -3.5982660606751664 54.8718414264316, -3.60789364734067 54.871943504443635, -3.610493040239403 54.87490999600086, -3.625848030301183 54.876182033176505, -3.6340908700664483 54.87820324235844, -3.646906464201096 54.879382744919305, -3.68840718541387 54.87949318716891, -3.689693296843322 54.88273601839031, -3.697760192812681 54.88583839527304, -3.7165299479723304 54.879802653832435, -3.722873906898933 54.881035803967755, -3.7298363000456507 54.878102100160376, -3.7280730347943107 54.87518103171236, -3.74111715405169 54.868022901739785, -3.7422388087166882 54.86418521867042, -3.7537208817758554 54.86180801558239, -3.7632490240983816 54.856315975514576, -3.7683686890831893 54.85689402154252, -3.779010286134982 54.85404848506328, -3.7895394125834096 54.85446535205524, -3.7882032945961908 54.85852507642362, -3.7947741743430177 54.86492542478802, -3.808880964704968 54.86882082407354, -3.812259050725589 54.87137872753814, -3.8146195635802687 54.88013899284269, -3.818283397291178 54.883058269765236, -3.816351644095921 54.88714159828252, -3.8198079602553983 54.891734776468624, -3.8248902531961138 54.889505924959956, -3.8225790743252968 54.88607850853182, -3.823140984192444 54.87732577830483, -3.8293283561734235 54.87500282786929, -3.8247346026568723 54.86992368979594, -3.8262127967157733 54.861462732042284, -3.8164160072143747 54.85756246002558, -3.813914716104166 54.85254866722531, -3.808116181876777 54.85236374121473, -3.8072308239609964 54.84531514468274, -3.8161947620523473 54.84428705176489, -3.8267987832828996 54.85043923502707, -3.8260976009042382 54.85219254167808, -3.836217327937305 54.8592643784262, -3.837174315348546 54.86489071658514, -3.847877420189815 54.86521812508541, -3.851149218525915 54.861465252108616, -3.8452737772104055 54.85215870855476, -3.840436014552737 54.851044846387325, -3.8394962571575326 54.846004274145024, -3.847371869224002 54.84741711024417, -3.852953115232664 54.850857115900624, -3.8630867430111615 54.84708613936183, -3.8593563515235334 54.84149978875474, -3.8431949769499703 54.83547449889109, -3.8342594626808366 54.82643048026323, -3.8277652138230516 54.827340081908545, -3.8244366467881634 54.823644897510206, -3.843098281966782 54.81500585123782, -3.8594609553024775 54.81587070284038, -3.865019813077869 54.81319143913112, -3.8693896451281735 54.805336948535, -3.8853204594839252 54.80204436020518, -3.8925382850598567 54.79878703677863, -3.9042061502711087 54.79706387600695, -3.9080488101785944 54.794095833508294, -3.9261302819211084 54.789476862930265, -3.9346473104682276 54.78810363690612, -3.9547133354766655 54.77989743161202, -3.962664031875444 54.772317760572534, -3.975822492266252 54.769302425315594, -3.9921429485467166 54.76923852848456, -4.0059907077688575 54.77456052653661, -4.011765698214778 54.77021336986528, -4.028779177032384 54.77317740664214, -4.039619696345491 54.769233947952216, -4.054929396456537 54.774958111763446, -4.0639427431864155 54.7800821456071, -4.065247026713374 54.78684620526755, -4.0628126309934025 54.79465812123879, -4.057527197978004 54.79721071667251, -4.056187089258526 54.80173213164238, -4.048346397748348 54.80820967467775, -4.045485140501867 54.81351524271766, -4.048184680341418 54.82078801631174, -4.0551739314326 54.82553702762597, -4.060232227155242 54.81955038278445, -4.073275683091351 54.814433114024595, -4.068890588700685 54.822180463189916, -4.061386846397365 54.82574443297507, -4.059940614434884 54.83011666468292, -4.061782646013779 54.837692228361604, -4.05253748917525 54.83748581582064, -4.048235396333742 54.83946582413777, -4.041374121694977 54.84801605615367, -4.047504772056726 54.85009964697539, -4.048755416903397 54.85372060671968, -4.044448254954851 54.85840871875069, -4.050288787727059 54.86171048683608, -4.05148999905775 54.85468111128922, -4.0501741397756765 54.84944248392135, -4.045399182600299 54.846354665189196, -4.051417190718714 54.839100187445155, -4.05966113376134 54.84116719434378, -4.069236183308675 54.83304421841377, -4.068515627121744 54.83095142597209, -4.077461257278894 54.8256572440234, -4.0838258973441 54.81744415055301, -4.09133355519015 54.8143541790554, -4.088183379039477 54.80805001998472, -4.089353615111429 54.79532828823069, -4.092662704983234 54.78603019192869, -4.089897664558952 54.78187575875885, -4.104546462398353 54.7800961781812, -4.1038836710962645 54.77676575054345, -4.090334781269205 54.77509630083836, -4.094297492310908 54.76635761647328, -4.107696060421845 54.767999552432045, -4.111598837310442 54.77750173805797, -4.119341217470417 54.77649298417649, -4.124866024742063 54.77928162420687, -4.119638080590192 54.78475365520498, -4.1248394305619405 54.788143896117035, -4.131613484991413 54.7790463534632, -4.138827576820721 54.775898266871216, -4.152404889797284 54.77767686581681, -4.161273382803773 54.782579718791304, -4.163935934312879 54.78834517721608, -4.169895661015086 54.78676545626712, -4.179307935571622 54.79206986883454, -4.180155870672326 54.79565547892963, -4.18583812091689 54.80226952320104, -4.181529591880329 54.80752274068955, -4.197175124629624 54.810415159722446, -4.210413269795672 54.81569371392587, -4.207769456192761 54.821125167116925, -4.215661736161388 54.822287348657696, -4.219343191806968 54.82690765946057, -4.214416993425343 54.835009260355164, -4.225067559764677 54.84124583065388, -4.219254069427377 54.84344034743547, -4.222378703186862 54.849901743614325, -4.215160398998863 54.853577922395026, -4.212135932138082 54.85849143530192, -4.207570424615215 54.86062665355868, -4.210328442082684 54.86560918861551, -4.22654414505647 54.86485352964939, -4.23078977622887 54.8549608652601, -4.239441285420517 54.85276651101832, -4.245172252633304 54.847343816458604, -4.255098787421033 54.84453776210975, -4.257429950706991 54.83727646470432, -4.265092506653897 54.83553367688562, -4.27866709524585 54.84022785286007, -4.2939004800381015 54.843738625475744, -4.303285734028662 54.84328670027159, -4.310875171405384 54.84733391574494, -4.320000817521518 54.84877870116916, -4.351625385275452 54.858995389591996, -4.362609418120662 54.86422038706806, -4.374146635457791 54.8774517380398, -4.382211881915392 54.88063674086124, -4.382473989125775 54.88869468796735, -4.389463894306291 54.89747617628064, -4.3992528078463895 54.9026181173403, -4.399350265204106 54.9070612350832, -4.39528366778476 54.91190205562664, -4.399148712823441 54.91785735644862, -4.411601040042951 54.91938788068649, -4.4196210026307154 54.92165271709631, -4.421917547630709 54.92740484847368, -4.416202790422097 54.93255157492705, -4.424658726369337 54.93246669998547, -4.425769730785297 54.92647043553125, -4.422000842449268 54.92045559559737, -4.412454109972498 54.91473802079183, -4.4006391678195955 54.91586921511263, -4.399379569895019 54.910201398901464, -4.4056363868131445 54.905161558875754, -4.406294845200998 54.90037985847008, -4.396274918726606 54.89377064578553, -4.401604986158479 54.89025132702414, -4.416194188148339 54.88752856019175, -4.4263149993067294 54.881031701124805, -4.421258792685716 54.8719341509043, -4.427594659123014 54.86430623022841, -4.422277092299732 54.86393963939769, -4.418658336005871 54.84946928880966, -4.4184150365650146 54.841421719198884, -4.413639493559511 54.83557771725813, -4.41371352258141 54.829357594998555, -4.4068215184733965 54.82443365899911, -4.397767879044334 54.82395583113498, -4.393865692081642 54.821656185032694, -4.376440718296938 54.819987923297035, -4.368505312896883 54.81526747345946, -4.363868586007994 54.81574983529666, -4.354503315433441 54.813350332653656, -4.34731498536726 54.80832188441994, -4.341240144040299 54.79910784680791, -4.34434593279855 54.791480930873476, -4.351572801403768 54.790481663919465, -4.362176244653411 54.79577327453944, -4.369416374111106 54.79292094785183, -4.3681235475764835 54.7876795225579, -4.3615067213434 54.78552084903856, -4.360192290935838 54.777644181961634, -4.370441864826813 54.774827522661774, -4.371102599100702 54.77203518427416, -4.354773540254717 54.76711371642702, -4.359601415921355 54.75462573824742, -4.3575860283171215 54.75198621276138, -4.366883818161915 54.741781281436, -4.362432942273234 54.737147052399706, -4.366708697467131 54.72801878865252, -4.363431257775035 54.71801135645104, -4.352767555533468 54.71799956335118, -4.348945678672716 54.712086084892974, -4.351304188982808 54.705813583515315, -4.361950765315197 54.6996053284206, -4.367076840493317 54.69850477597475, -4.365375075290369 54.69134669879672, -4.378393744869963 54.68321902652446, -4.392133292289991 54.677491961267535, -4.408183827528779 54.67814108648476, -4.425810734347708 54.68481710590933, -4.4437567508936 54.69257277922243, -4.455965306118042 54.69606720437459, -4.463741008915468 54.69591738061263, -4.481168456146253 54.69902075802339, -4.495921174654303 54.70384433453392, -4.520597905344658 54.714471320963966, -4.530332520764144 54.72247939003885, -4.5412657987269585 54.72312344254057, -4.540153318415004 54.727756588464636, -4.545047543561756 54.73318063609302, -4.556975363794649 54.736663777124136, -4.571601177285868 54.738091059733485, -4.577229452789999 54.74598119656198, -4.577505767249603 54.75118477194389, -4.5851092484487985 54.757556455254736, -4.58541507094531 54.765300736454606, -4.600826383526982 54.77694699359995, -4.611245846900857 54.78075845769468, -4.625548978233048 54.78261516425566, -4.649028100773084 54.79323098272789, -4.667807610964379 54.79839379650651, -4.679328728336964 54.80385456935236, -4.694250525362691 54.81468837837089, -4.700205037328925 54.81723581521385, -4.709053808470506 54.824073017736964, -4.722362792746464 54.826704839842805, -4.742351012868153 54.82763905060562, -4.753833208695563 54.82962370706551, -4.762790909375948 54.82707815009626, -4.781561711594734 54.8324333209799, -4.786396427820602 54.83601275391439, -4.791968678761847 54.84637685226094, -4.799706532457148 54.848351652506324, -4.808463061359824 54.86061932962154, -4.818563628373021 54.86298866224168, -4.834060782596305 54.86366069554239, -4.847318059999537 54.86905188759012, -4.8560973165522245 54.870330764182874, -4.850770041412811 54.86098403576989, -4.858334136420564 54.855996378232994, -4.874188445032109 54.85236293193525, -4.893892314575648 54.84639255271821, -4.920052722133188 54.835539241360756, -4.932580447671818 54.83419234795387, -4.939311949708473 54.830722759021484, -4.94189760504356 54.824137542181994, -4.9534884097439305 54.815477656451755, -4.959989802123578 54.807759065982374, -4.9607251377706385 54.8026848724542, -4.949687234677822 54.796270389619956, -4.946270695392036 54.78496885487296, -4.94277060802478 54.7792325535442, -4.938549604642312 54.77672862195253, -4.940440791109152 54.7654797544444, -4.9323426885375135 54.76210045641486, -4.928628355995085 54.75695693692623, -4.927512396206345 54.74951194599556, -4.917522015719463 54.74320786859529, -4.920196637694321 54.73652018407452, -4.9143643125628 54.73464406675381, -4.915388124251127 54.728070804082556, -4.9052151500620775 54.71153997520044, -4.90704825183422 54.70563063214473, -4.9058336614044284 54.70117535019479, -4.899515506321687 54.6991529021951, -4.895400590649443 54.69201227060462, -4.886287176691534 54.692121953331075, -4.8821624073708945 54.68582713248735, -4.876185321160879 54.68552513469856, -4.866938982842576 54.681991843577116, -4.879659012887404 54.672066659818505, -4.883750683402914 54.653529902739315, -4.8794259130763535 54.648551478526755, -4.877534126851756 54.63933633049727, -4.865278908638756 54.63769328632642, -4.852800095715952 54.63746664705741, -4.855977192119889 54.63423790384541, -4.877512717384755 54.63376996076152, -4.8877084038647185 54.63916229778458, -4.902351646884143 54.64005896016368, -4.909867170837389 54.64364999597179, -4.917072117647065 54.64245611181167, -4.923574826012556 54.64472035541261, -4.950757985336094 54.65814618235203, -4.964175043026518 54.666871013720375, -4.968866803720653 54.67778754816266, -4.9743718996154005 54.684196679219085, -4.972615651914551 54.68969536085099, -4.962140740126479 54.6953059729481, -4.950278543865279 54.6988258742534, -4.948298645320955 54.70189581934658, -4.9547145920934925 54.70355734159654, -4.966100253384273 54.71749765818168, -4.964773418747656 54.72112545119306, -4.956388204370078 54.72390169493374, -4.959858363112987 54.7304205159649, -4.968671784646657 54.7307218178734, -4.980722224613204 54.73357172973258, -4.988589612196928 54.73253454818667, -4.992549024246318 54.73494612759063, -4.9912739588722115 54.74184373949487, -4.987249781284157 54.745121226947646, -4.986765902704239 54.74992425005136, -4.99270384133311 54.75290108025505, -5.004368419820846 54.755108237922215, -5.0065682094718005 54.762047515115064, -4.998813757483174 54.76472464422258, -5.001165246433358 54.7728559943166, -5.006985166553996 54.77552311789058, -5.0123025730864095 54.78150292429167, -5.019459929799187 54.782009937395955, -5.02361022098355 54.786136594456266, -5.031458733913254 54.79033432707884, -5.03982899155883 54.79101481094897, -5.04296659665534 54.79351103548335, -5.039614811059984 54.79926825069231, -5.0436322961812445 54.80265316022457, -5.052020194939887 54.80567627484337, -5.053646789620497 54.809863659815036, -5.065627794333945 54.81158516642334, -5.077921606216165 54.817096169240436, -5.082864558295145 54.820912174944645, -5.084161347041627 54.82533863769158, -5.093663813138529 54.82910651933424, -5.103281215668281 54.82919527942162, -5.118648764450446 54.84012511148862, -5.136361283269703 54.849939658843226, -5.148530111463894 54.86132255362668, -5.144536426086732 54.86641968660956, -5.147242897814186 54.87376073960096, -5.153575065183612 54.87909430602399, -5.159272677896042 54.88970468363251, -5.163577456998044 54.894435083161966, -5.173741690726605 54.902278702298524, -5.175008916127637 54.90660079261324, -5.181347898477727 54.90905930708918, -5.185073967184958 54.915154605238826, -5.1846601159283425 54.92668201686362, -5.186867656616254 54.93536243619346, -5.185140010700377 54.93673662702714, -5.186858697810801 54.951936625584935, -5.178814217695648 54.96406579723989, -5.178922243871317 54.973102442261094, -5.186461179235876 54.974549400465364, -5.176817682404537 54.986027965791465, -5.167043726325598 55.00161250164308, -5.16077479645899 55.00403688097929, -5.1570662717912255 55.00861518347681, -5.146967971544251 55.00857135004751, -5.137889818522974 55.00700788148793, -5.13365435857946 55.01016320842637, -5.125182268246348 55.011439518467235, -5.112459692160001 55.01744803484146, -5.0983141739189906 55.018087166861754, -5.090775216624279 55.01296381088705, -5.08711680598611 55.000422262546, -5.076105457108869 54.995777285934636, -5.0750700947548095 54.9915059834446, -5.070278025960778 54.98854606500366, -5.072162803673827 54.98168356692352, -5.062195115605174 54.96828026860349, -5.068774733873734 54.967261953857204, -5.0751237955468 54.96351866228303, -5.074974049402998 54.95927078637567, -5.069606697151413 54.95334684918592, -5.071861145307212 54.95009639020181, -5.069696078682622 54.94497611975138, -5.068394263310206 54.93351269607717, -5.061609149220175 54.92446585240444, -5.047093039710682 54.917697836671344, -5.035283595262143 54.90846991398752, -5.01807632749681 54.905440225096534, -5.002026438331654 54.91016436637381, -4.994069309189383 54.914465886201015, -4.9905089763420785 54.9187063068627, -4.992768889425036 54.92891590406255, -4.996004621622611 54.93629458387129, -5.002043979224653 54.943052812774056, -5.006836462137332 54.944906775427505, -5.0058783006219105 54.95347050965531, -5.018779904172195 54.97001939855347, -5.024608953228361 54.97334116258533, -5.031187156107945 54.97412663694159, -5.030081560330353 54.979801131583784, -5.035871824372008 54.98363310859044, -5.035634768639437 54.98856671514862, -5.039774945767209 54.997783680691356))
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>