protege icon indicating copy to clipboard operation
protege copied to clipboard

Allow for custom indent in class hierarchy import

Open rsgoncalves opened this issue 7 years ago • 4 comments

rsgoncalves avatar Apr 26 '17 20:04 rsgoncalves

Can you please elaborate on the idea? You mean using spaces instead of tabs? Maybe allowing the mixing the two? Or allowing indentation with multiple tabs to be seen as one? Some examples would be great.

csnyulas avatar Apr 26 '17 21:04 csnyulas

The idea is for the indent to be parameterisable. If one writes down a huge hierarchy in a file using a single space as an indent, Protege should allow specifying that the indent for that particular file is a single space (rather than forcing users to modify their files to adhere to our predefined indent).

rsgoncalves avatar May 17 '17 02:05 rsgoncalves

We could detect the indent from the first row that starts more to the right than the row above it, and then we can let the user confirm it, or choose a different indent, say on a different wizard step. For example from this input:

Shape
	RoundShape
		Circle
		Ellipse

The wizard would suggest the indent to be 1 TAB, because RoundShape start one TAB more to the right than Shape For this example

Shape
		RoundShape
				Circle
				Ellipse

the wizard would suggest 2 TABs, while in this case

Shape
   RoundShape
      Circle
      Ellipse

3 spaces. Maybe we don't even need to have this confirmed by the user, because what if the user choses the wrong character or the wrong amount of character. Should the import fail in that case?

csnyulas avatar May 17 '17 04:05 csnyulas

Custom indent will be very useful as well for maintaining a reasonable diff for source version control (like Git).

See #1189

bact avatar Jan 14 '24 16:01 bact