protegeproject / protege

Protege Desktop
http://protege.stanford.edu
Other
1.01k stars 231 forks source link

Ability to specify indent length when save/export file #1189

Open bact opened 8 months ago

bact commented 8 months ago

A custom indent will be very useful for maintaining a reasonable diff for source version control (like Git).

I have moved to a new environment recently and found that when saving file in Protege the indentation for Turtle file have changed from a fixed length 2-space indent to a variable length indent at vary by the name of the class. For example:

Previous TTL file:

:TechnicalDocumentation a owl:Class;
  rdfs:subClassOf odrl:AssetCollection;
  rdfs:comment """xxx"""

Current TTL file:

:TechnicalDocumentation rdf:type owl:Class ;
                        rdfs:subClassOf odrl:AssetCollection ;
                        rdfs:comment """xxx"""

This cause a lot of unnecessary changes in the code base which make it hard to spot a really meaningful change.

If a user can specify explicitly on the length of the indent, it will make the source version control easier to deal it.

Btw, I'm not 100% certain about the change in my environment. Protege version is probably the same. The Java runtime has changed from OpenJDK Temurin 17 to OpenJDK Temurin 21. There can be a change in OWL API that I'm not aware of.