Re: Escaping control characters in SPARQL/XML or, why doesn't SPARQL/XML use XML 1.1?

Hi Gary,

I'm just randomly kibitzing here, but it sounds to me like you should
forget about XML entirely and just use JSON.  Basically ditch all of
RDF/XML in the process.  That would be a HUGE step forward for the RDF
community.

- Bob

P.S., And then graduate to protocol buffers, which would be another step
forward.

On Mon, Jul 20, 2015 at 12:29 PM, Gary King <garywarrenking@gmail.com>
wrote:

> Suppose I have a triple-store containing like
>
>    <http://a> <http://b> "Hi \u001A is control-Z” .
>
> What should the SPARQL/XML output be for this query:
>
>     SELECT ?o { ?s ?p ?o }
>
> If I use Apache Jena 2.13.0 and ask for JSON, I get:
>
> {
>   "head": {
>     "vars": [ "o" ]
>   } ,
>   "results": {
>     "bindings": [
>       {
>         "o": { "type": "literal" , "value": "Hi \u001A is control-Z" }
>       }
>     ]
>   }
> }
>
> Asking for XML, however, gives me:
>
> <?xml version="1.0"?>
> <sparql xmlns="http://www.w3.org/2005/sparql-results#">
>   <head>
>     <variable name="o"/>
>   </head>
>   <results>
>     <result>
>       <binding name="o">
>         <literal>Hi   is control-Z</literal>
>       </binding>
>     </result>
>   </results>
> </sparql>
>
> Where the control-Z character has disappeared.
>
> AFAIK, XML 1.0 cannot encode these control characters, whereas an XML 1.1
> output could use &#x1a;. I also see that the RDF validator (
> http://www.w3.org/RDF/Validator/) is perfectly happy with the results
> whereas it seems as if it should not be?
>
> thoughts?
>
> thanks,
> --
> Gary Warren King, metabang.com
> Cell: (413) 559 8738
> Fax: (206) 338-4052
> gwkkwg on Skype * garethsan on AIM * gwking on twitter
>
>
>


-- 
=====================================
Robert MacGregor
bob.macgregor@gmail.com
Mobile: 310.469.2810
=====================================

Received on Monday, 20 July 2015 23:32:23 UTC