mdld-parse 0.9.6 → 0.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -63,39 +63,6 @@ console.log(result.quads);
63
63
 
64
64
  MD-LD allows you to author RDF graphs directly in Markdown using explicit `{...}` annotations:
65
65
 
66
- ## ⚡ Performance & Architecture
67
-
68
- MD-LD v0.10.0 features a **character-based tokenization system** for optimal performance:
69
-
70
- - **20-28% faster parsing** than regex-based approaches
71
- - **Memory-efficient** with ~640 bytes per quad retained
72
- - **Streaming-friendly** with O(n) linear time complexity
73
- - **Character-based detection** replaces complex regex patterns
74
- - **Unified tokenizer architecture** in `src/tokenizers.js`
75
-
76
- ### Tokenizer Architecture
77
-
78
- The parser uses specialized character-based tokenizers:
79
-
80
- ```javascript
81
- // Block-level tokenizers
82
- detectFence() // ```code blocks
83
- detectPrefix() // [prefix] <iri>
84
- detectHeading() // # Headings
85
- detectList() // - List items
86
- detectBlockquote() // > Blockquotes
87
- detectStandaloneSubject() // {=subject}
88
-
89
- // Inline carrier scanner
90
- scanInlineCarriers() // [text], **bold**, `code`, <URL>
91
- ```
92
-
93
- This design provides:
94
- - **Better maintainability** - Easier to debug and extend
95
- - **Improved error handling** - More precise edge case detection
96
- - **Cleaner code structure** - No complex regex patterns
97
- - **Full backward compatibility** - All 127 tests passing
98
-
99
66
  ```markdown
100
67
  [my] <tag:alice@example.com,2026:>
101
68
  # 2024-07-18 {=my:journal-2024-07-18 .my:Event my:date ^^xsd:date}
@@ -118,13 +85,15 @@ pnpm install mdld-parse
118
85
  ```javascript
119
86
  import { parse } from 'mdld-parse';
120
87
 
121
- const markdown = `# Document {=ex:doc .Article}
122
- [Alice] {author}`;
88
+ const markdown = `[ex] <tag:alice@example.org,2026:>
123
89
 
124
- const result = parse({
125
- text: markdown,
126
- context: { ex: 'http://example.org/' }
127
- });
90
+ # Demo document {=ex:example/doc .prov:Entity label}
91
+
92
+ > A demo document for MD-LD {comment}
93
+ [Alice] {+ex:alice ?ex:author .prov:Person label}
94
+ `;
95
+
96
+ const result = parse({ text: markdown });
128
97
 
129
98
  console.log(result.quads);
130
99
  // RDF/JS quads ready for n3.js, rdflib, etc.
@@ -136,7 +105,7 @@ console.log(result.quads);
136
105
  <script type="module">
137
106
  import { parse } from 'https://cdn.jsdelivr.net/npm/mdld-parse/+esm';
138
107
 
139
- const result = parse('# Hello {=ex:hello label}');
108
+ const result = parse('[ex] <tag:alice@example.org,2026:>\n\n# Hello {=ex:hello label}');
140
109
  </script>
141
110
  ```
142
111
 
@@ -154,9 +123,9 @@ Each predicate form determines the graph edge:
154
123
 
155
124
  | Form | Edge | Example | Meaning |
156
125
  |-------|---------|------------------------------|------------------|
157
- | `p` | S → L | `[Alice] {name}` | literal property |
126
+ | `p` | S → L | `[Alice] {label}` | literal property |
158
127
  | `?p` | S → O | `[NASA] {=ex:nasa ?org}` | object property |
159
- | `!p` | O → S | `[Parent] {=ex:p !hasPart}` | reverse object |
128
+ | `!p` | O → S | `[Parent] {=ex:p !hasPart}` | reverse object |
160
129
 
161
130
  ## 📍 Elevated Statements
162
131
 
package/dist/README.md CHANGED
@@ -63,39 +63,6 @@ console.log(result.quads);
63
63
 
64
64
  MD-LD allows you to author RDF graphs directly in Markdown using explicit `{...}` annotations:
65
65
 
66
- ## ⚡ Performance & Architecture
67
-
68
- MD-LD v0.10.0 features a **character-based tokenization system** for optimal performance:
69
-
70
- - **20-28% faster parsing** than regex-based approaches
71
- - **Memory-efficient** with ~640 bytes per quad retained
72
- - **Streaming-friendly** with O(n) linear time complexity
73
- - **Character-based detection** replaces complex regex patterns
74
- - **Unified tokenizer architecture** in `src/tokenizers.js`
75
-
76
- ### Tokenizer Architecture
77
-
78
- The parser uses specialized character-based tokenizers:
79
-
80
- ```javascript
81
- // Block-level tokenizers
82
- detectFence() // ```code blocks
83
- detectPrefix() // [prefix] <iri>
84
- detectHeading() // # Headings
85
- detectList() // - List items
86
- detectBlockquote() // > Blockquotes
87
- detectStandaloneSubject() // {=subject}
88
-
89
- // Inline carrier scanner
90
- scanInlineCarriers() // [text], **bold**, `code`, <URL>
91
- ```
92
-
93
- This design provides:
94
- - **Better maintainability** - Easier to debug and extend
95
- - **Improved error handling** - More precise edge case detection
96
- - **Cleaner code structure** - No complex regex patterns
97
- - **Full backward compatibility** - All 127 tests passing
98
-
99
66
  ```markdown
100
67
  [my] <tag:alice@example.com,2026:>
101
68
  # 2024-07-18 {=my:journal-2024-07-18 .my:Event my:date ^^xsd:date}
@@ -118,13 +85,15 @@ pnpm install mdld-parse
118
85
  ```javascript
119
86
  import { parse } from 'mdld-parse';
120
87
 
121
- const markdown = `# Document {=ex:doc .Article}
122
- [Alice] {author}`;
88
+ const markdown = `[ex] <tag:alice@example.org,2026:>
123
89
 
124
- const result = parse({
125
- text: markdown,
126
- context: { ex: 'http://example.org/' }
127
- });
90
+ # Demo document {=ex:example/doc .prov:Entity label}
91
+
92
+ > A demo document for MD-LD {comment}
93
+ [Alice] {+ex:alice ?ex:author .prov:Person label}
94
+ `;
95
+
96
+ const result = parse({ text: markdown });
128
97
 
129
98
  console.log(result.quads);
130
99
  // RDF/JS quads ready for n3.js, rdflib, etc.
@@ -136,7 +105,7 @@ console.log(result.quads);
136
105
  <script type="module">
137
106
  import { parse } from 'https://cdn.jsdelivr.net/npm/mdld-parse/+esm';
138
107
 
139
- const result = parse('# Hello {=ex:hello label}');
108
+ const result = parse('[ex] <tag:alice@example.org,2026:>\n\n# Hello {=ex:hello label}');
140
109
  </script>
141
110
  ```
142
111
 
@@ -154,9 +123,9 @@ Each predicate form determines the graph edge:
154
123
 
155
124
  | Form | Edge | Example | Meaning |
156
125
  |-------|---------|------------------------------|------------------|
157
- | `p` | S → L | `[Alice] {name}` | literal property |
126
+ | `p` | S → L | `[Alice] {label}` | literal property |
158
127
  | `?p` | S → O | `[NASA] {=ex:nasa ?org}` | object property |
159
- | `!p` | O → S | `[Parent] {=ex:p !hasPart}` | reverse object |
128
+ | `!p` | O → S | `[Parent] {=ex:p !hasPart}` | reverse object |
160
129
 
161
130
  ## 📍 Elevated Statements
162
131
 
@@ -534,7 +534,8 @@ const filteredRemove = processRetractions(state.quads, state.removeSet);
534
534
  const primary = {
535
535
  subject: state.primarySubject,
536
536
  type: state.primaryType,
537
- label: state.primaryLabel
537
+ label: state.primaryLabel,
538
+ comment: state.primaryComment
538
539
  };
539
540
 
540
541
  return {
@@ -1,8 +1,8 @@
1
1
  # Primary Metadata Example
2
2
 
3
- This example demonstrates the Primary Metadata feature in MD-LD, which provides immediate access to the main entity, type, and label described by a document.
3
+ This example demonstrates the Primary Metadata feature in MD-LD, which provides immediate access to the main entity, type, label, comment described by a document.
4
4
 
5
- ## Primary Metadata Trio
5
+ ## Primary Metadata Quartet
6
6
 
7
7
  MD-LD tracks three primary metadata fields during parsing to provide immediate document identity:
8
8
 
@@ -11,6 +11,7 @@ MD-LD tracks three primary metadata fields during parsing to provide immediate d
11
11
  | **primarySubject** | First non-fragment `{=subject}` | Document identity (canonical append identity) |
12
12
  | **primaryType** | First `rdf:type` declaration | Document category (semantic classification) |
13
13
  | **primaryLabel** | First `rdfs:label` literal | Human-readable name (UI & display) |
14
+ | **primaryComment** | First `rdfs:comment` literal | Human-readable comment (UI & description) |
14
15
 
15
16
  ## Dual-Layer Architecture
16
17
 
@@ -2,118 +2,59 @@
2
2
 
3
3
  # Personal Journal {=j:index .prov:Collection label}
4
4
 
5
- Daily journal with proper PROV-O provenance and temporal structure.
5
+ Alice's daily journal, structured as a hierarchy of collections. The top-level index contains [2026] {+j:2026/index ?prov:hadMember label}.
6
6
 
7
- Includes records for [2026] {+j:2026/index ?prov:hadMember}.
7
+ ## Year 2026 {=j:2026/index .prov:Collection label}
8
8
 
9
- ## Year 2026 {=j:2026/index .prov:Activity .prov:Collection label}
9
+ 2026 is organised into monthly collections: [January] {+j:2026/01/index ?prov:hadMember label}, [February] {+j:2026/02/index ?prov:hadMember label}, [March] {+j:2026/03/index ?prov:hadMember label}, [April] {+j:2026/04/index ?prov:hadMember label}, and [May] {+j:2026/05/index ?prov:hadMember label}.
10
10
 
11
- This is all notes made in 2026 collection. It includes monthly collections:
11
+ ## May 2026 {=j:2026/05/index .prov:Collection label}
12
12
 
13
- - January {+j:2026/01/index ?prov:hadMember}
14
- - February {+j:2026/02/index ?prov:hadMember}
15
- - March {+j:2026/03/index ?prov:hadMember}
16
- - April {+j:2026/04/index ?prov:hadMember}
17
- - May {+j:2026/05/index ?prov:hadMember}
13
+ May started on [2026-05-01] {prov:startedAtTime ^^xsd:date} and is divided into five weekly collections: days [1–3] {+j:2026/05/week-1/index ?prov:hadMember label}, [4–10] {+j:2026/05/week-2/index ?prov:hadMember label}, [11–17] {+j:2026/05/week-3/index ?prov:hadMember label}, [18–24] {+j:2026/05/week-4/index ?prov:hadMember label}, and [25–31] {+j:2026/05/week-5/index ?prov:hadMember label}.
18
14
 
19
- ## May 2026 {=j:2026/05/index .prov:Activity .prov:Collection label}
15
+ ## Week 2, May 2026 {=j:2026/05/week-2/index .prov:Collection label}
20
16
 
21
- Started: [2026-05-01T00:00:00+04:00] {prov:startedAtTime ^^xsd:dateTime}
17
+ The second week of May ran from [2026-05-04] {prov:startedAtTime ^^xsd:date} through [2026-05-10] {prov:endedAtTime ^^xsd:date}. It contained [6] {j:totalActivities ^^xsd:integer} logged activities across [5] {j:readingHours ^^xsd:integer} hours of reading, [8] {j:workHours ^^xsd:integer} hours of work, and [3] {j:exerciseHours ^^xsd:integer} hours of exercise. Of [5] {j:goalsTotal ^^xsd:integer} weekly goals set on Monday, [4] {j:goalsCompleted ^^xsd:integer} were completed and [1] {j:goalsCarryOver ^^xsd:integer} carried over.
22
18
 
23
- We have 5 weeks in May - [1-3] {+j:2026/05/week-1/index ?prov:hadMember}, [4-10] {+j:2026/05/week-2/index ?prov:hadMember}, [11-17] {+j:2026/05/week-3/index ?prov:hadMember}, [18-24] {+j:2026/05/week-4/index ?prov:hadMember}, [25-31] {+j:2026/05/week-5/index ?prov:hadMember}.
19
+ The week's daily entries are members of this collection:
24
20
 
25
21
  ======
26
22
 
27
- #### 06 May 2026 {=j:2026/05/06/index .prov:Activity label}
23
+ ### 06 May 2026 {=j:2026/05/06/index .prov:Activity label}
28
24
 
29
- It's our first record in [week 2] {+j:2026/05/week-2/index ?prov:wasInformedBy}.
25
+ A productive Wednesday. The day ran from [2026-05-06T08:00:00+04:00] {prov:startedAtTime ^^xsd:dateTime} to [2026-05-06T23:30:00+04:00] {prov:endedAtTime ^^xsd:dateTime} and is a [member] {+j:2026/05/week-2/index ?prov:hadMember} of week 2. It produced a [daily summary] {+j:2026/05/06/summary .prov:Entity ?prov:generated label} capturing mood and locations visited.
30
26
 
31
- Complete day with activities, locations, and emotional state.
27
+ The day flowed through three phases, each informing the next: [morning] {+#morning ?prov:wasInformedBy}, then [afternoon] {+#afternoon ?prov:wasInformedBy}, then [social] {+#social ?prov:wasInformedBy}.
32
28
 
33
- Started: [2026-05-06T08:00:00+04:00] {prov:startedAtTime ^^xsd:dateTime}
34
- Ended: [2026-05-06T23:30:00+04:00] {prov:endedAtTime ^^xsd:dateTime}
29
+ #### Morning {=#morning .prov:Activity label}
35
30
 
36
- Includes these activities: [morning] {+#morning !prov:wasInformedBy}, [afternoon] {+#afternoon !prov:wasInformedBy} and [social] {+#social !prov:wasInformedBy}.
31
+ The morning started with a [walk] {+#walk ?prov:wasInformedBy} and then [coffee] {+#coffee-prep ?prov:wasInformedBy}.
37
32
 
38
- ### Morning Activities {=#morning .prov:Activity label}
33
+ ##### Morning Walk {=#walk .prov:Activity label}
39
34
 
40
- I had a [walk] {+#walk ?prov:wasInformedBy} and a [coffee] {+#coffee-prep ?prov:wasInformedBy}.
35
+ A [45] {j:durationMin ^^xsd:integer}-minute run covering [2.5] {j:distanceMiles ^^xsd:decimal} miles through [Central Park] {+j:place/central-park .prov:Location ?prov:atLocation label}, wearing [running shoes] {+j:shoes/running .prov:Entity ?prov:used label}. The watch generated [heart rate data] {+j:2026/05/06/hr-data .prov:Entity ?prov:generated label} for the session.
41
36
 
42
- **Morning Walk** {=#walk .prov:Activity label}
43
- - Duration: [45] {j:duration ^^xsd:integer} minutes
44
- - Distance: [2.5] {j:distance ^^xsd:decimal} miles
45
- - Location: [Central Park] {+j:place/central-park .prov:Location ?prov:atLocation}
46
- - Equipment: [Running Shoes] {+j:shoes/running ?prov:used}
47
- - Generated: [Heart Rate Data] {+j:2026/05/06/hr-data ?prov:generated}
37
+ ##### Coffee Preparation {=#coffee-prep .prov:Activity label}
48
38
 
49
- **Coffee Preparation** {=#coffee-prep .prov:Activity ?prov:used}
50
- - Location: [Home] {+j:place/home ?prov:atLocation}
51
- - Resources: [Coffee Beans] {+j:coffee/beans ?prov:used}, [Water] {+j:coffee/water ?prov:used}
52
- - Generated: [Morning Coffee] {+#morning-coffee ?prov:generated}
39
+ Back [home] {+j:place/home .prov:Location ?prov:atLocation label}, ground [coffee beans] {+j:coffee/beans .prov:Entity ?prov:used label} with [water] {+j:coffee/water .prov:Entity ?prov:used label} and produced a [morning coffee] {+#morning-coffee .prov:Entity ?prov:generated label}.
53
40
 
54
- ### Afternoon Activities {=#afternoon .prov:Activity label}
41
+ #### Afternoon {=#afternoon .prov:Activity ?prov:wasInformedBy label}
55
42
 
56
- **Reading Session** {=#reading .prov:Activity}
57
- - Book: [Dune] {+j:dune-book .prov:Entity ?prov:used}
58
- - Pages: [42] {j:pages ^^xsd:integer}
59
- - Duration: [2] {j:hours ^^xsd:integer}
60
- - Generated: [Reading Notes] {+j:reading-notes ?prov:generated}
43
+ The afternoon split between reading and a work session.
61
44
 
62
- **Work Session** {+j:work .prov:Activity ?prov:used}
63
- - Task: [API Documentation] {+j:api-docs .prov:Entity ?prov:used}
64
- - Duration: [3] {j:hours ^^xsd:integer}
65
- - Generated: [Documentation Updates] {+j:doc-updates ?prov:generated}
45
+ ##### Reading Session {=#reading .prov:Activity label}
66
46
 
67
- ### Social Interactions {=#social .prov:Activity label}
47
+ Read [42] {j:pages ^^xsd:integer} pages of [Dune] {+j:dune-book .prov:Entity ?prov:used label} over [2] {j:durationHours ^^xsd:integer} hours, producing [reading notes] {+j:reading-notes .prov:Entity ?prov:generated label}.
68
48
 
69
- **Coffee Meeting** {+j:coffee-meeting .prov:Activity ?prov:used}
70
- - Associated with: [Sam] {+j:sam .prov:Person ?prov:wasAssociatedWith}
71
- - Location: [Local Cafe] {+j:cafe .prov:Location ?prov:atLocation}
72
- - Duration: [30] {j:minutes ^^xsd:integer}
73
- - Topic: [Career Changes] {j:topic}
49
+ ##### Work Session {=#work .prov:Activity ?prov:wasInformedBy label}
74
50
 
75
- ## Emotional State Tracking {=#emotional-state .prov:Entity label}
51
+ Spent [3] {j:durationHours ^^xsd:integer} hours on [API documentation] {+j:api-docs .prov:Entity ?prov:used label}, generating [documentation updates] {+j:doc-updates .prov:Entity ?prov:generated label}.
76
52
 
77
- Daily mood and energy levels with temporal context.
53
+ #### Social {=#social .prov:Activity ?prov:wasInformedBy label}
78
54
 
79
- ### Mood Data {=j:mood-data .prov:Entity label}
80
- Date: [2026-05-06] {j:date ^^xsd:date}
81
- Mood: [happy] {j:mood}
82
- Energy level: [8] {j:energy ^^xsd:integer} out of 10
83
- Stress level: [2] {j:stress ^^xsd:integer} out of 10
55
+ Met [Sam] {+j:sam .prov:Person ?prov:wasAssociatedWith label} at the [local café] {+j:place/cafe .prov:Location ?prov:atLocation label} for [30] {j:durationMin ^^xsd:integer} minutes to talk through [career changes] {j:topic}.
84
56
 
85
- ### Location History {=j:location-history .prov:Entity label}
86
- Places visited with frequency and context.
57
+ ### Daily Summary {=j:2026/05/06/summary .prov:Entity label}
87
58
 
88
- Locations:
89
- - [Central Park] {+j:central-park ?j:visited} - [3] {j:visitCount ^^xsd:integer} times this week
90
- - [Local Cafe] {+j:cafe ?j:visited} - [2] {j:visitCount ^^xsd:integer} times this week
91
- - [Home Office] {+j:home-office ?j:visited} - [5] {j:visitCount ^^xsd:integer} days this week
92
-
93
- ## Week 2 May 2026 {=j:2026/05/week-2/index .prov:Activity .prov:Collection label}
94
-
95
- Started: [2026-05-04T00:00:00+04:00] {prov:startedAtTime ^^xsd:dateTime}
96
-
97
- Aggregated activities and patterns for the week.
98
-
99
- Started: [2026-05-06T23:00:00Z] {prov:startedAtTime ^^xsd:dateTime}
100
- Ended: [2026-05-06T23:15:00Z] {prov:endedAtTime ^^xsd:dateTime}
101
-
102
- ### Activities Summary
103
- Total activities: [6] {j:totalActivities ^^xsd:integer}
104
- Reading time: [5] {j:readingHours ^^xsd:integer} hours
105
- Work time: [8] {j:workHours ^^xsd:integer} hours
106
- Exercise time: [3] {j:exerciseHours ^^xsd:integer} hours
107
-
108
- ### Goals Progress
109
- Weekly goals: [Set on Monday] {j:weeklyGoals}
110
- Completed: [4] {j:goalsCompleted ^^xsd:integer} out of 5
111
- Carry over: [1] {j:goalsCarryOver ^^xsd:integer} goal
112
-
113
- This demonstrates:
114
- - Proper PROV-O activity chains
115
- - Temporal properties with XSD
116
- - Location and emotional tracking
117
- - Activity aggregation and summarization
118
- - Social interaction modeling
59
+ End-of-day reflection, generated by the day's activity. Mood: [happy] {j:mood}, energy [8] {j:energy ^^xsd:integer}/10, stress [2] {j:stress ^^xsd:integer}/10. Places visited today: [Central Park] {+j:place/central-park ?j:visited}, [home] {+j:place/home ?j:visited}, and [local café] {+j:place/cafe ?j:visited}.
119
60
 
@@ -1,98 +1,84 @@
1
1
  [proj] <tag:alice@example.com,2026:project/>
2
2
 
3
- # Website Redesign {=proj:website .prov:Project label}
3
+ # Website Redesign {=proj:website .proj:Project .prov:Plan label}
4
4
 
5
- Website redesign project for Q2 2026 with modern responsive design.
5
+ The Q2 2026 website redesign is a [$25,000] {proj:budget ^^xsd:decimal} initiative running from [2026-06-01] {prov:startedAtTime ^^xsd:date} through [2026-08-31] {prov:endedAtTime ^^xsd:date}, currently in [planning] {proj:status} status. It is backed by the [Marketing Department] {+proj:marketing ?proj:sponsor .prov:Organization label} and [Customer Support] {+proj:support ?proj:stakeholder .prov:Organization label}, both of whom provided the brief.
6
6
 
7
- ## Project Metadata {=proj:website-meta .prov:Entity label}
7
+ ## Team
8
8
 
9
- Budget: [$25,000] {proj:budget ^^xsd:decimal}
10
- Start date: [2026-06-01] {proj:startDate ^^xsd:date}
11
- End date: [2026-08-31] {proj:endDate ^^xsd:date}
12
- Status: [planning] {proj:status}
9
+ Three people assembled under the [Q2 Website Plan] {+proj:q2-plan .prov:Plan label} to staff this project.
13
10
 
14
- ## Team Formation Activity {=proj:team-formation .prov:Activity label}
11
+ ### Alice Johnson {=proj:alice .prov:Person label}
15
12
 
16
- Started: [2026-05-15T09:00:00Z] {prov:startedAtTime ^^xsd:dateTime}
17
- Associated with: [Alice Johnson] {+proj:alice .prov:Person ?prov:wasAssociatedWith} as Project Manager
18
- Plan: [Q2 Website Plan] {+proj:q2-plan .prov:Plan ?prov:hadPlan}
13
+ [alice@example.com] {proj:email} — [Project Manager] {proj:role}, responsible for overall delivery and stakeholder communication.
19
14
 
20
- Generated: [Team Structure] {+proj:team-structure ?prov:generated}
15
+ ### Bob Smith {=proj:bob .prov:Person label}
21
16
 
22
- ## Team Members
17
+ [bob@example.com] {proj:email} — [Lead Developer] {proj:role}, leading all frontend and backend implementation work. Bob acts on behalf of [Alice] {+proj:alice ?prov:actedOnBehalfOf} as the technical authority for the project.
23
18
 
24
- ### Project Manager {=proj:alice .prov:Person label}
19
+ ### Carol Davis {=proj:carol .prov:Person label}
25
20
 
26
- Name: [Alice Johnson] {rdfs:label}
27
- Email: [alice@example.com] {proj:email}
28
- Role: [Project Manager] {proj:role}
21
+ [carol@example.com] {proj:email} — [UX Designer] {proj:role}, responsible for user research through to final visual design.
29
22
 
30
- ### Lead Developer {=proj:bob .prov:Person label}
23
+ ## Team Formation {=proj:team-formation .prov:Activity label}
31
24
 
32
- Name: [Bob Smith] {rdfs:label}
33
- Email: [bob@example.com] {proj:email}
34
- Role: [Lead Developer] {proj:role}
25
+ On [2026-05-15T09:00:00Z] {prov:startedAtTime ^^xsd:dateTime} Alice convened the team and formalised the plan. She was [associated with] {+proj:alice ?prov:wasAssociatedWith} the activity directly, and it produced the [assembled team entity] {+proj:team-structure .prov:Entity ?prov:generated label} — the agreed roster and responsibility assignments that subsequent phases depend on.
35
26
 
36
- ### UX Designer {=proj:carol .prov:Person label}
27
+ ## Design Phase {=proj:design-phase .prov:Activity ?prov:wasInformedBy label}
37
28
 
38
- Name: [Carol Davis] {rdfs:label}
39
- Email: [carol@example.com] {proj:email}
40
- Role: [UX Designer] {proj:role}
29
+ Kicking off on [2026-06-01] {prov:startedAtTime ^^xsd:date} and wrapping by [2026-06-15] {prov:endedAtTime ^^xsd:date}, the design phase was led by [Carol] {+proj:carol ?prov:wasAssociatedWith}. It drew on the [assembled team entity] {+proj:team-structure ?prov:used} established during team formation and consumed the [existing design system] {+proj:design-system .prov:Entity ?prov:used label} as a constraint baseline. The phase moved from user interviews through wireframes to polished mockups, producing the [design documentation] {+proj:design-docs .prov:Entity ?prov:generated label} that development would build from.
41
30
 
42
- ## Project Tasks
31
+ ## Development Phase {=proj:dev-phase .prov:Activity ?prov:wasInformedBy label}
43
32
 
44
- ### Design Phase {=proj:design-phase .prov:Activity label}
33
+ Development ran from [2026-06-16] {prov:startedAtTime ^^xsd:date} to [2026-07-30] {prov:endedAtTime ^^xsd:date}, led by [Bob] {+proj:bob ?prov:wasAssociatedWith}. The team used the [design documentation] {+proj:design-docs ?prov:used} directly — no redesign, just implementation — alongside the [API documentation] {+proj:api-docs .prov:Entity ?prov:used label} for backend contracts. The phase generated the [working prototype] {+proj:prototype .prov:Entity ?prov:generated label} deployed to staging.
45
34
 
46
- Started: [2026-06-01] {prov:startedAtTime ^^xsd:date}
47
- Ended: [2026-06-15] {prov:endedAtTime ^^xsd:date}
35
+ ## Validation Shapes
48
36
 
49
- Tasks:
50
- - [User Research] {+proj:user-research .proj:Task ?prov:used} - interviews and surveys
51
- - [Wireframes] {+proj:wireframes .proj:Task ?prov:used} - low-fidelity layouts
52
- - [High-fidelity Mockups] {+proj:mockups .proj:Task ?prov:used} - detailed designs
37
+ Every project document should be self-consistent. These shapes enforce the minimum structural expectations for a project, its team, and its deliverables.
53
38
 
54
- Generated: [Design Documentation] {+proj:design-docs ?prov:generated}
39
+ ### Project Shape {=proj:ProjectShape .sh:NodeShape label}
55
40
 
56
- ### Development Phase {=proj:dev-phase .prov:Activity label}
41
+ Validates every [proj:Project] {+proj:Project ?sh:targetClass} to carry a [budget] {+#budget ?sh:property sh:name}, a [status] {+#status ?sh:property sh:name}, and at least one [sponsor] {+#sponsor ?sh:property sh:name}.
57
42
 
58
- Started: [2026-06-16] {prov:startedAtTime ^^xsd:date}
59
- Ended: [2026-07-30] {prov:endedAtTime ^^xsd:date}
43
+ #### Budget is required {=#budget .sh:PropertyShape sh:message}
44
+ [proj:budget] {+proj:budget ?sh:path} must appear exactly [1] {sh:minCount sh:maxCount ^^xsd:integer} time and be a [decimal] {+xsd:decimal ?sh:datatype}.
60
45
 
61
- Tasks:
62
- - [Frontend Development] {+proj:frontend .proj:Task ?prov:used} - React components
63
- - [Backend API] {+proj:backend .proj:Task ?prov:used} - Node.js services
64
- - [Database Schema] {+proj:database .proj:Task ?prov:used} - PostgreSQL design
46
+ #### Status is required {=#status .sh:PropertyShape sh:message}
47
+ [proj:status] {+proj:status ?sh:path} must appear at least [1] {sh:minCount ^^xsd:integer} time.
65
48
 
66
- Generated: [Working Prototype] {+proj:prototype ?prov:generated}
49
+ #### Sponsor is required {=#sponsor .sh:PropertyShape sh:message}
50
+ A project must be backed by at least [1] {sh:minCount ^^xsd:integer} [proj:sponsor] {+proj:sponsor ?sh:path}.
67
51
 
68
- ## Project Relationships
52
+ ### Team Member Shape {=proj:PersonShape .sh:NodeShape label}
69
53
 
70
- ### Dependencies {=proj:dependencies .rdfs:Resource label}
54
+ Validates every [prov:Person] {+prov:Person ?sh:targetClass} in this project to have an [email] {+#email ?sh:property sh:name} and a [role] {+#role ?sh:property sh:name}.
71
55
 
72
- The project depends on:
73
- - [Design System] {+proj:design-system ?proj:requires}
74
- - [API Documentation] {+proj:api-docs ?proj:requires}
56
+ #### Email is required {=#email .sh:PropertyShape sh:message}
57
+ [proj:email] {+proj:email ?sh:path} must appear exactly [1] {sh:minCount sh:maxCount ^^xsd:integer} time and match the pattern [^.+@.+$] {sh:pattern}.
75
58
 
76
- ### Stakeholders {=proj:stakeholders .rdfs:Resource label}
59
+ #### Role is required {=#role .sh:PropertyShape sh:message}
60
+ [proj:role] {+proj:role ?sh:path} must appear at least [1] {sh:minCount ^^xsd:integer} time.
77
61
 
78
- Key stakeholders:
79
- - [Marketing Department] {+proj:marketing ?proj:stakeholder .prov:Organization}
80
- - [Customer Support] {+proj:support ?proj:stakeholder .prov:Organization}
62
+ ### Deliverable Shape {=proj:DeliverableShape .sh:NodeShape label}
81
63
 
82
- ## Delegation Pattern
64
+ Validates every [prov:Entity] {+prov:Entity ?sh:targetClass} produced by a project activity to have a [label] {+#dlabel ?sh:property sh:name} and a [wasGeneratedBy] {+#generated ?sh:property sh:name} link.
83
65
 
84
- ### Development Delegation {=proj:dev-delegation .prov:Delegation ?prov:qualifiedDelegation}
66
+ #### Label is required {=#dlabel .sh:PropertyShape sh:message}
67
+ Every deliverable must have exactly [1] {sh:minCount sh:maxCount ^^xsd:integer} [rdfs:label] {+rdfs:label ?sh:path}.
85
68
 
86
- Alice delegates frontend development to specialized team.
69
+ #### Generation link is required {=#generated .sh:PropertyShape sh:message}
70
+ Every deliverable must trace back to at least [1] {sh:minCount ^^xsd:integer} [prov:wasGeneratedBy] {+prov:wasGeneratedBy ?sh:path} activity.
87
71
 
88
- Delegate: [Alice] {+proj:alice ?prov:delegate}
89
- Responsible: [Frontend Team] {+proj:frontend-team .prov:Organization ?prov:responsible}
90
- Activity: [Frontend Development] {+proj:frontend-dev .prov:Activity ?prov:hadActivity}
91
- Role: [Development Lead] {+proj:dev-lead .prov:Role ?prov:hadRole}
72
+ ## Project Is On Schedule {=proj:stmt-schedule .rdf:Statement .prov:Entity label}
92
73
 
93
- This demonstrates:
94
- - Complete PROV-O provenance chains
95
- - Project lifecycle with phases
96
- - Team formation and delegation
97
- - Proper temporal properties
98
- - Cross-ontology integration
74
+ **The working prototype** {+proj:prototype ?rdf:subject} *was delivered by* {+proj:deliveredBy ?rdf:predicate} **2026-07-30, within the original timeline** {+proj:original-timeline ?rdf:object}.
75
+ Generated by: [Development Phase] {+proj:dev-phase ?prov:wasGeneratedBy}
76
+ Derived from: [Design Documentation] {+proj:design-docs ?prov:wasDerivedFrom}
77
+ Established: [2026-07-30T00:00:00Z] {prov:generatedAtTime ^^xsd:dateTime}
78
+
79
+ ## Design System Adopted as Foundation {=proj:stmt-design-system .rdf:Statement .prov:Entity label}
80
+
81
+ **The design documentation** {+proj:design-docs ?rdf:subject} *was derived from* {+prov:wasDerivedFrom ?rdf:predicate} **the existing design system** {+proj:design-system ?rdf:object}.
82
+ Generated by: [Design Phase] {+proj:design-phase ?prov:wasGeneratedBy}
83
+ Derived from: [Team Formation] {+proj:team-formation ?prov:wasDerivedFrom}
84
+ Established: [2026-06-15T00:00:00Z] {prov:generatedAtTime ^^xsd:dateTime}
@@ -1,95 +1,50 @@
1
1
  [food] <tag:alice@example.com,2026:food/>
2
2
  [schema] <http://schema.org/>
3
3
 
4
- # Grandma's Apple Pie {=food:apple-pie .schema:Recipe prov:Entity label}
4
+ # Grandma's Apple Pie {=food:apple-pie .schema:Recipe .prov:Entity label}
5
5
 
6
- Traditional family recipe passed down through generations.
6
+ > Delicious apple pie as gradma used to make it autumn. {comment}
7
7
 
8
- Cuisine: [American] {food:cuisine}
9
- Prep time: [45] {food:prepTime ^^xsd:integer} minutes
10
- Cook time: [60] {food:cookTime ^^xsd:integer} minutes
11
- Servings: [8] {food:servings ^^xsd:integer}
12
- Difficulty: [Medium] {food:difficulty}
8
+ This is a [American] {food:cuisine} family recipe that Grandma Rose has been making since the 1960s. It takes about [45] {food:prepTime ^^xsd:integer} minutes to prepare and [55] {food:cookTime ^^xsd:integer} minutes to bake, making [8] {food:servings ^^xsd:integer} generous slices. It's a variation of [Classic Apple Pie] {+food:classic-apple-pie .schema:Recipe ?schema:isBasedOn label} — her version adds more cinnamon and uses a butter crust rather than shortening. You might also like [Peach Pie] {+food:peach-pie .schema:Recipe ?food:similarRecipe label} or [Apple Crumble] {+food:apple-crumble .schema:Recipe ?food:similarRecipe label} if you want something in the same family.
13
9
 
14
- ## Dry Ingredients
10
+ Per serving this comes in at around [320] {food:calories ^^xsd:integer} calories, [14g] {food:fat} fat, [42g] {food:carbs} carbs, and [2g] {food:protein} protein.
15
11
 
16
- **Flour** {+food:flour .food:Ingredient ?prov:wasDerivedFrom label}
17
- **Sugar** {+food:sugar .food:Ingredient ?food:hasIngredient label}
18
- **Salt** {+food:salt .food:Ingredient ?food:hasIngredient label}
12
+ ## Ingredients
19
13
 
20
- ### Wet Ingredients
14
+ ### Crust
21
15
 
22
- **Butter** {+food:butter .food:Ingredient ?food:hasIngredient label}
23
- **Eggs** {+food:eggs .food:Ingredient ?food:hasIngredient label}
24
- **Vanilla** {+food:vanilla .food:Ingredient ?food:hasIngredient label}
16
+ **Flour** {=food:flour}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *includes* {=#flour ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [2.5] {food:amount ^^xsd:decimal} [cups] {+food:cup ?food:unit} of *flour* {+food:flour ?prov:entity}.
25
17
 
26
- ### Filling Ingredients
18
+ **Butter** {=food:butter}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *includes* {=#butter ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [1] {food:amount ^^xsd:decimal} [cup] {+food:cup ?food:unit} of *cold* {food:temperature} *butter* {+food:butter ?prov:entity}.
27
19
 
28
- **Apples** {+food:apples .food:Ingredient ?food:hasIngredient label}
29
- **Cinnamon** {+food:cinnamon .food:Ingredient ?food:hasIngredient label}
30
- **Lemon Juice** {+food:lemon-juice .food:Ingredient ?food:hasIngredient label}
20
+ **Eggs** {=food:salt}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is made with* {=#eggs ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [2] {food:amount ^^xsd:integer} *eggs* {+food:egg ?prov:entity}.
31
21
 
32
- ## Preparation Steps {=food:preparation .prov:Activity label}
22
+ **Sugar** {=food:sugar}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is made with* {=#sugar ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [1] {food:amount ^^xsd:decimal} [cup] {+food:cup ?food:unit} of *butter* {+food:sugar ?prov:entity}.
33
23
 
34
- ### Step 1: Crust {=food:step-crust .prov:Activity label}
24
+ **Salt** {=food:salt}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is made with* {=#salt ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [0.5] {food:amount ^^xsd:decimal} [tsp] {+food:tsp ?food:unit} of *salt* {+food:salt ?prov:entity}.
35
25
 
36
- Mixed dry ingredients: [flour] {+food:flour ?prov:used}, [sugar] {+food:sugar ?prov:used}, [salt] {+food:salt ?prov:used}. Cut in [cold butter] {+food:butter ?prov:used} until mixture resembles [coarse crumbs] {food:texture}. Form into [pie dish] {+food:pie-dish ?prov:used}.
26
+ **Vanilla** {=food:vanilla}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is made with* {=#vanilla ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [1] {food:amount ^^xsd:decimal} [tsp] {+food:tsp ?food:unit} of *vanilla* {+food:vanilla ?prov:entity}.
37
27
 
38
- ### Step 2: Filling {=food:step-filling .prov:Activity label}
28
+ ### Filling
39
29
 
40
- Toss [apples] {+food:apples ?prov:used} with [cinnamon] {+food:cinnamon ?prov:used} and [lemon juice] {+food:lemon-juice ?prov:used}. Let sit for [10] {food:restTime ^^xsd:integer} minutes.
30
+ **Apples** {=food:apples}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *includes* {=#apples ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [6] {food:amount ^^xsd:integer} medium *apples* {+food:apple ?prov:entity}, peeled and sliced.
41
31
 
42
- ### Step 3: Assembly {=food:step-assembly .prov:Activity label}
32
+ **Cinnamon** {=food:cinnamon}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is seasoned with* {=#cinnamon ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [2] {food:amount ^^xsd:integer} [tsp] {+food:tsp ?food:unit} ground *cinnamon* {+food:cinnamon ?prov:entity}.
43
33
 
44
- Add filling to crust. Cover with [top crust] {+food:top-crust .food:Ingredient ?prov:used}. Cut [vent holes] {+food:vents .food:Technique ?prov:used}.
34
+ **Lemon Juice** {=food:lemon-juice}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is seasoned with* {=#lemon-juice ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [1] {food:amount ^^xsd:integer} [tbsp] {+food:tbsp ?food:unit} *lemon juice* {+food:lemon-juice ?prov:entity}.
45
35
 
46
- ### Step 4: Baking {=food:step-baking .prov:Activity label}
36
+ ## Making the Crust {=#step-crust .prov:Activity label}
47
37
 
48
- Bake at [375°F] {food:bakeTemp ^^xsd:integer} for [45-55] {food:bakeTime ^^xsd:integer} minutes until [golden brown] {food:color} and [bubbly] {food:texture}.
38
+ Mix [flour] {+#flour ?prov:qualifiedUsage}, [sugar] {+#sugar ?prov:qualifiedUsage}, and [salt] {+#salt ?prov:qualifiedUsage} together, then cut in [cold butter] {+#butter ?prov:qualifiedUsage} until the mixture looks like coarse crumbs. Press into your [pie dish] {+food:pie-dish .food:Equipment ?prov:used label} and set aside. This produces the [unbaked crust] {+#unbaked-crust .prov:Entity ?prov:generated label}.
49
39
 
50
- ## Recipe Relationships
40
+ ## Making the Filling {=#step-filling .prov:Activity ?prov:wasInformedBy label}
51
41
 
52
- ### Variation {=food:variation .prov:Entity label}
42
+ Toss [apples] {+#apples ?prov:qualifiedUsage} with [cinnamon] {+#cinnamon ?prov:qualifiedUsage} and [lemon juice] {+#lemon-juice ?prov:qualifiedUsage}. Let it sit for [10] {food:restTime ^^xsd:integer} minutes so the flavours start to meld — you'll see some juice pool at the bottom, that's what makes it bubbly in the oven. This gives you the [spiced filling] {+#spiced-filling .prov:Entity ?prov:generated label}.
53
43
 
54
- This recipe is a variation of [Classic Apple Pie] {+food:classic-apple-pie .schema:Recipe ?food:variationOf}.
44
+ ## Assembly and Baking {=#step-baking .prov:Activity ?prov:wasInformedBy label}
55
45
 
56
- Also related: [Peach Pie] {+food:peach-pie .schema:Recipe ?food:similarRecipe} and [Apple Crumble] {+food:apple-crumble .schema:Recipe ?food:similarRecipe}.
46
+ Spoon the [spiced filling] {+#spiced-filling ?prov:used} into the [unbaked crust] {+#unbaked-crust ?prov:used}, cover with a [top crust] {+#top-crust ?prov:used label}, and cut a few vent holes so steam can escape. Bake at [375] {food:bakeTempF ^^xsd:integer}°F for [50] {food:bakeTimeMin ^^xsd:integer} minutes until [golden brown] {food:color}. This produces the [finished pie] {+#finished-pie .prov:Entity ?prov:generated label}.
57
47
 
58
- ## Nutrition Information {=food:nutrition .prov:Entity label}
48
+ ## How This Recipe Came to Be {=#creation .prov:Activity ?prov:wasInformedBy label}
59
49
 
60
- Per serving:
61
- - Calories: [320] {food:calories ^^xsd:integer}
62
- - Fat: [14g] {food:fat ^^xsd:string}
63
- - Carbohydrates: [42g] {food:carbs ^^xsd:string}
64
- - Protein: [2g] {food:protein ^^xsd:string}
65
-
66
- ## Provenance
67
-
68
- ### Recipe Creation {=food:creation .prov:Activity label}
69
-
70
- Created by: [Grandma Rose] {+food:grandma-rose .prov:Person ?prov:wasAssociatedWith}
71
- Documented by: [Alice] {+food:alice .prov:Person ?prov:wasAssociatedWith}
72
- Date: [2026-05-06] {prov:startedAtTime ^^xsd:date}
73
- Used: [Family Recipe Book] {+food:recipe-book ?prov:used}
74
-
75
- Generated: [Recipe Documentation] {+food:recipe-docs ?prov:generated}.
76
-
77
- This demonstrates:
78
- - Schema.org Recipe vocabulary
79
- - Complex ingredient relationships
80
- - Multi-step process with provenance
81
- - Nutritional information
82
- - Recipe variations and relationships
83
-
84
-
85
-
86
- - [2.5] {food:amount ^^xsd:decimal} cups
87
- - [1] {food:amount ^^xsd:decimal} cup
88
- - [0.5] {food:amount ^^xsd:decimal} tsp
89
- - [1] {food:amount ^^xsd:decimal} cup, cold
90
- - [2] {food:amount ^^xsd:integer} large
91
- - [1] {food:amount ^^xsd:decimal} tsp
92
-
93
- - [6] {food:amount ^^xsd:integer} medium, peeled, sliced
94
- - [2] {food:amount ^^xsd:integer} tsp ground
95
- - [1] {food:amount ^^xsd:integer} tbsp
50
+ [Grandma Rose] {+food:grandma-rose .prov:Person ?prov:wasAssociatedWith label} developed this version over many years, working from the [Family Recipe Book] {+food:recipe-book .prov:Entity ?prov:used label} she brought from her childhood home. [Alice] {+food:alice .prov:Person ?prov:wasAssociatedWith label} wrote it down on [2026-05-06] {prov:endedAtTime ^^xsd:date} to make sure it wouldn't be lost, producing this [recipe documentation] {+#recipe-docs .prov:Entity ?prov:generated label}.