mdld-parse 0.9.2 → 0.9.4

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 (64) hide show
  1. package/dist/.nojekyll +0 -0
  2. package/dist/CNAME +1 -0
  3. package/dist/README.md +425 -0
  4. package/dist/docs/API.md +397 -0
  5. package/dist/docs/Architecture.md +190 -0
  6. package/dist/docs/Guide.md +816 -0
  7. package/dist/docs/LLM-MDLD-Inducer.md +550 -0
  8. package/dist/docs/Parser.md +654 -0
  9. package/dist/docs/Performance.md +238 -0
  10. package/dist/docs/Spec-render.md +1439 -0
  11. package/dist/docs/Subject.md +180 -0
  12. package/dist/docs/Syntax.md +463 -0
  13. package/dist/docs/TodoList.md +215 -0
  14. package/dist/docs/Use-Cases.md +354 -0
  15. package/dist/docs/guide-m.md +56 -0
  16. package/dist/docs/index.html +108 -0
  17. package/dist/docs/index.md +56 -0
  18. package/dist/docs/one-page.md +322 -0
  19. package/dist/docs/origin.md +459 -0
  20. package/dist/docs/polarity.md +586 -0
  21. package/dist/docs/primary-subject.md +199 -0
  22. package/dist/docs/statements.md +226 -0
  23. package/dist/docs/tokenization-performance-report.md +164 -0
  24. package/dist/examples/Cookbook.md +32 -0
  25. package/dist/examples/Status-SHACL.md +31 -0
  26. package/dist/examples/demo/index.md +35 -0
  27. package/dist/examples/demo/journal.md +119 -0
  28. package/dist/examples/demo/minimal.md +23 -0
  29. package/dist/examples/demo/project.md +98 -0
  30. package/dist/examples/demo/prov.md +107 -0
  31. package/dist/examples/demo/rdf.md +69 -0
  32. package/dist/examples/demo/recipe.md +95 -0
  33. package/dist/examples/demo/research.md +126 -0
  34. package/dist/examples/demo/shacl.md +161 -0
  35. package/dist/examples/demo/space-mission.md +129 -0
  36. package/dist/examples/demo/tasks.md +175 -0
  37. package/dist/examples/demo/xsd.md +91 -0
  38. package/dist/examples/dogfood.md +288 -0
  39. package/dist/examples/few-shot.md +309 -0
  40. package/dist/examples/graph/rdf-graph.html +473 -0
  41. package/dist/examples/graph/rdf_force_graph_web_component.html +506 -0
  42. package/dist/examples/index.md +45 -0
  43. package/dist/examples/llm-time-workflow.md +173 -0
  44. package/dist/examples/statements.md +43 -0
  45. package/dist/examples/workflow.md +150 -0
  46. package/dist/index.html +3253 -0
  47. package/dist/index.js +1770 -0
  48. package/dist/logo.svg +7 -0
  49. package/dist/spec/Spec-compact.md +363 -0
  50. package/dist/spec/Spec-ultra.md +221 -0
  51. package/dist/spec/Spec.md +1068 -0
  52. package/dist/spec/index.md +46 -0
  53. package/package.json +7 -8
  54. package/src/constants.js +0 -31
  55. package/src/generate.js +0 -245
  56. package/src/highlight.js +0 -362
  57. package/src/index.js +0 -13
  58. package/src/locate.js +0 -23
  59. package/src/merge.js +0 -157
  60. package/src/parse.js +0 -711
  61. package/src/render.js +0 -576
  62. package/src/shared.js +0 -577
  63. package/src/tokenizers.js +0 -594
  64. package/src/utils.js +0 -430
@@ -0,0 +1,119 @@
1
+ [j] <tag:alice@example.com,2026:journal:>
2
+
3
+ # Personal Journal {=j:index .prov:Collection label}
4
+
5
+ Daily journal with proper PROV-O provenance and temporal structure.
6
+
7
+ Includes records for [2026] {+j:2026/index ?prov:hadMember}.
8
+
9
+ ## Year 2026 {=j:2026/index .prov:Activity .prov:Collection label}
10
+
11
+ This is all notes made in 2026 collection. It includes monthly collections:
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}
18
+
19
+ ## May 2026 {=j:2026/05/index .prov:Activity .prov:Collection label}
20
+
21
+ Started: [2026-05-01T00:00:00+04:00] {prov:startedAtTime ^^xsd:dateTime}
22
+
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}.
24
+
25
+ ======
26
+
27
+ #### 06 May 2026 {=j:2026/05/06/index .prov:Activity label}
28
+
29
+ It's our first record in [week 2] {+j:2026/05/week-2/index ?prov:wasInformedBy}.
30
+
31
+ Complete day with activities, locations, and emotional state.
32
+
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}
35
+
36
+ Includes these activities: [morning] {+#morning !prov:wasInformedBy}, [afternoon] {+#afternoon !prov:wasInformedBy} and [social] {+#social !prov:wasInformedBy}.
37
+
38
+ ### Morning Activities {=#morning .prov:Activity label}
39
+
40
+ I had a [walk] {+#walk ?prov:wasInformedBy} and a [coffee] {+#coffee-prep ?prov:wasInformedBy}.
41
+
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}
48
+
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}
53
+
54
+ ### Afternoon Activities {=#afternoon .prov:Activity label}
55
+
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}
61
+
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}
66
+
67
+ ### Social Interactions {=#social .prov:Activity label}
68
+
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}
74
+
75
+ ## Emotional State Tracking {=#emotional-state .prov:Entity label}
76
+
77
+ Daily mood and energy levels with temporal context.
78
+
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
84
+
85
+ ### Location History {=j:location-history .prov:Entity label}
86
+ Places visited with frequency and context.
87
+
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
119
+
@@ -0,0 +1,23 @@
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
+
@@ -0,0 +1,98 @@
1
+ [proj] <tag:alice@example.com,2026:project/>
2
+
3
+ # Website Redesign {=proj:website .prov:Project label}
4
+
5
+ Website redesign project for Q2 2026 with modern responsive design.
6
+
7
+ ## Project Metadata {=proj:website-meta .prov:Entity label}
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}
13
+
14
+ ## Team Formation Activity {=proj:team-formation .prov:Activity label}
15
+
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}
19
+
20
+ Generated: [Team Structure] {+proj:team-structure ?prov:generated}
21
+
22
+ ## Team Members
23
+
24
+ ### Project Manager {=proj:alice .prov:Person label}
25
+
26
+ Name: [Alice Johnson] {rdfs:label}
27
+ Email: [alice@example.com] {proj:email}
28
+ Role: [Project Manager] {proj:role}
29
+
30
+ ### Lead Developer {=proj:bob .prov:Person label}
31
+
32
+ Name: [Bob Smith] {rdfs:label}
33
+ Email: [bob@example.com] {proj:email}
34
+ Role: [Lead Developer] {proj:role}
35
+
36
+ ### UX Designer {=proj:carol .prov:Person label}
37
+
38
+ Name: [Carol Davis] {rdfs:label}
39
+ Email: [carol@example.com] {proj:email}
40
+ Role: [UX Designer] {proj:role}
41
+
42
+ ## Project Tasks
43
+
44
+ ### Design Phase {=proj:design-phase .prov:Activity label}
45
+
46
+ Started: [2026-06-01] {prov:startedAtTime ^^xsd:date}
47
+ Ended: [2026-06-15] {prov:endedAtTime ^^xsd:date}
48
+
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
53
+
54
+ Generated: [Design Documentation] {+proj:design-docs ?prov:generated}
55
+
56
+ ### Development Phase {=proj:dev-phase .prov:Activity label}
57
+
58
+ Started: [2026-06-16] {prov:startedAtTime ^^xsd:date}
59
+ Ended: [2026-07-30] {prov:endedAtTime ^^xsd:date}
60
+
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
65
+
66
+ Generated: [Working Prototype] {+proj:prototype ?prov:generated}
67
+
68
+ ## Project Relationships
69
+
70
+ ### Dependencies {=proj:dependencies .rdfs:Resource label}
71
+
72
+ The project depends on:
73
+ - [Design System] {+proj:design-system ?proj:requires}
74
+ - [API Documentation] {+proj:api-docs ?proj:requires}
75
+
76
+ ### Stakeholders {=proj:stakeholders .rdfs:Resource label}
77
+
78
+ Key stakeholders:
79
+ - [Marketing Department] {+proj:marketing ?proj:stakeholder .prov:Organization}
80
+ - [Customer Support] {+proj:support ?proj:stakeholder .prov:Organization}
81
+
82
+ ## Delegation Pattern
83
+
84
+ ### Development Delegation {=proj:dev-delegation .prov:Delegation ?prov:qualifiedDelegation}
85
+
86
+ Alice delegates frontend development to specialized team.
87
+
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}
92
+
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
@@ -0,0 +1,107 @@
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
@@ -0,0 +1,69 @@
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
@@ -0,0 +1,95 @@
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
+ Traditional family recipe passed down through generations.
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}
13
+
14
+ ## Dry Ingredients
15
+
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}
19
+
20
+ ### Wet Ingredients
21
+
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}
25
+
26
+ ### Filling Ingredients
27
+
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}
31
+
32
+ ## Preparation Steps {=food:preparation .prov:Activity label}
33
+
34
+ ### Step 1: Crust {=food:step-crust .prov:Activity label}
35
+
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}.
37
+
38
+ ### Step 2: Filling {=food:step-filling .prov:Activity label}
39
+
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.
41
+
42
+ ### Step 3: Assembly {=food:step-assembly .prov:Activity label}
43
+
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}.
45
+
46
+ ### Step 4: Baking {=food:step-baking .prov:Activity label}
47
+
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}.
49
+
50
+ ## Recipe Relationships
51
+
52
+ ### Variation {=food:variation .prov:Entity label}
53
+
54
+ This recipe is a variation of [Classic Apple Pie] {+food:classic-apple-pie .schema:Recipe ?food:variationOf}.
55
+
56
+ Also related: [Peach Pie] {+food:peach-pie .schema:Recipe ?food:similarRecipe} and [Apple Crumble] {+food:apple-crumble .schema:Recipe ?food:similarRecipe}.
57
+
58
+ ## Nutrition Information {=food:nutrition .prov:Entity label}
59
+
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
@@ -0,0 +1,126 @@
1
+ [research] <https://research.example.org/>
2
+ [data] <https://research.example.org/datasets/>
3
+ [prov] <http://www.w3.org/ns/prov#>
4
+ [sh] <http://www.w3.org/ns/shacl#>
5
+ [xsd] <http://www.w3.org/2001/XMLSchema#>
6
+
7
+ # Medical Imaging AI Research {=research:paper .prov:Entity label}
8
+
9
+ Deep learning analysis of attention mechanisms for medical diagnosis.
10
+
11
+ ## Authors {=research:authors .prov:Entity label}
12
+
13
+ Research team with defined roles and contributions.
14
+
15
+ ### Primary Author {=research:sarah-martinez .prov:Person label}
16
+ Name: [Dr. Sarah Martinez] {rdfs:label}
17
+ Email: [sarah.martinez@mit.edu] {research:email}
18
+ Role: [Lead Researcher] {research:role}
19
+ Contribution: [Methodology development] {research:contribution}
20
+
21
+ ### Co-Author {=research:james-liu .prov:Person label}
22
+ Name: [Dr. James Liu] {rdfs:label}
23
+ Email: [james.liu@mit.edu] {research:email}
24
+ Role: [ML Engineer] {research:role}
25
+ Contribution: [Model implementation] {research:contribution}
26
+
27
+ ## Research Activity {=research:research-activity .prov:Activity label}
28
+
29
+ Complete research lifecycle with proper provenance.
30
+
31
+ Started: [2024-01-01] {prov:startedAtTime ^^xsd:date}
32
+ Ended: [2024-03-15] {prov:endedAtTime ^^xsd:date}
33
+ Associated with: [Research Team] {+research:authors ?prov:wasAssociatedWith}
34
+ Plan: [Medical AI Research Plan] {+research:plan .prov:Plan ?prov:hadPlan}
35
+
36
+ ## Dataset Collection {=research:dataset-collection .prov:Activity label}
37
+
38
+ Systematic dataset gathering and validation.
39
+
40
+ ### Primary Dataset {=data:primary-dataset .research:Dataset label}
41
+ Source: [GitHub Medical Imaging Repository] {research:source}
42
+ Training samples: [80000] {data:trainCount ^^xsd:integer} DICOM images
43
+ Validation samples: [10000] {data:valCount ^^xsd:integer} DICOM images
44
+ Test samples: [10000] {data:testCount ^^xsd:integer} DICOM images
45
+ Classes: [15] {data:classCount ^^xsd:integer} anatomical structures
46
+
47
+ ### Augmented Dataset {=data:augmented-dataset .research:Dataset label}
48
+ Derived from: [Primary Dataset] {+data:primary-dataset ?prov:wasDerivedFrom}
49
+ Resolution: [512x512] {data:resolution} grayscale
50
+ Features: [Patient metadata] {data:features}
51
+ Sample size: [1000] {data:patientCount ^^xsd:integer} patients
52
+
53
+ ## Model Development {=research:model-development .prov:Activity label}
54
+
55
+ Training process with resource tracking.
56
+
57
+ Started: [2024-02-01] {prov:startedAtTime ^^xsd:date}
58
+ Ended: [2024-02-28] {prov:endedAtTime ^^xsd:date}
59
+ Used: [Primary Dataset] {+data:primary-dataset ?prov:used} and [Augmented Dataset] {+data:augmented-dataset ?prov:used}
60
+ Associated with: [Dr. James Liu] {+research:james-liu ?prov:wasAssociatedWith} as ML Engineer
61
+ Generated: [Trained Model] {+research:trained-model ?prov:generated}
62
+
63
+ ## Model Evaluation {=research:evaluation .prov:Activity label}
64
+
65
+ Comprehensive testing with statistical validation.
66
+
67
+ Started: [2024-03-01] {prov:startedAtTime ^^xsd:date}
68
+ Used: [Trained Model] {+research:trained-model ?prov:used}
69
+ Generated: [Evaluation Results] {+research:eval-results ?prov:generated}
70
+
71
+ ### Performance Metrics {=research:metrics .prov:Entity label}
72
+ Training accuracy: [94.5] {research:trainAcc ^^xsd:decimal}
73
+ Validation accuracy: [92.3] {research:valAcc ^^xsd:decimal}
74
+ Test accuracy: [91.8] {research:testAcc ^^xsd:decimal}
75
+ F1 score: [0.89] {research:f1 ^^xsd:decimal}
76
+ AUC-ROC: [0.93] {research:auc ^^xsd:decimal}
77
+ Statistical significance: [p < 0.05] {research:significance}
78
+ Sample size: [1000] {research:sampleSize ^^xsd:integer}
79
+
80
+ ## SHACL Validation Shapes
81
+
82
+ ### Paper Validation Shape {=research:PaperShape .sh:NodeShape label}
83
+
84
+ Ensures scientific papers meet academic standards. Targets all instances of [Paper] {+research:Paper ?sh:targetClass} to have a [title] {+#title ?sh:property sh:name}, [authors] {+#author ?sh:property sh:name} and [citations] {+#citation ?sh:property sh:name}.
85
+
86
+ ### Paper must have exactly one title. {=#title .sh:PropertyShape sh:message}
87
+ Path: [title] {+rdfs:label ?sh:path}
88
+ Required: [1] {sh:minCount sh:maxCount ^^xsd:integer}
89
+
90
+ ## Paper must have at least one author. {=#author .sh:PropertyShape sh:message}
91
+ Path: [author] {+research:author ?sh:path}
92
+ Required: [1] {sh:minCount ^^xsd:integer}
93
+
94
+ ## Paper must have at least one citation. {=#citation .sh:PropertyShape sh:message}
95
+ Path: [citation] {+research:citation ?sh:path}
96
+ Required: [1] {sh:minCount ^^xsd:integer}
97
+
98
+ ### Test Data
99
+
100
+ #### Valid Paper {=research:valid-paper .research:Paper label}
101
+ Title: [Medical Imaging AI Research] {rdfs:label}
102
+ Authors: [Dr. Sarah Martinez] {+research:sarah-martinez ?research:author}
103
+ Citations: [15] {research:citation ^^xsd:integer}
104
+
105
+ #### Invalid Paper {=research:invalid-paper .research:Paper label}
106
+ Title: [Untitled] {rdfs:label}
107
+ Authors: [] {research:citation}
108
+
109
+ ## Funding and Provenance
110
+
111
+ ### Funding Entity {=research:funding .prov:Entity label}
112
+ Grant: [NRA-2024-12345] {research:grantNumber}
113
+ Amount: [$500,000] {research:amount ^^xsd:decimal}
114
+ Source: [NASA Space Medicine] {+research:nasa ?prov:wasAttributedTo .prov:Organization}
115
+ Period: [2024-2026] {research:period}
116
+
117
+ ### Publication Activity {=research:publication .prov:Activity label}
118
+ Published: [Medical Imaging AI Research] {+research:paper ?prov:used} in [Medical Journal] {+research:journal ?prov:wasGeneratedBy}
119
+ Date: [2024-04-15] {prov:startedAtTime ^^xsd:date}
120
+
121
+ This demonstrates:
122
+ - Complete PROV-O provenance chains
123
+ - Dataset management with XSD typing
124
+ - SHACL validation with self-documenting
125
+ - Academic research lifecycle
126
+ - Proper ontology integration