mdld-parse 0.9.9 → 1.0.1

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 +263 -326
  2. package/dist/index.js +1860 -1337
  3. package/package.json +4 -4
  4. package/dist/.nojekyll +0 -0
  5. package/dist/CNAME +0 -1
  6. package/dist/README.md +0 -500
  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 -460
  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 -58
  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 -3049
  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,173 +0,0 @@
1
- [llm] <tag:llm.time-query.example,2026:>
2
-
3
- # LLM Time Query Workflow {=llm:workflow .prov:Entity}
4
-
5
- This workflow demonstrates a complete provenance record of an LLM agent
6
- responding to a user's request for the current time.
7
-
8
- The workflow shows: user query → plan creation → time tool execution → response generation
9
-
10
- ---
11
-
12
- # User and Agent {=llm:participants .prov:Collection}
13
-
14
- ## User {=nih:sha-256-128;8eeae17830e7c428288a5d68ceb09bf4;8 .prov:Agent label}
15
-
16
- `npub1m52n4487kek65nm530varud0welv8wp5tk32wwcqltret6k8qhxqz0uxwy` {prov:value}
17
-
18
- [user] <nih:sha-256-128;8eeae17830e7c428288a5d68ceb09bf4;8>
19
-
20
- [alice@example.com] {llm:email}
21
- [End user requesting time information] {llm:role}
22
-
23
- ## LLM Agent {=llm:agent .prov:SoftwareAgent label}
24
-
25
- [1.0.0] {llm:version}
26
- [Time query processing and response generation] {llm:purpose}
27
-
28
- ## Time Tool {=llm:timeTool .prov:SoftwareAgent label}
29
-
30
- [2.1.0] {llm:version}
31
- [System time retrieval service] {llm:purpose}
32
-
33
- Session started at [2026-03-10T14:51:00Z] {prov:generatedAtTime ^^xsd:dateTime}.
34
-
35
- ---
36
-
37
- # User Request {=nih:sha-256-128;cd61bf0cc67fc2233111c91167e2abb3;a .prov:Entity label}
38
-
39
- Received at [2026-03-10T14:51:05Z] {prov:generatedAtTime ^^xsd:dateTime} from [User] {+user: ?prov:wasAttributedTo}.
40
-
41
- ~~~~~~ {prov:value}
42
- What time is it?
43
- ~~~~~~
44
-
45
- This is a signed value by a [qualified attribution] {=nih:sha-256-128;d04bcf7aef37ef6e9dbe6a0fd67b40e4;4 ?prov:qualifiedAttribution}
46
- `sig1zcmlnyrjah6498nsa2hk5tal0nuxt83kn2f4yjnmnme7ef3pef9z0uv3zha69f4f5h47p0hzzrz84nvfq95dkurqdduzg94639ledqqzu5u5g` {prov:value} by **User** {+user: ?prov:agent}
47
-
48
- ---
49
-
50
- # Time Query Plan {=nih:sha-256-128;22d992f16fe33976d65a6d83acdc95d1;3 .prov:Plan label}
51
-
52
- Created at [2026-03-10T14:51:05Z] {prov:generatedAtTime ^^xsd:dateTime} by [LLM Agent] {+llm:agent ?prov:wasAttributedTo}.
53
-
54
- Influenced by [user request] {+nih:sha-256-128;cd61bf0cc67fc2233111c91167e2abb3;a ?prov:wasInfluencedBy} and [LLM response guidelines] {+llm:responseGuidelines ?prov:wasInfluencedBy}.
55
-
56
- ~~~~~~ {prov:value}
57
- Plan: Respond to user time query
58
-
59
- Steps:
60
- 1. Parse user request for current time
61
- 2. Use time tool to get accurate system time
62
- 3. Format time response in user-friendly format
63
- 4. Generate plain text response
64
-
65
- Requirements:
66
- - Use accurate time source
67
- - Provide clear, readable response
68
- - Include timezone information
69
- - Keep response concise
70
- ~~~~~~
71
-
72
- ---
73
-
74
- # Time Tool Execution Activity {=llm:timeExecution .prov:Activity}
75
-
76
- Started at [2026-03-10T14:51:10Z] {prov:startedAtTime ^^xsd:dateTime} and completed at [2026-03-10T14:51:12Z] {prov:endedAtTime ^^xsd:dateTime}.
77
-
78
- This activity retrieves the current system time using the time tool.
79
-
80
- Uses plan
81
- [time query plan] {+nih:sha-256-128;22d992f16fe33976d65a6d83acdc95d1;3 ?prov:hadPlan}.
82
-
83
- Used [time tool] {+llm:timeTool ?prov:used} for time retrieval.
84
-
85
- Led by [LLM Agent] {+llm:agent ?prov:wasAssociatedWith}.
86
-
87
- Generated time data:
88
-
89
- ## System Time Data {=nih:sha-256-128;be55c034f00897633e7205ec7a8d69aa;4 .prov:Entity ?prov:generated label}
90
-
91
- Generated at [2026-03-10T14:51:12Z] {prov:generatedAtTime ^^xsd:dateTime}.
92
-
93
- ~~~~~~ {prov:value}
94
- {
95
- "timestamp": "2026-03-10T14:51:12.345Z",
96
- "timezone": "UTC",
97
- "formatted": "2:51 PM UTC on March 10, 2026",
98
- "unix_timestamp": 1741632672
99
- }
100
- ~~~~~~
101
-
102
- ---
103
-
104
- # Response Generation Activity {=llm:responseGeneration .prov:Activity}
105
-
106
- Started at [2026-03-10T14:51:12Z] {prov:startedAtTime ^^xsd:dateTime} and completed at [2026-03-10T14:51:15Z] {prov:endedAtTime ^^xsd:dateTime}.
107
-
108
- This activity generates the final plain text response to the user.
109
-
110
- Uses plan
111
- [time query plan] {+nih:sha-256-128;22d992f16fe33976d65a6d83acdc95d1;3 ?prov:hadPlan}.
112
-
113
- Uses time data
114
- [system time data] {+nih:sha-256-128;be55c034f00897633e7205ec7a8d69aa;4 ?prov:used}.
115
-
116
- This activity was informed by the time execution step.
117
-
118
- [time execution] {+llm:timeExecution ?prov:wasInformedBy}.
119
-
120
- Led by [LLM Agent] {+llm:agent ?prov:wasAssociatedWith} acting on behalf of [User] {+user: ?prov:actedOnBehalfOf}.
121
-
122
- Generated final response:
123
-
124
- ## Time Response {=nih:sha-256-128;53d967b34a93ab694be5f9d3840f0fd8;6 .prov:Entity ?prov:generated label}
125
-
126
- Generated at [2026-03-10T14:51:15Z] {prov:generatedAtTime ^^xsd:dateTime}.
127
-
128
- Derived from [system time data] {+nih:sha-256-128;be55c034f00897633e7205ec7a8d69aa;4 ?prov:wasDerivedFrom}.
129
-
130
- Attributed to [LLM Agent] {+llm:agent ?prov:wasAttributedTo}.
131
-
132
- ~~~~~~ {prov:value}
133
- The current time is 2:51 PM UTC on March 10, 2026.
134
- ~~~~~~
135
-
136
- ---
137
-
138
- # Workflow Artifacts {=llm:artifacts .prov:Collection}
139
-
140
- Contains all workflow outputs: {?prov:hadMember}
141
-
142
- - User Request {+nih:sha-256-128;cd61bf0cc67fc2233111c91167e2abb3;a}
143
- - Time Query Plan {+nih:sha-256-128;22d992f16fe33976d65a6d83acdc95d1;3}
144
- - System Time Data {+nih:sha-256-128;be55c034f00897633e7205ec7a8d69aa;4}
145
- - Time Response {+nih:sha-256-128;53d967b34a93ab694be5f9d3840f0fd8;6}
146
-
147
- Collection created at [2026-03-10T14:51:20Z] {prov:generatedAtTime ^^xsd:dateTime} by [LLM Agent] {+llm:agent ?prov:wasAttributedTo}.
148
-
149
- ---
150
-
151
- # Provenance Summary
152
-
153
- **Temporal Flow:**
154
- - User request: 2026-03-10T14:51:05Z
155
- - Plan creation: 2026-03-10T14:51:05Z
156
- - Time execution: 2026-03-10T14:51:10Z → 2026-03-10T14:51:12Z
157
- - Response generation: 2026-03-10T14:51:12Z → 2026-03-10T14:51:15Z
158
- - Collection: 2026-03-10T14:51:20Z
159
-
160
- **Agent Roles:**
161
- - User: Request initiator
162
- - LLM Agent: Plan creator, tool operator, response generator
163
- - Time Tool: System time provider
164
-
165
- **Entity Relationships:**
166
- - Plan influenced by user request
167
- - Time data derived from tool execution
168
- - Final response derived from time data
169
- - All artifacts organized in workflow collection
170
-
171
- This workflow provides a complete provenance record of the LLM agent's
172
- time query response process, demonstrating full traceability from user
173
- request to final response.
@@ -1,43 +0,0 @@
1
- # MD-LD Elevated Statements Examples
2
-
3
- This document demonstrates various use cases for elevated statements with PROV-O provenance tracking on level 1 and factual statements on level 2.
4
-
5
- ---
6
-
7
- ## Research Project Documentation
8
-
9
- [my] <tag:research@example.com,2026:>
10
- [foaf] <http://xmlns.com/foaf/0.1/>
11
- [ex] <http://example.org/ontology/>
12
-
13
- ### 2026-03-26T09:00:00Z {=my:research-project .prov:Activity prov:startedAtTime ^^xsd:dateTime}
14
-
15
- I am leading a **Data Analysis** {=my:research-project .prov:Activity ex:projectType} about semantic web technologies.
16
-
17
- #### Research Team {=my:team .prov:Collection}
18
-
19
- Our team includes **Dr. Sarah Chen** {+my:sarah ?member .foaf:Person foaf:name} as the principal investigator, and **Mike Johnson** {+my:mike ?member .foaf:Person foaf:name} as the research assistant.
20
-
21
- ## Project Kickoff Meeting Documented {=my:kickoff-meeting .rdf:Statement}
22
- **Dr. Chen** {+my:sarah ?rdf:subject} *led* {+prov:wasAssociatedWith ?rdf:predicate} **the kickoff meeting** {rdf:object} on March 26th.
23
-
24
- ## Team Formation Established {=my:team-formation .rdf:Statement}
25
- **Our research project** {+my:research-project ?rdf:subject} *involved* {+prov:hadMember ?rdf:predicate} **Dr. Chen** {+my:sarah ?rdf:object}
26
-
27
- ---
28
-
29
- ## Data Collection Phase
30
-
31
- ### 2026-03-26T10:30:00Z {=my:literature-review .prov:Activity prov:startedAtTime ^^xsd:dateTime}
32
-
33
- We began reviewing existing literature on **"Semantic Web"** {+my:topic .ex:ResearchTopic ex:domain}.
34
-
35
- #### Key Findings {=my:findings .prov:Entity}
36
-
37
- The literature revealed **Limited provenance tracking in current systems** {+my:gap .ex:ResearchGap ex:description} in current provenance tracking systems.
38
-
39
- ## Literature Review Completed {=my:review-completed .rdf:Statement}
40
- **Dr. Chen** {+my:sarah ?rdf:subject} *completed* {+prov:generated ?rdf:predicate} **the literature review** {+my:findings ?rdf:object}.
41
-
42
- ## Research Gap Identified {=my:gap-identified .rdf:Statement}
43
- **Our literature review** {+my:findings ?rdf:subject} *identified* {+prov:identified ?rdf:predicate} **significant research gaps** {+my:gap ?rdf:object}.
@@ -1,150 +0,0 @@
1
- [wf] <tag:mdld.workflow.example,2026:>
2
-
3
- # MDLD Minimal Research Workflow {=wf:workflow .prov:Entity}
4
-
5
- This document records the full research workflow that produced a
6
- minimal SHACL validation model for MDLD workspaces.
7
-
8
- The workflow is self-contained and reproducible.
9
- Every step is represented as a provenance activity that consumes
10
- entities and generates new entities.
11
-
12
- The goal is to produce a minimal SHACL shape set capable of validating
13
- core MDLD semantics.
14
-
15
- ---
16
-
17
- ## Research Plan {=nih:sha-256-128;4889b626d88785b4eed19b2aa6e5ca24;8 .prov:Plan label}
18
-
19
- ~~~~~~ {prov:value}
20
- Research goal:
21
- Define a minimal SHACL validation model for MDLD documents.
22
-
23
- Steps:
24
-
25
- 1. Identify the minimal semantic primitives of MDLD.
26
- 2. Map those primitives to PROV concepts.
27
- 3. Determine which invariants must be enforced by validation.
28
- 4. Encode these invariants as SHACL shapes.
29
- 5. Produce a minimal reusable SHACL schema.
30
-
31
- Success criteria:
32
-
33
- - shapes validate core MDLD constructs
34
- - shapes remain ontology-minimal
35
- - shapes rely only on RDF, PROV and SHACL
36
-
37
- Outcome:
38
-
39
- A portable SHACL shape set usable by MDLD parsers and verification tools.
40
- ~~~~~~
41
-
42
- ---
43
-
44
- ## Exploration Activity {=wf:exploration .prov:Activity}
45
-
46
- This step explores MDLD semantics and identifies the minimal set
47
- of primitives required for a functional system.
48
-
49
- Uses plan
50
- [research plan] {+nih:sha-256-128;4889b626d88785b4eed19b2aa6e5ca24;8 ?prov:hadPlan}
51
-
52
- ## Exploration notes {=nih:sha-256-128;aaa55e922921171296c05b322320bc7e;5 .prov:Entity ?prov:generated}
53
-
54
- ~~~~~~ {prov:value}
55
- Core MDLD primitives identified:
56
-
57
- 1. Entity
58
- 2. Activity
59
- 3. Plan
60
- 4. Content-addressed value
61
- 5. Location-based artifact
62
- 6. Provenance links
63
-
64
- Integrity model:
65
-
66
- - ni hash IRIs identify immutable entities
67
- - prov:value represents inline artifacts
68
- - prov:atLocation represents external artifacts
69
- - prov:used and prov:generated describe workflows
70
-
71
- Validation requirements:
72
-
73
- - entities with ni identifiers must match content hash
74
- - prov:value must appear only once per entity
75
- - prov:Activity must connect inputs and outputs
76
- - plans must exist when referenced
77
- ~~~~~~
78
-
79
- ---
80
-
81
- # Shape Design Activity {=wf:shapeDesign .prov:Activity}
82
-
83
- This activity formalizes the exploration notes into SHACL validation rules.
84
-
85
- Uses plan
86
- [research plan] {+nih:sha-256-128;4889b626d88785b4eed19b2aa6e5ca24;8 ?prov:hadPlan}
87
-
88
- Uses exploration results
89
- [exploration notes] {+nih:sha-256-128;aaa55e922921171296c05b322320bc7e;5 ?prov:used}
90
-
91
- This activity was informed by the exploration step.
92
-
93
- [drafting phase] {+wf:exploration ?prov:wasInformedBy}
94
-
95
- Generated draft shape model:
96
-
97
- ## Draft Shape model {=nih:sha-256-128;776aee4fd5e0fe3cf808e5895a12dfb2;9 .prov:Entity ?prov:generated label}
98
-
99
- ~~~~~~ {prov:value}
100
- Initial validation concepts:
101
-
102
- Entity integrity rule
103
- Activity connectivity rule
104
- Plan presence rule
105
- Artifact content rule
106
-
107
- Shape design principle:
108
-
109
- validate graph structure
110
- avoid imposing domain semantics
111
- keep shapes minimal and composable
112
- ~~~~~~
113
-
114
- ---
115
-
116
- # Validation Activity {=wf:shapeValidation .prov:Activity}
117
-
118
- This activity refines the shape draft into the final validation schema.
119
-
120
- Uses plan
121
- [research plan] {+nih:sha-256-128;4889b626d88785b4eed19b2aa6e5ca24;8 ?prov:hadPlan}
122
-
123
- Uses draft shapes
124
- [draft shape model] {+nih:sha-256-128;776aee4fd5e0fe3cf808e5895a12dfb2;9 ?prov:used}
125
-
126
- This activity was informed by the shape design step.
127
-
128
- [shape design] {+wf:shapeDesign ?prov:wasInformedBy}
129
-
130
- Generated final SHACL schema:
131
-
132
- [./shapes.ttl] {+nih:sha-256-128;4594cd6cd9079dad278ba99078437888;4 prov:atLocation .prov:Entity ?prov:generated}
133
-
134
- ---
135
-
136
- # Completion
137
-
138
- The research workflow produced a minimal SHACL validation schema.
139
-
140
- The provenance chain is:
141
-
142
- plan → exploration activity → exploration notes
143
- plan + exploration → shape design activity → draft shapes
144
- plan + draft shapes → validation activity → final SHACL schema
145
-
146
- Because every artifact is content-addressed, the workflow and its
147
- outputs remain reproducible and verifiable.
148
-
149
- This document therefore records both the research process and
150
- its resulting validation model in a single MDLD workflow artifact.