On 02/08/17 17:43, Élie Roux wrote:
I'm currently looking more closely at Jena's ttl output and I see things
like:
bdr:G844 a :Place ;
:placeEvent [ a :PlaceFounded ;
:onOrAbout "13uu/17uu"
] ;
:placeEvent [ a :PlaceFounded ;
:onOrAbout "1187" ;
:placeEventAffiliation bdr:TraditionTest
] ;
but I don't really understand why it is not serialized as
bdr:G844 a :Place ;
:placeEvent [ a :PlaceFounded ;
:onOrAbout "13uu/17uu"
] ,
[ a :PlaceFounded ;
It would be
] , [ a :PlaceFounded
if you just print objects regardless. You need to mess around with new
lines.
:onOrAbout "1187" ;
:placeEventAffiliation bdr:TraditionTest
] ;
which would seem more clear to me... is it on purpose? If not I can make
a PR for it.
>
> Thank you,
It's on purpose, and as it was in the previous Turtle writer.
See rdfSimpleNodes , rdfLiterals around line 652.
If it were me, I'd drop all the object-list printing except possibly for
rdf:type. It does not work (look nice) for literals other than simple
cases like numbers in short form. The commas gets lost in the noise.
Anything with a ^^ to print, or strings more then a few (10 ish)
characters look horrible to me, especially if the string has comma in
it. I'd prefer the regularity of a record-like structure of
predicate-object pairs. YMMV.
But that's the way it is and has been for a while. It's judgement, not
a technical issue. So I'd say change only if the user community as a
whole indicates it wants a change.
--------------
If you want to pass options into printing, see
RDFWriter/RDFWriterBuilder (the partner to RDFParser/RDFParserBuilder)
for passing in options via the Context.
The Context object is a map of name (Symbol) to some arbitrary value so
it is for per-writer special features.
The old Turtle writer had lots ... but no one used them so I took them
out and make the system simpler. While the current one was tested with
different values in WriterConst to control layout, most of the testing
was with the consts you see there. Appearance is quite sensitive to values.
Andy