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://opendatacommunities.org/id/geography/administration/md/E08000003 http://www.w3.org/1999/02/22-rdf-syntax-ns#type geosparql: Geometry
http://opendatacommunities.org/id/geography/administration/md/E08000003 geosparql: asWKT MULTIPOLYGON (((-2.23723203819687 53.53884434473046, -2.2341331062543097 53.53917852960799, -2.2335152797174365 53.540148677724254, -2.2288644510222704 53.540675439862156, -2.227761690787735 53.54156471432545, -2.2207853474864376 53.54265997126287, -2.2197080406308007 53.54326957607868, -2.2194618171685554 53.543823733169674, -2.218727315742569 53.543890676465075, -2.217812012852461 53.54344737304327, -2.217696512862142 53.54239867259652, -2.214955512657551 53.54229400998375, -2.2138207424013037 53.541985048499036, -2.2130670578833325 53.542141848941995, -2.210923367680935 53.54075159834901, -2.2085383419925724 53.53842684917759, -2.207547119220178 53.53846460824769, -2.2071263417411675 53.53817860265177, -2.205651922316032 53.53688225339181, -2.2069305299871274 53.53578440702892, -2.206908445303296 53.534343572801234, -2.2058144134940822 53.533069120644235, -2.2048013791716268 53.532608901981256, -2.2005850364784005 53.53174416592239, -2.193815223962919 53.531614266729974, -2.1860163820322778 53.52904334186232, -2.1721178025072816 53.52709934972548, -2.1721386393168185 53.52778960896761, -2.1702211300571643 53.52772945750477, -2.1705030263218097 53.523940460246294, -2.1691485738592107 53.523569385274904, -2.164792725152159 53.520149996391716, -2.1591894660439546 53.52211075597014, -2.1562813958766065 53.518829385538396, -2.154762722797313 53.518016980407225, -2.1562386194965453 53.515792236131986, -2.156453069330408 53.51628725332844, -2.1584004704315265 53.51520602671471, -2.158749369270435 53.51454223058686, -2.1604059509439937 53.51395755449156, -2.1602403391504184 53.51362970501394, -2.1608259274010493 53.5133592530137, -2.160474799635469 53.51299570994229, -2.1630846964130694 53.51290231386529, -2.16439317760354 53.51357553406577, -2.1671534321198855 53.51335864707236, -2.1686260652996157 53.51354986059287, -2.1713946756229876 53.513160336074314, -2.1715144234203296 53.51257950011121, -2.1725903729062415 53.512390954745726, -2.173028968429018 53.51198317142922, -2.1734329543907096 53.512296280321955, -2.173298076167023 53.51178410508501, -2.1740833987626647 53.510585780301994, -2.173551846455855 53.510389675020335, -2.1738849967799623 53.51001528976131, -2.1743031994382913 53.51012969815629, -2.1736123624315824 53.5097136726566, -2.1740470595043773 53.509455955156994, -2.1744610635516977 53.50966930358209, -2.174274371149119 53.508983687389836, -2.1756486619696407 53.50806224293428, -2.1755970150322965 53.507598470432626, -2.176747907289243 53.50699184497065, -2.178268281392771 53.50675316660562, -2.1787121921675903 53.50583388121105, -2.177899385179275 53.505436034164504, -2.1767807929735072 53.505486219877646, -2.1765550065238677 53.50520880138812, -2.1777496102875795 53.50496620836669, -2.1755146913221393 53.50263427468237, -2.170871725266022 53.503129122693856, -2.172604146915708 53.50242375778918, -2.172274643149307 53.50221477410612, -2.168538455947852 53.50098329598451, -2.1659329857831047 53.49896728900664, -2.1643779344416005 53.49950508670966, -2.1618663636472824 53.498309448344926, -2.1616457783881473 53.49740379376709, -2.1629164289237566 53.496965174836355, -2.1628326223665217 53.49672887127152, -2.163413045031126 53.49676312290054, -2.163238410692583 53.49601645821474, -2.1640201250702433 53.49469051173728, -2.1635895453750575 53.493671837811135, -2.1639348964502965 53.49292796443794, -2.16303167544285 53.49283305253924, -2.1639711728550455 53.491380998945054, -2.1659703756391653 53.49155714374988, -2.166555024139022 53.49113390451417, -2.166228082544027 53.4888521319478, -2.169028460927542 53.488506646088254, -2.1693013243474994 53.488160213569536, -2.1687944250855313 53.48765035432429, -2.1696649297721 53.48676563033888, -2.1695386153952936 53.48606374367501, -2.1690278585657765 53.48610858883242, -2.1684832560386695 53.482916590387276, -2.167423059866454 53.48080316815906, -2.167689989086393 53.48009533522124, -2.1680650897158396 53.48007144384677, -2.1659701151596815 53.47954052522536, -2.1654397431223726 53.47724195624415, -2.1650119885690926 53.47688122630401, -2.1622328194673983 53.47627831056126, -2.1615659445995146 53.47483392613899, -2.1585619386153385 53.475280151159716, -2.1559253844962414 53.475302496307386, -2.155433984858379 53.47442764329785, -2.150391556964523 53.47276138448294, -2.1501187988311043 53.471044974089274, -2.1468288633213133 53.46764242877328, -2.147926432120229 53.46661003212406, -2.1478512244445667 53.46576976407953, -2.149145982235187 53.465138960496795, -2.149973847487328 53.463694337688196, -2.1527843217381846 53.46323060373383, -2.1523220117960102 53.46244555765611, -2.151975922740104 53.4625196838762, -2.150174396156846 53.46077375792751, -2.1490184126210603 53.460565746586305, -2.149341214358652 53.46026422539124, -2.1507762425838823 53.46019772196666, -2.1492417914911646 53.459393345916304, -2.1502803051580046 53.457925183703026, -2.1521198744338834 53.457704403981076, -2.1584528135777714 53.45492050229163, -2.160365818053004 53.45426628793444, -2.159878928667871 53.453328541806634, -2.1616957330286217 53.45312840286063, -2.161284087682718 53.45180398693509, -2.1660034342731826 53.453769651763054, -2.167413823488594 53.44940106434272, -2.1728813615546723 53.44798472209363, -2.171965916153544 53.447245425498735, -2.173951552129991 53.443845776308784, -2.1749097340867753 53.43557947008362, -2.1752944811953214 53.434348370235185, -2.1758467380395485 53.43431700538441, -2.1764723129671983 53.43308284961468, -2.1771509592597034 53.43303961017726, -2.177803805424194 53.433682212259775, -2.179046813427255 53.433977877378375, -2.17901338391288 53.43426197370679, -2.180088514366295 53.434354707840754, -2.1798156214009405 53.434592437962074, -2.1802061843897413 53.43476976997306, -2.1810907672471744 53.434673179918356, -2.181729448986244 53.435118001306144, -2.1839107695577082 53.43518295116925, -2.184194050759943 53.43560054034145, -2.185214805930846 53.43565107795443, -2.1856471952753758 53.43607732799016, -2.1865965964518885 53.43598508876603, -2.1873866043773864 53.43627957799642, -2.187433419495707 53.436651612815446, -2.188541285842159 53.43663638782897, -2.1871380286039246 53.43521126952963, -2.1889548360191067 53.43485148414289, -2.1913329161715467 53.43517666896888, -2.1930776756341377 53.42923162899127, -2.193142656191468 53.427636875231784, -2.1968995556547637 53.428092791285025, -2.199360474378135 53.42685906574596, -2.201861301626253 53.423605536287575, -2.204501320571697 53.422160140038855, -2.2049310202851635 53.422350893570446, -2.2055308479425055 53.42159656709397, -2.2074963832651253 53.42043999554645, -2.2076946624834517 53.42006385657013, -2.206220175610422 53.42008807080725, -2.206494584777464 53.418959497853045, -2.207162016883443 53.41883073922073, -2.208427456497132 53.41914313395058, -2.2096718646814724 53.41792748773815, -2.213429181578826 53.41889876752378, -2.214601347938954 53.41322489444572, -2.215414883493387 53.411374472087374, -2.2145346116460636 53.411033602562945, -2.2154770963467922 53.410873661062716, -2.214974611758806 53.40969075374358, -2.2125961414855313 53.406951773124675, -2.219333339067877 53.40513734372936, -2.2193447437987053 53.40386005338063, -2.219988042275801 53.40259328052454, -2.222567661163499 53.401179939542025, -2.22489227461856 53.40136257748134, -2.2277171117938153 53.40084034335623, -2.236131570204894 53.401042431934876, -2.238142632881185 53.40080560636701, -2.2406049002844983 53.39977329485362, -2.2425371939196475 53.39945927468386, -2.2425441495782454 53.39776225306719, -2.246827732769442 53.3960437867996, -2.2444057214944575 53.39406502145334, -2.2459846779844828 53.39380468581613, -2.246024787095958 53.39136687536348, -2.244466726943316 53.39132065606079, -2.2439140026200075 53.390384275474176, -2.245734028614825 53.39022238620865, -2.246222338170085 53.387813303349525, -2.2426249687342272 53.38767420362069, -2.2424345468686857 53.385645815211305, -2.2429854098429063 53.38494540159547, -2.242441650673465 53.38397395025683, -2.2430705632832737 53.38300909705503, -2.2426077527677397 53.38253629581942, -2.2428783386132864 53.3822525949745, -2.241952314069625 53.38199469121101, -2.2420979025342374 53.381701360862095, -2.240928030418157 53.38057840921207, -2.2413431928392784 53.3800858532786, -2.2412787972619967 53.3788033168786, -2.242108221347022 53.37795227493617, -2.241405743106937 53.37653165796599, -2.2414622877044965 53.374851602486665, -2.2402671945940815 53.37401085606268, -2.2398963167144395 53.37302646170088, -2.240476055427379 53.37267744428051, -2.239010468500296 53.37211498851624, -2.238681065249068 53.370716970068685, -2.236934544977982 53.37018030154418, -2.24079123785503 53.359557881446236, -2.244144653804249 53.359762324822725, -2.2441940173830286 53.361027821604836, -2.245205760258971 53.36112279472462, -2.2495931355658962 53.36057524598408, -2.2540995718014107 53.36083809634822, -2.2564484556673006 53.36066053442785, -2.2589384456915225 53.359444370429834, -2.258041884424391 53.35702744228086, -2.261104354881168 53.356124594583285, -2.2646126389722614 53.35396226808034, -2.2639211827022434 53.35365998135598, -2.264194830172561 53.352962773449214, -2.266849064634856 53.351694857183524, -2.2670777837845493 53.35055724556826, -2.2729045830340606 53.350503614304706, -2.2783648172095234 53.348599779998594, -2.2804296059173645 53.34597926911141, -2.2846373888590046 53.34649156990157, -2.2867066371213545 53.34551135137516, -2.2858681381275696 53.34500277391239, -2.286821373872986 53.3438049740436, -2.289860278517207 53.342304584429634, -2.2912798850773517 53.34300410771549, -2.2940393229745717 53.34304945374992, -2.2944821183069553 53.34279036975023, -2.2958175005279062 53.343027982333325, -2.296728278829635 53.342039673807065, -2.2978611645909925 53.34188489369253, -2.3013602038684726 53.34010439984661, -2.3028367538602184 53.340977074241195, -2.2974599800994895 53.34379328645715, -2.2981462736097904 53.344427069124734, -2.2964554846203207 53.34493199090794, -2.2967125417035463 53.34603062142349, -2.298318554658022 53.34671602751225, -2.2969314356080766 53.34856757128061, -2.29775341268072 53.34904016649884, -2.2988858255243176 53.349004085287255, -2.298652298165149 53.34977495884987, -2.299170851653989 53.35001637280387, -2.3014517381422364 53.34903716469822, -2.3014372998073864 53.35039536029089, -2.3035832888391616 53.35070721535451, -2.304525527499668 53.35223918819358, -2.305622540323236 53.35312986945766, -2.307905989581984 53.35351677768905, -2.30923411671506 53.35435470887191, -2.312222240469399 53.35475677828862, -2.312745787896411 53.35608391015161, -2.314302363878547 53.356715314569946, -2.3139995000128897 53.357408310259345, -2.3060402261971022 53.358365620805024, -2.3000866730512355 53.359990606578265, -2.2985958288976223 53.360808667473734, -2.2962376765910903 53.36310761572604, -2.292665172100633 53.37025245271732, -2.290564137124839 53.37268903850554, -2.2901177308953176 53.37268473380875, -2.2856655514200352 53.37622888747562, -2.287221990841752 53.37633037583647, -2.288586004811687 53.376877119842185, -2.2926834039152872 53.38078442446019, -2.2942110451916125 53.38169751267879, -2.296547916018543 53.3822355616805, -2.2998744224058085 53.38431434502272, -2.300215837483613 53.384970545090354, -2.299555393532829 53.38534350889121, -2.2998033952053833 53.385548666709326, -2.299152405202308 53.38640514242148, -2.2997625037107703 53.386996869205724, -2.299381445328876 53.38754615480921, -2.3004834886504684 53.389458847793904, -2.2998799186892502 53.38980192556319, -2.3002828944052984 53.39107728870188, -2.300004419175645 53.39209637581694, -2.301734608678929 53.39372971702583, -2.302722812895163 53.394171302683056, -2.3050126550512045 53.397071462394514, -2.3073400602670397 53.39739896122822, -2.3199185470943773 53.41160738682846, -2.3182343272921235 53.4111049900948, -2.315857238881324 53.410880275038345, -2.312711248104897 53.40980637635665, -2.3072442447309185 53.40977016678472, -2.3059013025745068 53.410040591417584, -2.304599564415504 53.409970236717164, -2.3035782579465507 53.40956748063823, -2.300870541166381 53.409781914797506, -2.2977149127922094 53.40834541944835, -2.297270101621136 53.410987335603856, -2.296524028212846 53.41186110437076, -2.2939421414045977 53.41356539694951, -2.2909043214794584 53.41418406885751, -2.2888842930581794 53.41536200880837, -2.2881309312232365 53.415415050762775, -2.287262359853633 53.41490305554884, -2.2845082088594175 53.41612123551885, -2.283085701065941 53.41600690274342, -2.2815445668958625 53.4152672279927, -2.2777788030398622 53.41549171761027, -2.278422468228307 53.41751808567523, -2.278192726126584 53.418297886562556, -2.2763916338456247 53.418981592717806, -2.2759969246919582 53.41937177920559, -2.276441021708784 53.41963323145269, -2.27544038410756 53.41939013804674, -2.2736200792894072 53.42248460556258, -2.2756491679689774 53.42327896936777, -2.280628068456024 53.42390375124578, -2.2836510496963034 53.42499145544338, -2.2853303959209534 53.42722648796846, -2.286092095911443 53.42949065802975, -2.2877429261047086 53.43126195710761, -2.2889065160333684 53.431949448949446, -2.2932762763271506 53.43265964503412, -2.296030718922587 53.432454254592756, -2.2996414754726606 53.43329819286637, -2.3000601103691416 53.433761895467136, -2.3001855663297306 53.43639967948164, -2.299698258828666 53.43730875618485, -2.2955682072960184 53.43585029957433, -2.2943036469184235 53.43604491534612, -2.2954380197776496 53.43878274133827, -2.2914923038565114 53.43919420499058, -2.2898700819504008 53.44127184543813, -2.291505621544885 53.44311312764706, -2.2932598917374594 53.4436095281743, -2.2931285251704643 53.444433233838645, -2.2928793345087133 53.44431693809669, -2.2918115163465207 53.445363182028004, -2.2896489875281696 53.44506014113658, -2.2862538171986397 53.44907175025781, -2.2797559309687645 53.44917980076471, -2.2793799260169045 53.450168506376855, -2.2714917190390094 53.45070079387629, -2.2583259914333627 53.458763973468706, -2.2536882955049573 53.45992897006977, -2.2539386380701987 53.46049014745788, -2.2532471145236985 53.46070467257065, -2.253503316110269 53.46122818738044, -2.2530234121188775 53.46132176096703, -2.2537653237112583 53.46274400397557, -2.255900664647083 53.46215787677405, -2.25792019112228 53.462367395271514, -2.2599490201228263 53.465577346591026, -2.262703370325704 53.467418460394896, -2.264572546166003 53.46787090700779, -2.2651154676169094 53.46845396644987, -2.2645659938829175 53.468753607468415, -2.265707860356169 53.46971642708808, -2.2681616567643115 53.46969027341436, -2.2650969475192544 53.47249434017805, -2.265321274286555 53.47271219977934, -2.2640569380395834 53.47362105091841, -2.262679481039508 53.47671613688807, -2.260114366900575 53.477821986232414, -2.2554686752302757 53.480763125300044, -2.2483332638943145 53.48350979903004, -2.245967672834445 53.484853951210155, -2.2451398526600026 53.486070904066125, -2.245386959204638 53.48683886848409, -2.24878630964268 53.48828979252829, -2.249110221389931 53.48930029771045, -2.250442156858133 53.49000757533288, -2.250903804857501 53.492384088223, -2.2516307355308642 53.49295963089777, -2.2534846467409437 53.49345541405503, -2.252506791888744 53.49530731657373, -2.254858399299711 53.497327465038055, -2.254022245603574 53.49766900229895, -2.2554252694060266 53.499103207987766, -2.254296071761485 53.499581150025705, -2.254956374473338 53.50035540150226, -2.2523752356286657 53.50284439515501, -2.252676976590263 53.50312510383547, -2.2515356342457267 53.5038843917315, -2.2470792675801516 53.5023746367635, -2.2465691621291195 53.50383535289769, -2.245339056005169 53.50489498156106, -2.2457686208044874 53.506453592923215, -2.2488588384183252 53.50711232568907, -2.248541391162109 53.507737682778476, -2.2503298376703222 53.50803326623031, -2.2492153150922602 53.50951511577957, -2.2480837016561366 53.50940505907834, -2.2465768329504603 53.510868828558145, -2.2464753724645266 53.511573707981476, -2.2452301331171323 53.512140761606375, -2.2469181061698227 53.51430799276388, -2.250236789706263 53.516288392818566, -2.25696835596733 53.51792973905613, -2.256657636253498 53.51968138675303, -2.256238502718232 53.519938472260215, -2.2564936509252753 53.52024263413724, -2.254224755839661 53.52065103876515, -2.2544162933836414 53.52165102271601, -2.2534216490019774 53.52179340557977, -2.2534993209996848 53.52242961752265, -2.252869100642789 53.52247857838251, -2.2534799033290405 53.52423715682544, -2.2514572893512748 53.52399971324808, -2.251787515888509 53.525744513235445, -2.248807210643467 53.52478990450888, -2.2466473289543165 53.52922025860809, -2.256758683348315 53.527151444709894, -2.2624820702361523 53.5249835763989, -2.2641167142033516 53.524674366106744, -2.2658508413018836 53.52698679449907, -2.2661434367827535 53.531080350977966, -2.2682996955931487 53.534955870843504, -2.2677672011877004 53.53522043945349, -2.2683820250788025 53.535325991047834, -2.268646696236914 53.53590695789008, -2.268272925036356 53.53740977565407, -2.259125899970896 53.54300538369495, -2.253026045344293 53.54397032296854, -2.2517394585585087 53.54459234177339, -2.248022958531783 53.54414354647917, -2.246189914690415 53.5434552526872, -2.239360354964135 53.54006432403846, -2.2384507381562404 53.53877542328195, -2.23723203819687 53.53884434473046)))
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://opendatacommunities.org/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://opendatacommunities.org/sparql HTTP/1.1
Host: opendatacommunities.org
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://opendatacommunities.org/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://opendatacommunities.org/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://opendatacommunities.org/sparql

Request the results as JSON, using a GET:

curl -X GET -H "Accept: application/sparql-results+json" http://opendatacommunities.org/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://opendatacommunities.org/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>