w3c / N3

W3C's Notation 3 (N3) Community Group
47 stars 18 forks source link

Rule example formatting #138

Open VladimirAlexiev opened 1 year ago

VladimirAlexiev commented 1 year ago

https://w3c.github.io/N3/spec/#example-23

Is this really a good way to format a rule?

{ :weather a :Raining
} => {
  :weather a :Cloudy
} . 

Maybe change to this:

{
  :weather a :Raining
} => {
  :weather a :Cloudy
} . 

Or this

{ :weather a :Raining }
 => 
{ :weather a :Cloudy } . 

Sorry for the nitpicking, but many people (me included) learn by copy-paste :-)

TallTed commented 1 year ago

fwiw, I prefer the latter.

william-vw commented 1 year ago

I'd opt to avoid discussions on personal formatting preferences unless the chosen formatting is misleading (see my comment on PR https://github.com/w3c/N3/pull/147) or, of course, the discussion is about best practices (which we haven't done).

VladimirAlexiev commented 1 year ago

Formatting Rules

N3 is a free-form language (whitespace doesn't matter). However, by following some formatting rules in your N3 files, you can make them easier to read by humans, and ensure consistency.

(By "elements" below we mean RDF terms or triple patterns).

VladimirAlexiev commented 1 year ago

@william-vw , @TallTed please comment on the principles above.

TallTed commented 1 year ago

@VladimirAlexiev — Looks good to me! It would be best to make plain that the whitespace formatting described above is meant for human-focused educational examples, optimally with a single click to see a "machine optimized" version without the extra whitespace as might be found in actual deployment.