shexSpec / spec

ShEx specification
https://shexspec.github.io/spec/
Other
14 stars 10 forks source link

ObjectLiteral type attribute #54

Closed ektrah closed 1 year ago

ektrah commented 1 year ago

Section 2.1 currently says:

ShEx data structures are represented as JSON objects with a member with the name "type" (i.e. an object with a type attribute):

{ "type": "typeName", member0…n }
    ↑

And Section 5.4 defines:

ObjectLiteral { value:STRING language:STRING? type:STRING? }
                                               ↑

Is there a conflict between type and type?

ericprud commented 1 year ago

Hmm, Yes and no. The JSG in the spec spares the reader of some details. Some readers, however, pay attention to details (looking your direction). The JSG that I use for testing has a directive that disables the type expectation for ObjectLiteral:

.TYPE type - ObjectLiteral

(The meaning is: expect the production name (e.g. Schema, ShapeDecl, ShapeOr, …) as type everywhere except those productions referenced after the -. Maybe there's a clearer name for .TYPE; maybe .PRODNAME? JSG can still change.)

So now the Q is do I

  1. mention that directive, or at least it effect, in §2.1?
  2. write a spec for jsg and reference it from the grammar?
  3. do nothing, assuming I've already communicated with the only person in the world who'll notice?
ektrah commented 1 year ago

Thanks for the confirmation. I think a brief note on this exception in §2.1 would be quite helpful.

ericprud commented 1 year ago

First commit above was on the wrong branch. Second produces the note at the bottom of the editor's draft. I tried to work it in near the top but "These are express in JSON as…" became pretty tenuous.

Feel free to close this issue if you feel it's address.

Most of all, thanks for improving the spec!

ericprud commented 1 year ago

for posterity, markup errors fixed in 8343717 c.f. https://github.com/shexSpec/spec/runs/7948878949?check_suite_focus=true