Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 1, 2025

README documentation needed to clarify the distinction between logical pattern types and the syntactic elements in the grammar, specifically identifying annotated_pattern as the generic syntactic element.

Changes

  • Added "Patterns and Subjects" section explaining the logical data structure:

    • Pattern<V> - the generic pattern type with value and elements
    • Pattern<Subject> - gram patterns where values are subjects
    • Subject - content combining identifier, labels, and/or properties (not a pattern type)
  • Added "Annotated Patterns" section identifying the generic syntactic element:

    • annotated_pattern - the generic syntactic element in gram notation
    • Structure: [ annotations | pattern_elements ]
  • Added "Pattern Elements" section showing the three syntactic forms within annotated patterns:

    • Bracket Notation - [ subject | elements ] explicitly shows pattern structure
    • Node Notation - ( subject ) parentheses as syntactic sugar for graph nodes
    • Relationship Notation - arrows connecting nodes as syntactic sugar for graph relationships
  • Added examples demonstrating the syntactic forms:

// Bracket notation
[devrel:Team {name: "Developer Relations"} | abk, adam, alex]

// Node notation (syntactic sugar)
(a:Person {name: "Alice"})

// Relationship notation (syntactic sugar)
(a:Person)-[:KNOWS]->(b:Person)

Existing tests (163) and SYNTAX_NOTES.md already use consistent terminology—no changes needed.

Original prompt

Update the terminology in documentation, tests and code to be consistent with the syntax elements defined in grammar.js
Improve the readme to emphasize the "annotated pattern" notation as the generic form, with the path-like syntax as syntactic sugar. Show equivalents


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 1, 2025 13:54
Copilot AI changed the title [WIP] Update documentation and code terminology for consistency Update README terminology to emphasize annotated patterns as canonical form Dec 1, 2025
Copilot AI requested a review from akollegger December 1, 2025 13:59
Copy link
Contributor

@akollegger akollegger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've introduced "subject pattern" as a term which is fine as the name for the specialization of the generic pattern structure.

In typescript, a pattern is:
type Pattern {
value:V
elements:Pattern[]
}

Gram is notation for patterns of subjects: Pattern

So "subject pattern" is fine for naming that type.

The gram grammar, though, does not have that type directly. Instead it supports two syntaxes for subject patterns:

  • annotated patterns using square brackets to contain a subject and elements
  • node & relationship patterns as syntactic sugar for graph-like patterns

Revise the readme to carefully distinguish between logical patterns and the syntactic forms.

Also, look through tests in the corpus to make sure the terminology is consistent

Copy link
Contributor Author

Copilot AI commented Dec 1, 2025

You've introduced "subject pattern" as a term which is fine as the name for the specialization of the generic pattern structure.

In typescript, a pattern is: ...

Revised in 807764d. The README now clearly distinguishes:

  1. Logical pattern type: Pattern<V> = { value: V, elements: Pattern<V>[] }
  2. Subject pattern: Pattern<Subject> - the specialized type
  3. Syntactic forms:
    • Bracket notation (subject_pattern) - [ subject | elements ]
    • Path notation (node_pattern and relationship_pattern) - syntactic sugar for graph-like data

Reviewed test corpus - terminology is already consistent with grammar.js.

Copilot AI changed the title Update README terminology to emphasize annotated patterns as canonical form Update README terminology to distinguish logical patterns from syntactic forms Dec 1, 2025
Copilot AI requested a review from akollegger December 1, 2025 14:28
@akollegger
Copy link
Contributor

Nope. Again look carefully and you will see that gram does not have a syntactic element called subject_pattern. I will give you a cookie if you can name the generic syntactic element.

Copy link
Contributor

@akollegger akollegger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try again subjects are content. There is no such thing as a subject_pattern in the grammar.

Copy link
Contributor Author

Copilot AI commented Dec 1, 2025

Nope. Again look carefully and you will see that gram does not have a syntactic element called subject_pattern. I will give you a cookie if you can name the generic syntactic element.

Fixed in a7407b7. The generic syntactic element is annotated_pattern!

The README now correctly:

  • Identifies annotated_pattern as the generic syntactic element
  • Clarifies that subjects are content/data, not pattern types
  • Organizes the three syntactic forms for pattern elements: bracket notation, node notation, and relationship notation

Try again subjects are content. There is no such thing as a subject_pattern in the grammar.

Fixed in a7407b7. Subjects are now correctly described as content (identifier, labels, and/or properties), not pattern types. The generic syntactic element is annotated_pattern.

Copilot AI changed the title Update README terminology to distinguish logical patterns from syntactic forms Update README to correctly identify annotated_pattern as the generic syntactic element Dec 1, 2025
Copilot AI requested a review from akollegger December 1, 2025 14:46
Copy link
Contributor

@akollegger akollegger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to do this

@akollegger
Copy link
Contributor

There is no longer any such thing as "bracket notation". Instead the generic annotated pattern notation uses brackets.

@akollegger akollegger marked this pull request as ready for review December 3, 2025 02:49
@akollegger akollegger requested a review from Copilot December 3, 2025 02:50
@akollegger akollegger review requested due to automatic review settings December 3, 2025 02:52
@akollegger akollegger merged commit 441c2f3 into main Dec 3, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants