From: Sergio F. <ser...@fu...> - 2012-02-02 09:13:00
|
Anyway as a user perspective we agree we added that could be a bit confusing. So we added a warning message when the wrapper comes up with such situation. You could get it at the upcoming release. Thanks for your useful comments! Cheers, 2012/2/1 Sergio Fernández <ser...@fu...>: > Dear Stuart, > > such SPARQL endpoint looks not to support results as JSON. Remember > that according the current specification [1], only XML results are > mandatory. What you could expect on HTTP is a 406 status code, but I > guess they are not managing the Accept header [2] > > In conclusion, sorry, but the reported issue is on the server side, > not in the client. > > Greetings, > > [1] http://www.w3.org/TR/rdf-sparql-protocol/#query-Out-Message > [2] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html > > > On 1 February 2012 20:25, Stuart Axon <st...@ya...> wrote: >> Hi, >> Cheers for sparql-wrapper - seem to be getting stuck at an early hurdle: >> >> >> When I run the program below I was expecting json, but get an XML Minidom >> object, this seems not quite right ? >> >> [python 2.7 on ubuntu oneiric ocelot] >> >> #!/bin/env python >> from SPARQLWrapper import SPARQLWrapper, JSON >> >> query = """ >> PREFIX geo: <http://www.geonames.org/ontology#> >> PREFIX wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#> >> SELECT DISTINCT ?an ?lat ?long ?name ?population >> WHERE >> { ?a >> a mo:MusicArtist; >> foaf:based_near ?place; >> foaf:name ?an; >> foaf:made ?alb. >> # ?alb tags:taggedWithTag <http://dbtune.org/jamendo/tag/idm>. >> ?place >> geo:name ?name; >> geo:population ?population; >> wgs:lat ?lat; >> wgs:long ?long >> } >> ORDER BY ?population >> """ >> >> sparql = SPARQLWrapper("http://dbtune.org/jamendo/sparql/") >> sparql.setQuery(query) >> sparql.setReturnFormat(JSON) >> results = sparql.query().convert() >> >> print results >> >> >> ------------------------------------------------------------------------------ >> Keep Your Developer Skills Current with LearnDevNow! >> The most comprehensive online learning library for Microsoft developers >> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >> Metro Style Apps, more. Free future releases when you subscribe now! >> http://p.sf.net/sfu/learndevnow-d2d >> _______________________________________________ >> sparql-wrapper-devel mailing list >> spa...@li... >> https://lists.sourceforge.net/lists/listinfo/sparql-wrapper-devel >> > > > > -- > Sergio Fernández > CTIC - Technological Center > Parque Científico y Tecnológico de Gijón > C/ Ada Byron, 39 Edificio Centros Tecnológicos > 33203 Gijón - Asturias - Spain > Tel.: +34 984 29 12 12 > Fax: +34 984 39 06 12 > E-mail: ser...@fu... > http://www.fundacionctic.org > Privacy Policy: http://www.fundacionctic.org/privacidad -- Sergio Fernández CTIC - Technological Center Parque Científico y Tecnológico de Gijón C/ Ada Byron, 39 Edificio Centros Tecnológicos 33203 Gijón - Asturias - Spain Tel.: +34 984 29 12 12 Fax: +34 984 39 06 12 E-mail: ser...@fu... http://www.fundacionctic.org Privacy Policy: http://www.fundacionctic.org/privacidad |