It's not a direct solution, but please have a look at the "LongTurtle" format 
used in Python's RDFLib library to see if that style of formatting's good/bad 
etc. This conversion tool allows outputting in LongTurtle:

http://rdftools.kurrawong.net/convert

I'm a maintainer of RDFLib and would be keen to test out other Turtle 
formatting there to check equivalences with Jena. Always necissary to have 2+ 
implementations of things!

Cheers, Nick



------- Original Message -------
On Tuesday, June 20th, 2023 at 09:35, Shaw, Ryan <[email protected]> wrote:


> I would like to create a custom Turtle pretty printer that does not try to 
> align things like the current pretty printer does. I just want a standard 
> indentation width (e.g. two spaces).
> 
> So, instead of:
> 
> `[ a time:ProperInterval ; time:hasBeginning [ a time:Instant ; 
> time:inDateTime [ a time:DateTimeDescription ; time:day "---12"^^xsd:gDay ; 
> time:hour "23"^^xsd:nonNegativeInteger ; time:minute 
> "20"^^xsd:nonNegativeInteger ; time:month "--04"^^xsd:gMonth ; time:second 
> "30"^^xsd:decimal ; time:timeZone bipm:UTC ; time:unitType time:unitSecond ; 
> time:year "1985"^^xsd:gYear ] ] ; time:hasDurationDescription [ a 
> time:DurationDescription ; time:hours "04"^^xsd:nonNegativeInteger ] ; 
> time:hasEnd :when2 ] .`
> 
> I would instead like:
> 
> `[ a time:ProperInterval ; time:hasBeginning :when1 ; 
> time:hasDurationDescription [ a time:DurationDescription ; time:hours 
> "04"^^xsd:nonNegativeInteger ] ; time:hasEnd [ a time:Instant ; 
> time:inDateTime [ a time:DateTimeDescription ; time:day "---12"^^xsd:gDay ; 
> time:hour "23"^^xsd:nonNegativeInteger ; time:minute 
> "20"^^xsd:nonNegativeInteger ; time:month "--04"^^xsd:gMonth ; time:second 
> "30"^^xsd:decimal ; time:timeZone bipm:UTC ; time:unitType time:unitSecond ; 
> time:year "1985"^^xsd:gYear ] ] ] .`
> 
> (Note how much easier the 2nd is to read without a super-wide window!)
> 
> I know that I can add a new writer for a new language, but how do I add a new 
> pretty-printed format for an existing language?
> 
> Thanks,
> Ryan

Reply via email to