The string format used in N-triples is very similar to that used in JSON (see http://www.w3.org/TR/rdf-testcases/#ntrip_strings). It would be handy if json.dumps could (optionally) follow the N-triples format. The differences are 1) In \u escapes, the hexadecimal digits must be capitalized. 2) N-triples uses \u escapes instead of \b and \f
Agreed. The purpose of the json module is clearly defined, and there is room for other modules to address other problems (like yaml). It should be easy to write a Python function to convert a string to its N-triples serialization.
I agree that the json module should stick with the json definition. Adding other stuff would take it even further from simplejson. A conversion function, if short enough, could be posted on the cookbook.
History
Date
User
Action
Args
2022-04-11 14:57:16
admin
set
github: 56210
2011-05-07 06:45:37
terry.reedy
set
status: open -> closednosy: + terry.reedymessages: + resolution: rejected