Re: Pretty printing OWL FSS : request for preferences and samples

On 11 March 2015 at 17:56, Chris Mungall <cjmungall@lbl.gov> wrote:
>
> If the goal is pretty-printing, then it needs to emit labels after ##s, akin
> to obo format and the behavior of the owlapi rdf/xml writer. This dictates
> behavior regarding newlines for closing parentheses.
>
> E.g.
>
> SubClassOf(
>   Annotation(
>      :IAO_0000232  ## curator note
>      "this is a text axiom"
>   )
>   :ZFA_0005587   ## nephron progenitor
>   ObjectSomeValuesFrom(
>     :BFO_0000050  ## part of
>     :ZFA_0000529  ## kidney
>   ))
>
> If only annotations were the final argument rather than the first.
>
> Perhaps what we actually need is a new syntax designed from the ground up
> with specific requirements in mind (e.g. layered on a sensible syntax like
> yaml, no lingering traces of lisp, VCSable, readable, moderately hackable in
> a text editor, incorporating @context ideas from JSON-LD).
>

This made me wonder if the intent is a pretty print only, for human
eyes to peruse, or if it's intended to be parseable by the existing
FSS parsers.
A lot more possibilities open up if parsing back is not a requirement
- would be a different output format, in actuality.
Cheers,
I.

>
> On 11 Mar 2015, at 9:30, Simon Spero wrote:
>
>> 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 19:00:58 UTC