Search Mailing List Archives
[protege-owl] Unique cannonical serialization (using Subversion or some such)
james at howison.name
Tue Mar 17 13:48:46 PDT 2009
On 17 Mar 2009, at 2:54 PM, Tania Tudorache wrote:
> Hi Eric,
> I don't think it is a good idea relying on a particular serialization,
> but I understand your set up. Protege 3.x IS using Jena to write out
> OWL file, that is why it is different each time, so writing your own
> serialization using Jena won't help :)
> Instead, you can use the native writer which you can configure from
> menu -> Preferences -> Experimental native writer. If you will also
> enable the 'Sort resources alphabetically' checkbox, then the output
> will be repeatable across different Protege work sessions.
> There have been several emails on the list about using OWL files
> in SVN. You should be able to find them in the archive. Main problem
> that a text-based diff of an RDF serialization of OWL will not be
> useful, as the same OWL axiom can be expressed and serialized in
> different ways (e.g. rdfs:subclass of A -> B, B-> A; and A
> owl:equivalentClass B, etc.)
> So, a text diff will not give the users what they want. There are
> several structural diff tools that you could use that will give a much
> better result. PromptDiff is one of them, is already integrated in
> Protege, and is also used in another project in a production setting.
> So, a combination of SVN with PromptDiff (or another OWL diff tool)
> would work.
This suggestion is spot-on, I think. diffs in a version control
system serve two purposes, the first is to move from version to
version, by being applied in sequence. The second is being (near?)
human readable to see what has changed, in conjunction with a possible
narrative log message.
Straight-up text diffs serve the first function fine regardless of the
serialization, even if they are just the fully degenerate 'delete all
lines of version t, add all lines of version t+1' extreme. Obviously
those are basically useless for the second function.
PromptDiff output should serve the second function, if I understand
correctly, so I think a possible strategy would be to use PromptDiff
to generate the 'bottom-half' of an explanatory log message, while
either allowing plain text diff to handle the moving from version to
version, or (strongly preferred) marking the files as binary (which
are treated as full replacements by SVN).
Was that kind of what you had in mind? I'm not quite sure how one
would implement it, SVN doesn't immediately have a way of separating
the two functions of diff, at least that I can see. It's some sort of
combination of --diff-cmd and a repository hook like (but not quite
like) pre-commit... Of course you could fake it by running something
like a svn diff --diff-cmd='path/to/promtdiff' new-version-of-
ontology.owl > tempfile, then copying the contents of tempfile into
the SVN log message ...
Perhaps that's already implemented somewhere and I'm just not finding
Of course one could generate an ontology for describing changes to an
ontology, and have the individuals of that be the log message and have
a diff-like command that applies them to move from version to
More information about the protege-owl