From: Sergio F. <ser...@fu...> - 2009-03-13 11:16:03
|
On Fri, 2009-03-13 at 11:45 +0100, Niklas Lindström wrote: > I certainly agree. `oort.sparqltree.autotree` contains a > `treeify_results` function which in *theory* should be used for any > results (not the least RDFLib-results, which is next on my schedule; > to handle direct "rdf-source->sparql->tree" processing). But I had the > intent of actually asking you if SparqlWrapper can be used to > "massage" xml-results as well into a python object, isomorphic to the > parsed JSON object? Currently, sparqltree can't use XML-only endpoints > directly (since it receives a pyxml-object in those cases). I'm not sure if I undestood your question... but the wrapper will request xml is you set it before make the query: sparql.setReturnFormat(XML) That will parse the results returned as XML and return and instance with a DOM document (xml.dom python module). Personally I prefer JSON while is easier to use it. Best, -- Sergio Fernández - ser...@fu... R&D Deparment CTIC Foundation - www.fundacionctic.org Phone: +34 984 29 12 12 Fax: +34 984 39 06 12 Edificio Centros Tecnológicos Parque Científico Tecnológico 33203 Cabueñes - Gijón - Asturias - Spain |