Pretty printing OWL FSS : request for preferences and samples

I've been doing a little work on improving parts of the OWLAPI rendering
code in order to render things in order (this makes a huge difference for
VCS).

Now that this seems to be behaving, I'm feeling motivated to fix something
that I've meant to poke at for a long time; the way that OWLAPI FSS
renderers every axiom on a single line[1].

Whenever I need to format an even moderately complicated line says, I end
up copying it in to an emacs buffer, and inserting line breaks and
indentation by hand.

Sometimes this  layout is formatting  for a \verbatim or a slide. These
cases are  driven by space and aesthetic concerns, and are generally  hand
tweaked anyway.

Generally I'm doing this to try and figure out what the difference is
between two similar looking blobs of text (like a c-diff). This is a good
fit with the needs of a VCS.

There are a number of issues to consider when rendering. Some of this is a
tension between minimizing the size of line diffs and minimizing the use of
vertical space.

For example:

* Should there always be a line break after an axiom annotation? What about
after an annotation annotation+

* For axioms like EquivalentClasses, if all the class expressions will fit
on a single line should they be rendered in a single line?

* If any expressions are too long to fit the target width, should all
expressions be followed by a line break?

* If an axiom or expression is split over multiple lines, should closing
parentheses be on their own line, like C/Java braces, or should they be
grouped together, lisp-style?

* the closing parenthesis for "Ontology(" traditionally appears on a line
by itself. This seems to be a special case; are there other cases where
this is idiomatic?

The examples in the OWL 2 syntax specification are not uniform.

Does anybody have strong preferences? Otherwise I am likely  to err on the
side of using more line breaks sake of simplicity.

Simon

[1] Except for literals that contain newlines.

Received on Wednesday, 11 March 2015 16:30:48 UTC