Re: literals with \0

gedit complains about (but displays) the attachment.

On 01/05/13 05:52, Eric Prud'hommeaux wrote:
> I've notices vectors for creating literals with C0 codes
> (include \0):
>    old turtle
>    APIs
>    SPARQL CONSTRUCT
>    SPARQL Update
>    RDBs via Direct Mapping
>    RDBs via R2RML
> (RDB example reproducable with
>    create table test(s text);
>    insert into test (s) values ('a\0b');
>    select s, length(s) from test;
>    +------+-----------+
>    | s    | length(s) |
>    +------+-----------+
>    |      |         1 |
>    | a b  |         3 |
>    +------+-----------+

? where did the first row come from?

> ).
>
> These can't be serialized in RDF/XML. Nor can the results of a query
> including this data be serialized in application/sparql-results, e.g.

application/sparql-results+xml

There is also

application/sparql-results+json
text/tab-separated-values

JSON allows \u0000 - RFC 4627 refers to Unicode 4.0


>    SELECT ?icon { ?who <p> ?icon FILTER (regex(?icon, "PNG")) }
> They can, however, be queried in SPARQL:
>    SELECT ?who { ?who <p> ?icon FILTER (regex(?icon, "PNG")) }
> (Technically, useful functions like fn:regex are based on strings, but
> I don't know of implementations which enforce this.)
>
> In theory, existing turtle files like the attached are rendered
> illegal by the post-facto declaration that they are xs:strings.
> In practice, people don't enforce this (noting that these tests
> existed for a while in Turtle with no one failing or crying fowl.)
>

Received on Wednesday, 1 May 2013 09:20:06 UTC