| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- only generate prefixes for predicates (thus much less gratuitous);
- use prefix if bound uri is used as subject or object (common in ontologies);
- prefixes are used for datatypes (if bound in the graph);
- integer and float literals are outputted as is (as supported by turtle and n3);
- prepared to use plain boolean literals in place (not active since the n3 parser doesn't yet support those..);
- for "rdf:nil" (the empty list), "()" is used;
- for n3 only, "=" is used for "owl:sameAs", and "=>" for log:implies;
- 4 space indents (not 5) and no spurious trailing spaces;
- space before periods;
- no newline before @prefix declarations, one after;
- added serializer flag "spacious" (defaults to False); if True:
- use two newlines after prefix declarations
- one extra newline at end of document
- top-level bnodes as "[]" instead of surrounding statements;
- nested bnodes start with "[ ", ends with " ]";
- some space/indent tweaks for n3 graph literals .
Changes to other parts:
- Added some more n3 test files and altered some n3 test code.
- The "n3()" method of "term.Literal" now uses the new "_literal_n3" method, which takes some optional parameters and is used directly by the turtle+n3 serializers.
- Added a bunch of doctests in Literal's "n3" and "_literal_n3".
- Registered "turtle" as a serialization format (due to the tokens ("=", "=>") supported by N3 but not by Turtle).
|