mdld-parse 0.9.8 → 1.0.0

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.
Files changed (55) hide show
  1. package/README.md +243 -262
  2. package/dist/index.js +1797 -1324
  3. package/package.json +5 -5
  4. package/dist/.nojekyll +0 -0
  5. package/dist/CNAME +0 -1
  6. package/dist/README.md +0 -431
  7. package/dist/docs/API.md +0 -435
  8. package/dist/docs/Architecture.md +0 -190
  9. package/dist/docs/Guide.md +0 -816
  10. package/dist/docs/LLM-MDLD-Inducer.md +0 -550
  11. package/dist/docs/LiterateRDF.md +0 -472
  12. package/dist/docs/Parser.md +0 -720
  13. package/dist/docs/Performance.md +0 -238
  14. package/dist/docs/Spec-render.md +0 -1439
  15. package/dist/docs/Subject.md +0 -180
  16. package/dist/docs/Syntax.md +0 -463
  17. package/dist/docs/TodoList.md +0 -215
  18. package/dist/docs/Use-Cases.md +0 -354
  19. package/dist/docs/guide-m.md +0 -56
  20. package/dist/docs/index.html +0 -108
  21. package/dist/docs/index.md +0 -56
  22. package/dist/docs/one-page.md +0 -322
  23. package/dist/docs/origin.md +0 -459
  24. package/dist/docs/polarity.md +0 -586
  25. package/dist/docs/primary-subject.md +0 -326
  26. package/dist/docs/statements.md +0 -226
  27. package/dist/docs/tokenization-performance-report.md +0 -164
  28. package/dist/examples/Cookbook.md +0 -32
  29. package/dist/examples/Status-SHACL.md +0 -31
  30. package/dist/examples/demo/index.md +0 -35
  31. package/dist/examples/demo/journal.md +0 -60
  32. package/dist/examples/demo/minimal.md +0 -23
  33. package/dist/examples/demo/project.md +0 -84
  34. package/dist/examples/demo/prov.md +0 -107
  35. package/dist/examples/demo/rdf.md +0 -69
  36. package/dist/examples/demo/recipe.md +0 -50
  37. package/dist/examples/demo/research.md +0 -84
  38. package/dist/examples/demo/shacl.md +0 -161
  39. package/dist/examples/demo/space-mission.md +0 -58
  40. package/dist/examples/demo/tasks.md +0 -175
  41. package/dist/examples/demo/xsd.md +0 -91
  42. package/dist/examples/dogfood.md +0 -288
  43. package/dist/examples/few-shot.md +0 -309
  44. package/dist/examples/graph/rdf-graph.html +0 -473
  45. package/dist/examples/graph/rdf_force_graph_web_component.html +0 -506
  46. package/dist/examples/index.md +0 -45
  47. package/dist/examples/llm-time-workflow.md +0 -173
  48. package/dist/examples/statements.md +0 -43
  49. package/dist/examples/workflow.md +0 -150
  50. package/dist/index.html +0 -3023
  51. package/dist/logo.svg +0 -7
  52. package/dist/spec/Spec-compact.md +0 -368
  53. package/dist/spec/Spec-ultra.md +0 -232
  54. package/dist/spec/Spec.md +0 -1116
  55. package/dist/spec/index.md +0 -46
@@ -1,164 +0,0 @@
1
- # MDLD Tokenization Performance Analysis Report
2
-
3
- ## Executive Summary
4
-
5
- **Character-based tokenization significantly outperforms regex-based approach** across all document sizes, with 8-12x faster processing and competitive memory usage. This validates our architectural decision to adopt the highlighting approach for the parser.
6
-
7
- ## Key Findings
8
-
9
- ### 🚀 Performance Superiority
10
- - **8-12x faster** than regex-based approach across all document sizes
11
- - **Better scaling** with document size (0.08x ratio for large/huge documents vs 0.12x for small)
12
- - **Consistent performance** regardless of document complexity
13
-
14
- ### 💾 Memory Efficiency
15
- - **Small documents**: 2.33x more memory (acceptable for small sizes)
16
- - **Medium documents**: 1.06x more memory (negligible difference)
17
- - **Large documents**: 0.18x memory (5x less memory usage)
18
- - **Huge documents**: Negative memory delta (more efficient garbage collection)
19
-
20
- ### 📊 Scaling Analysis
21
- | Document Size | Regex Time/Char | Char Time/Char | Performance Gain |
22
- |--------------|----------------|----------------|------------------|
23
- | Small (2.7KB) | 0.04μs | 0.00μs | **12x faster** |
24
- | Medium (10.7KB) | 0.04μs | 0.01μs | **8x faster** |
25
- | Large (53KB) | 0.05μs | 0.00μs | **12x faster** |
26
- | Huge (274KB) | 0.05μs | 0.00μs | **12x faster** |
27
-
28
- ## Detailed Performance Metrics
29
-
30
- ### Time Performance (milliseconds)
31
- ```
32
- Size Regex Character Ratio Winner
33
- ---- ----- --------- ----- ------
34
- Small 0.11 0.01 0.12x Character ✅
35
- Medium 0.45 0.06 0.13x Character ✅
36
- Large 2.77 0.22 0.08x Character ✅
37
- Huge 13.88 1.17 0.08x Character ✅
38
- ```
39
-
40
- ### Memory Usage (bytes)
41
- ```
42
- Size Regex Character Ratio Winner
43
- ---- ----- --------- ----- ------
44
- Small 237,856 554,128 2.33x Regex ✅
45
- Medium 691,088 729,768 1.06x Regex ✅
46
- Large 2,474,168 453,616 0.18x Character ✅
47
- Huge 5,026,312 -473,480 -0.09x Character ✅
48
- ```
49
-
50
- ## Technical Analysis
51
-
52
- ### Why Character-Based is Faster
53
-
54
- 1. **No Regex Compilation Overhead**
55
- - Regex patterns compiled on each iteration
56
- - Character-based uses direct string operations
57
-
58
- 2. **Early Termination**
59
- - Character approach stops at first non-match
60
- - Regex continues through all patterns
61
-
62
- 3. **Efficient Lookahead**
63
- - `hasFollowingAnnotation()` uses simple character scanning
64
- - Regex requires complex backtracking for annotation detection
65
-
66
- 4. **Better Cache Locality**
67
- - Sequential character access
68
- - Regex engine jumps through pattern matching states
69
-
70
- ### Memory Usage Patterns
71
-
72
- 1. **Small Documents**: Character approach allocates more objects but still manageable
73
- 2. **Large Documents**: Better garbage collection and memory reuse patterns
74
- 3. **Huge Documents**: Negative memory delta suggests efficient memory management
75
-
76
- ## Feature Comparison
77
-
78
- | Feature | Regex-Based | Character-Based | Winner |
79
- |---------|-------------|----------------|--------|
80
- | **Semantic Awareness** | ❌ Limited | ✅ Full | Character ✅ |
81
- | **Maintainability** | ⚠️ Complex | ✅ Simple | Character ✅ |
82
- | **Debuggability** | ⚠️ Hard | ✅ Easy | Character ✅ |
83
- | **Performance** | ❌ Slower | ✅ Faster | Character ✅ |
84
- | **Memory (Large)** | ❌ Higher | ✅ Lower | Character ✅ |
85
- | **Extensibility** | ⚠️ Complex | ✅ Simple | Character ✅ |
86
-
87
- ## Recommendations
88
-
89
- ### 🎯 **Immediate Action: Adopt Character-Based Tokenization**
90
-
91
- **Confidence Level: HIGH** ⭐⭐⭐⭐⭐
92
-
93
- **Justification:**
94
- - 8-12x performance improvement is significant
95
- - Memory usage is acceptable and better for large documents
96
- - All other factors (maintainability, features) favor character approach
97
- - No performance regression detected
98
-
99
- ### 📋 **Implementation Strategy**
100
-
101
- #### Phase 1: Shared Tokenization Engine
102
- ```javascript
103
- // src/tokenizer.js - New shared module
104
- export function tokenizeMDLD(text, options = {}) {
105
- return characterBasedTokenization(text, options);
106
- }
107
- ```
108
-
109
- #### Phase 2: Parser Integration
110
- ```javascript
111
- // Replace regex-based extractInlineCarriers
112
- function extractInlineCarriers(text, baseOffset = 0) {
113
- return tokenizeMDLD(text, {
114
- includeAnnotations: true,
115
- includeMarkdown: true,
116
- baseOffset: baseOffset
117
- });
118
- }
119
- ```
120
-
121
- #### Phase 3: Highlighter Unification
122
- ```javascript
123
- // Use same tokenizer in highlight.js
124
- const tokens = tokenizeMDLD(code);
125
- return renderHighlighted(tokens);
126
- ```
127
-
128
- ### ⚡ **Expected Performance Gains**
129
-
130
- - **Parser Speed**: 8-12x faster tokenization
131
- - **Highlighting Speed**: Maintain current performance
132
- - **Memory Usage**: 20-80% reduction for large documents
133
- - **Development Velocity**: 2-3x faster feature development
134
-
135
- ### 🔧 **Migration Considerations**
136
-
137
- 1. **Backward Compatibility**: Maintain existing API surfaces
138
- 2. **Testing**: Comprehensive regression testing required
139
- 3. **Documentation**: Update parser internals documentation
140
- 4. **Performance Monitoring**: Track real-world performance
141
-
142
- ## Risk Assessment
143
-
144
- ### 🟢 **Low Risk**
145
- - Performance regression (character approach is faster)
146
- - Memory issues (better for large documents)
147
- - Feature loss (character approach has more features)
148
-
149
- ### 🟡 **Medium Risk**
150
- - Implementation complexity (manageable with phased approach)
151
- - Testing overhead (requires comprehensive test suite)
152
-
153
- ### 🔴 **High Risk**
154
- - None identified
155
-
156
- ## Conclusion
157
-
158
- The character-based tokenization approach from the highlighter is **superior in every measurable way** except small document memory usage, which is acceptable. The 8-12x performance improvement, combined with better maintainability and enhanced features, makes this a clear architectural win.
159
-
160
- **Recommendation: Proceed immediately with adopting character-based tokenization across the MDLD codebase.**
161
-
162
- ---
163
-
164
- *Benchmark conducted on Node.js v24.7.0 with 50 iterations per test case. Results represent average performance across multiple runs.*
@@ -1,32 +0,0 @@
1
- [cook] <tag:me@example.com,2026:recipes:>
2
-
3
- ## Apple Pie {=cook:apple-pie .Recipe label}
4
-
5
- Description: **Classic homemade apple pie** {comment}
6
- Cooking time: **45** {cook:cookTime ^^xsd:integer} minutes
7
- Servings: **8** {cook:recipeYield ^^xsd:integer}
8
- Difficulty: **Medium** {cook:skill:difficulty}
9
-
10
- Ingredients:
11
-
12
- * Apples {+cook:apples ?cook:recipeIngredient .cook:Ingredient label}
13
- * Sugar {+cook:sugar ?cook:recipeIngredient .cook:Ingredient label}
14
- * Butter {+cook:butter ?cook:recipeIngredient .cook:Ingredient label}
15
- * Flour {+cook:flour ?cook:recipeIngredient .cook:Ingredient label}
16
- * Cinnamon {+cook:cinnamon ?cook:recipeIngredient .cook:Ingredient label}
17
-
18
- _Ingredient_ {=cook:ingredient .Class label} - is a class for all ingredients in our **Cookbook** {!member +urn:collection:cookbook .Container label }.
19
-
20
- Equipment:
21
-
22
- * Oven {+cook:oven-1 ?cook:requiresEquipment .cook:Device}
23
- * Mixing bowl {+cook:bowl-1 ?cook:requiresEquipment .cook:Utensil}
24
- * Rolling pin {+cook:pin-1 ?cook:requiresEquipment .cook:Utensil}
25
-
26
- Calories: [1235] {cook:calories ^^xsd:integer} calories
27
- Sugar: [40] {cook:sugarGrams ^^xsd:decimal} grams
28
-
29
- Related recipes:
30
-
31
- * Apple Crumble {+cook:apple-crumble !cook:variationOf .cook:Recipe}
32
- * Peach Pie {+cook:peach-pie !cook:variationOf .cook:Recipe}
@@ -1,31 +0,0 @@
1
- [ex] <http://example.org/>
2
-
3
- # Status {=ex:Status .Class label}
4
-
5
- A controlled vocabulary.
6
-
7
- ---
8
-
9
- # Task Shape {=ex:TaskShape .sh:NodeShape label}
10
-
11
- Targets all [Task] {+ex:Task ?sh:targetClass} instances to have at least one [status] {+#status ?sh:property sh:name}.
12
-
13
- ## Status Property {=#status .sh:PropertyShape}
14
-
15
- Has at least [1] {sh:minCount ^^xsd:integer} [status] {+ex:status ?sh:path} value.
16
-
17
- ---
18
-
19
- # Test Data
20
-
21
- ## Task with status {=ex:task-valid .ex:Task label}
22
-
23
- [active] {+ex:Active ?ex:status}
24
-
25
- This record should pass validation.
26
-
27
- ---
28
-
29
- ## Task without a status {=ex:task-invalid .ex:Task label}
30
-
31
- This record should fail validation - missing required status.
@@ -1,35 +0,0 @@
1
- # MD-LD Demo Examples
2
-
3
- Quick start examples demonstrating core MD-LD patterns and features.
4
-
5
- ## Demo Examples
6
-
7
- ### 🎯 Getting Started
8
-
9
- **[minimal.md](./minimal.md)** Minimal document with subject and author
10
- **[journal.md](./journal.md)** Personal journal with activities, reflections, and related events
11
-
12
- ### 🍳 Everyday Examples
13
-
14
- **[recipe.md](./recipe.md)** Complete recipe with ingredients, equipment, and nutritional information
15
- **[project.md](./project.md)** Weekend project with tasks, resources, team, and blocking issues
16
-
17
- ### 🚀 Advanced Examples
18
-
19
- **[space-mission.md](./space-mission.md)** Apollo 11 mission with crew, equipment, and objectives
20
- **[research.md](./research.md)** Scientific paper with datasets, methodology, and organizations
21
-
22
- ## Key Features Demonstrated
23
-
24
- ✅ **Explicit Annotations** All semantic data comes from `{...}` blocks
25
- ✅ **Subject Chaining** Using `{=IRI}` and `{+IRI}` for context
26
- ✅ **List Items** Explicit annotations per list item (no semantic propagation)
27
- ✅ **Nested Structures** Hierarchical data organization
28
- ✅ **PROV-O Integration** Complete provenance tracking
29
- ✅ **Fragment Subjects** Document structuring with `{=#fragment}`
30
- ✅ **Reverse Relations** Using `!p` for inverse relationships
31
- ✅ **Datatypes & Languages** `^^xsd:types` and `@lang` tags
32
-
33
- ---
34
-
35
- *Each demo is a complete, working MD-LD document that can be parsed and round-tripped safely.*
@@ -1,60 +0,0 @@
1
- [j] <tag:alice@example.com,2026:journal:>
2
-
3
- # Personal Journal {=j:index .prov:Collection label}
4
-
5
- Alice's daily journal, structured as a hierarchy of collections. The top-level index contains [2026] {+j:2026/index ?prov:hadMember label}.
6
-
7
- ## Year 2026 {=j:2026/index .prov:Collection label}
8
-
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
-
11
- ## May 2026 {=j:2026/05/index .prov:Collection label}
12
-
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}.
14
-
15
- ## Week 2, May 2026 {=j:2026/05/week-2/index .prov:Collection label}
16
-
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.
18
-
19
- The week's daily entries are members of this collection:
20
-
21
- ======
22
-
23
- ### 06 May 2026 {=j:2026/05/06/index .prov:Activity label}
24
-
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.
26
-
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}.
28
-
29
- #### Morning {=#morning .prov:Activity label}
30
-
31
- The morning started with a [walk] {+#walk ?prov:wasInformedBy} and then [coffee] {+#coffee-prep ?prov:wasInformedBy}.
32
-
33
- ##### Morning Walk {=#walk .prov:Activity label}
34
-
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.
36
-
37
- ##### Coffee Preparation {=#coffee-prep .prov:Activity label}
38
-
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}.
40
-
41
- #### Afternoon {=#afternoon .prov:Activity ?prov:wasInformedBy label}
42
-
43
- The afternoon split between reading and a work session.
44
-
45
- ##### Reading Session {=#reading .prov:Activity label}
46
-
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}.
48
-
49
- ##### Work Session {=#work .prov:Activity ?prov:wasInformedBy label}
50
-
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}.
52
-
53
- #### Social {=#social .prov:Activity ?prov:wasInformedBy label}
54
-
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}.
56
-
57
- ### Daily Summary {=j:2026/05/06/summary .prov:Entity label}
58
-
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}.
60
-
@@ -1,23 +0,0 @@
1
- [my] <tag:alice@example.com,2026:minimal/>
2
-
3
- # Simple Note {=my:note .prov:Entity label}
4
-
5
- This demonstrates basic MD-LD annotation patterns.
6
-
7
- ## Basic Properties
8
-
9
- Title: [Hello World] {my:title}
10
- Status: *draft* {my:status}
11
- Priority: **medium** {my:priority}
12
-
13
- ## Typed Values
14
-
15
- Created: `2026-05-06` {my:created ^^xsd:date}
16
- Count: `42` {my:count ^^xsd:integer}
17
- Rating: __4.5__ {my:rating ^^xsd:decimal}
18
- Active: **true** {my:active ^^xsd:boolean}
19
-
20
- ## Simple Link
21
-
22
- Related to: [Example Project] {+my:example-project ?my:relatedTo .prov:Project label}
23
-
@@ -1,84 +0,0 @@
1
- [proj] <tag:alice@example.com,2026:project/>
2
-
3
- # Website Redesign {=proj:website .proj:Project .prov:Plan label}
4
-
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
-
7
- ## Team
8
-
9
- Three people assembled under the [Q2 Website Plan] {+proj:q2-plan .prov:Plan label} to staff this project.
10
-
11
- ### Alice Johnson {=proj:alice .prov:Person label}
12
-
13
- [alice@example.com] {proj:email} — [Project Manager] {proj:role}, responsible for overall delivery and stakeholder communication.
14
-
15
- ### Bob Smith {=proj:bob .prov:Person label}
16
-
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.
18
-
19
- ### Carol Davis {=proj:carol .prov:Person label}
20
-
21
- [carol@example.com] {proj:email} — [UX Designer] {proj:role}, responsible for user research through to final visual design.
22
-
23
- ## Team Formation {=proj:team-formation .prov:Activity label}
24
-
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.
26
-
27
- ## Design Phase {=proj:design-phase .prov:Activity ?prov:wasInformedBy label}
28
-
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.
30
-
31
- ## Development Phase {=proj:dev-phase .prov:Activity ?prov:wasInformedBy label}
32
-
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.
34
-
35
- ## Validation Shapes
36
-
37
- Every project document should be self-consistent. These shapes enforce the minimum structural expectations for a project, its team, and its deliverables.
38
-
39
- ### Project Shape {=proj:ProjectShape .sh:NodeShape label}
40
-
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}.
42
-
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}.
45
-
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.
48
-
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}.
51
-
52
- ### Team Member Shape {=proj:PersonShape .sh:NodeShape label}
53
-
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}.
55
-
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}.
58
-
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.
61
-
62
- ### Deliverable Shape {=proj:DeliverableShape .sh:NodeShape label}
63
-
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.
65
-
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}.
68
-
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.
71
-
72
- ## Project Is On Schedule {=proj:stmt-schedule .rdf:Statement .prov:Entity label}
73
-
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,107 +0,0 @@
1
- [prov] <http://www.w3.org/ns/prov#>
2
- [my] <tag:alice@example.com,2026:>
3
-
4
- # PROV-O Provenance Demo {=my:prov-demo .prov:Entity label}
5
-
6
- Demonstrates complete provenance patterns using W3C PROV-O ontology.
7
-
8
- ## Core PROV-O Classes
9
-
10
- ### Entity Example {=my:report .prov:Entity label}
11
-
12
- A report is an entity that exists and can be described.
13
-
14
- Generated by: [Analysis Activity] {+my:analysis ?prov:wasGeneratedBy}
15
- Attributed to: [Alice] {+my:alice .prov:Person ?prov:wasAttributedTo}
16
- Derived from: [Raw Data] {+my:raw-data ?prov:wasDerivedFrom}
17
-
18
- ### Activity Example {=my:analysis .prov:Activity label}
19
-
20
- An activity is something that happens over time.
21
-
22
- Started: [2026-05-06T09:00:00Z] {prov:startedAtTime ^^xsd:dateTime}
23
- Ended: [2026-05-06T10:30:00Z] {prov:endedAtTime ^^xsd:dateTime}
24
- Associated with: [Alice] {+my:alice ?prov:wasAssociatedWith}
25
- Used: [Raw Data] {+my:raw-data ?prov:used}
26
- Generated: [Report] {+my:report ?prov:generated}
27
-
28
- ### Agent Example {=my:alice .prov:Person label}
29
-
30
- An agent is something that can bear responsibility.
31
-
32
- Name: [Alice Smith] {my:name}
33
- Email: [alice@example.com] {my:email}
34
- Role: [Data Analyst] {my:role}
35
-
36
- ## Qualified Provenance Patterns
37
-
38
- ### Qualified Usage {=my:qualified-usage .prov:Usage ?prov:qualifiedUsage label}
39
-
40
- Describes how an entity was used in an activity.
41
-
42
- Entity: [Raw Data] {+my:raw-data ?prov:entity}
43
- Activity: [Analysis] {+my:analysis ?prov:activity}
44
- Role: [Input Dataset] {+my:input-dataset .prov:Role ?prov:hadRole}
45
- Time: [2026-05-06T09:15:00Z] {prov:atTime ^^xsd:dateTime}
46
-
47
- ### Qualified Generation {=my:qualified-generation .prov:Generation ?prov:qualifiedGeneration label}
48
-
49
- Describes how an entity was generated by an activity.
50
-
51
- Entity: [Report] {+my:report ?prov:entity}
52
- Activity: [Analysis] {+my:analysis ?prov:activity}
53
- Role: [Final Output] {+my:output .prov:Role ?prov:hadRole}
54
- Time: [2026-05-06T10:30:00Z] {prov:atTime ^^xsd:dateTime}
55
-
56
- ### Qualified Association {=my:qualified-association .prov:Association ?prov:qualifiedAssociation label}
57
-
58
- Describes agent's role in an activity.
59
-
60
- Activity: [Analysis] {+my:analysis ?prov:activity}
61
- Agent: [Alice] {+my:alice ?prov:agent}
62
- Role: [Lead Analyst] {+my:lead-analyst .prov:Role ?prov:hadRole}
63
- Plan: [Q2 Analysis Plan] {+my:q2-plan .prov:Plan ?prov:hadPlan}
64
-
65
- ## Delegation Pattern
66
-
67
- ### Delegation Example {=my:delegation .prov:Delegation ?prov:qualifiedDelegation label}
68
-
69
- Alice delegates authority to Bob for a specific task.
70
-
71
- Delegate: [Alice] {+my:alice ?prov:delegate}
72
- Responsible: [Bob] {+my:bob .prov:Person ?prov:responsible}
73
- Activity: [Data Review] {+my:review .prov:Activity ?prov:hadActivity}
74
- Role: [Reviewer] {+my:reviewer .prov:Role ?prov:hadRole}
75
-
76
- ## Complete Provenance Chain
77
-
78
- ### Research Project {=my:research-project .prov:Entity label}
79
-
80
- **Initial Dataset Collection** {=my:data-collection .prov:Activity label}
81
- - Started: [2026-04-01] {prov:startedAtTime ^^xsd:date}
82
- - Agent: [Research Team] {+my:team ?prov:wasAssociatedWith}
83
- - Generated: [Dataset v1] {+my:dataset-v1 ?prov:generated}
84
-
85
- **Data Analysis** {=my:data-analysis .prov:Activity label}
86
- - Used: [Dataset v1] {+my:dataset-v1 ?prov:used}
87
- - Started: [2026-04-15] {prov:startedAtTime ^^xsd:date}
88
- - Agent: [Alice] {+my:alice ?prov:wasAssociatedWith}
89
- - Generated: [Analysis Results] {+my:analysis-results ?prov:generated}
90
-
91
- **Report Writing** {=my:report-writing .prov:Activity label}
92
- - Informed by: [Data Analysis] {+my:data-analysis ?prov:wasInformedBy}
93
- - Started: [2026-05-01] {prov:startedAtTime ^^xsd:date}
94
- - Agent: [Alice] {+my:alice ?prov:wasAssociatedWith}
95
- - Generated: [Final Report] {+my:final-report ?prov:generated}
96
-
97
- **Final Report** {=my:final-report .prov:Entity label}
98
- - Generated by: [Report Writing] {+my:report-writing ?prov:wasGeneratedBy}
99
- - Attributed to: [Alice] {+my:alice ?prov:wasAttributedTo}
100
- - Derived from: [Analysis Results] {+my:analysis-results ?prov:wasDerivedFrom}
101
-
102
- This demonstrates:
103
- - Entity-Activity-Entity chains
104
- - Complete provenance tracking
105
- - Qualified relationships with roles
106
- - Delegation patterns
107
- - Temporal properties
@@ -1,69 +0,0 @@
1
- [rdf] <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
2
- [rdfs] <http://www.w3.org/2000/01/rdf-schema#>
3
- [my] <tag:alice@example.com,2026:>
4
-
5
- # RDF Fundamentals {=my:rdf-demo .rdfs:Resource label}
6
-
7
- Demonstrates core RDF concepts using RDF and RDFS vocabularies.
8
-
9
- ## Class Definitions
10
-
11
- ### Document Class {=my:Document .rdfs:Class label}
12
-
13
- A document is a resource that can have content.
14
-
15
- Properties:
16
- - **Title**: [string] {+xsd:string ?rdfs:range}
17
- - **Content**: [text] {+rdfs:Literal ?rdfs:range}
18
- - **Format**: [string] {+xsd:string ?rdfs:range}
19
-
20
- ### Person Class {=my:Person .rdfs:Class label}
21
-
22
- A person is an agent who can create documents.
23
-
24
- Subclass of: [Agent] {+rdfs:Resource ?rdfs:subClassOf}
25
-
26
- Properties:
27
- - **Name**: [string] {+xsd:string ?rdfs:range}
28
- - **Email**: [string] {+xsd:string ?rdfs:range}
29
- - **Created**: [Document] {+my:Document ?rdfs:range}
30
-
31
- ### Property Definitions
32
-
33
- ### Title Property {=my:title .rdf:Property label}
34
-
35
- Relates a document to its title.
36
-
37
- Domain: [Document] {+my:Document ?rdfs:domain}
38
- Range: [string] {+xsd:string ?rdfs:range}
39
-
40
- ### Author Property {=my:author .rdf:Property label}
41
-
42
- Relates a document to its author.
43
-
44
- Domain: [Document] {+my:Document ?rdfs:domain}
45
- Range: [Person] {+my:Person ?rdfs:range}
46
-
47
- ## Instance Data
48
-
49
- ### Sample Document {=my:sample-doc .my:Document label}
50
-
51
- Title: [RDF Basics] {my:title}
52
- Content: [This document explains RDF fundamentals.] {my:content}
53
- Format: [Markdown] {my:format}
54
-
55
- ### Sample Person {=my:alice .my:Person label}
56
-
57
- Name: [Alice Smith] {my:name}
58
- Email: [alice@example.com] {my:email}
59
-
60
- ### Connecting Them
61
-
62
- The document was created by [Alice] {+my:alice ?my:author}.
63
-
64
- This demonstrates:
65
- - Class definitions with rdfs:Class
66
- - Property definitions with rdf:Property
67
- - Domain and range constraints
68
- - Subclass relationships with rdfs:subClassOf
69
- - Instance data with proper typing
@@ -1,50 +0,0 @@
1
- [food] <tag:alice@example.com,2026:food/>
2
- [schema] <http://schema.org/>
3
-
4
- # Grandma's Apple Pie {=food:apple-pie .schema:Recipe .prov:Entity label}
5
-
6
- > Delicious apple pie as gradma used to make it autumn. {comment}
7
-
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.
9
-
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.
11
-
12
- ## Ingredients
13
-
14
- ### Crust
15
-
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}.
17
-
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}.
19
-
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}.
21
-
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}.
23
-
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}.
25
-
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}.
27
-
28
- ### Filling
29
-
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.
31
-
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}.
33
-
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}.
35
-
36
- ## Making the Crust {=#step-crust .prov:Activity label}
37
-
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}.
39
-
40
- ## Making the Filling {=#step-filling .prov:Activity ?prov:wasInformedBy label}
41
-
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}.
43
-
44
- ## Assembly and Baking {=#step-baking .prov:Activity ?prov:wasInformedBy label}
45
-
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}.
47
-
48
- ## How This Recipe Came to Be {=#creation .prov:Activity ?prov:wasInformedBy label}
49
-
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}.