[ckan-dev] Escaping strings in N3 output

Toby Dacre toby.okfn at gmail.com
Tue Sep 18 15:52:40 UTC 2012


On 18 September 2012 16:09, Joshua Tauberer <tauberer+consulting at govtrack.us
> wrote:

>  Hi again,
>
> I was able to edit the package .rdf RDF/XML output template to add new
> predicates. For instance, we store URIs in an extras field to reliably
> identify the author of a dataset.
>
>   example:
> http://hub.healthdata.gov/dataset/2008-basic-stand-alone-carrier.rdf
>      our template adds dct:creator / dc:publisher nodes
>
> Now I'm trying to bring the N3 template up to date with the RDF/XML
> template changes. However I'm finding that strings aren't escaped in the
> output, so embedded quotes in extras field values (for example) bust the
> file if I have something like this in the template:
>
>    dc:subject "${extra_dict.get('value','')}";
>
> because it may generate
>
>    dc:subject "quote chars "here" break N3 syntax";
>

Thanks for this I can try to get a fix in for 1.8 what is your
understanding of the rules? should a " just be replaced by \" if so I can
create a simple helper function to resolve this issue.  In the short term
it looks like you may be able to use dc:subject """ now " is ok """  I am
no expert in N3

Toby

>
> Is this a bug? A limitation? I know that Genshi doesn't know what N3 is,
> so I'm not entirely expecting CKAN to be able to handle this easily. It's
> fine if it's not really supported --- this is just icing on the cake for
> us. The RDF/XML works fine for us.
>
> --
> - Joshua Tauberer
> - http://razor.occams.info
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120918/3bc586e1/attachment-0001.html>


More information about the ckan-dev mailing list