mdld-parse 0.9.3 → 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.
@@ -1,48 +1,129 @@
1
+ [prov] <http://www.w3.org/ns/prov#>
1
2
  [nasa] <http://nasa.gov/>
3
+ [xsd] <http://www.w3.org/2001/XMLSchema#>
2
4
 
3
5
  # Apollo 11 Mission {=nasa:apollo11 .prov:Activity label}
4
6
 
5
- ## METADATA
7
+ Historic lunar landing mission with complete provenance tracking.
6
8
 
7
- Launch: [1969-07-16T13:32:00Z] {prov:startedAtTime ^^xsd:dateTime}
8
- Landing: [1969-07-20T20:17:00Z] {nasa:landing ^^xsd:dateTime}
9
- Duration (days): [8] {nasa:durationDays ^^xsd:integer}
10
- Budget (B USD): [2.5] {nasa:budget ^^xsd:decimal}
11
- Operator: [NASA] {+nasa:agency ?prov:wasAssociatedWith .prov:Organization}
9
+ ## Mission Overview {=nasa:mission-overview .prov:Entity label}
12
10
 
13
- ## CREW
11
+ Launch date: [1969-07-16] {nasa:launchDate ^^xsd:date}
12
+ Landing date: [1969-07-20] {nasa:landingDate ^^xsd:date}
13
+ Mission duration: [8] {nasa:durationDays ^^xsd:integer} days
14
+ Budget: [$2.5] {nasa:budget ^^xsd:decimal} billion USD
15
+ Status: [Success] {nasa:missionStatus}
14
16
 
15
- **Neil Armstrong** {+nasa:armstrong .prov:Person ?nasa:crew} - Commander, 1930
16
- **Buzz Aldrin** {+nasa:aldrin .prov:Person ?nasa:crew} - LMP, 1930
17
- **Michael Collins** {+nasa:collins .prov:Person ?nasa:crew} - CMP, 1930
17
+ ## Mission Timeline {=nasa:timeline .prov:Activity label}
18
18
 
19
- ## EQUIPMENT
19
+ Complete chronological sequence of mission events.
20
20
 
21
- **Saturn V** {+nasa:saturnv .nasa:Rocket ?nasa:equipment} - Boeing, 363ft
22
- **LM Eagle** {+nasa:eagle .nasa:Module ?nasa:equipment} - Grumman
23
- **CM Columbia** {+nasa:columbia .nasa:Module ?nasa:equipment} - NAA
21
+ ### Launch Phase {=nasa:launch .prov:Activity label}
22
+ Started: [1969-07-16T13:32:00Z] {prov:startedAtTime ^^xsd:dateTime}
23
+ Ended: [1969-07-16T13:35:00Z] {prov:endedAtTime ^^xsd:dateTime}
24
+ Associated with: [Launch Team] {+nasa:launch-team ?prov:wasAssociatedWith .prov:Organization}
25
+ Used: [Saturn V Rocket] {+nasa:saturnv .nasa:Rocket ?prov:used}
26
+ Generated: [Earth Orbit] {+nasa:earth-orbit ?prov:generated}
24
27
 
25
- ## ACTIVITIES
28
+ ### Trans-Lunar Injection {=nasa:tli .prov:Activity label}
29
+ Started: [1969-07-16T13:35:00Z] {prov:startedAtTime ^^xsd:dateTime}
30
+ Ended: [1969-07-16T16:00:00Z] {prov:endedAtTime ^^xsd:dateTime}
31
+ Informed by: [Launch Phase] {+nasa:launch ?prov:wasInformedBy}
32
+ Used: [Saturn V S-IVB Stage] {+nasa:saturnv-stage ?prov:used}
33
+ Generated: [Lunar Trajectory] {+nasa:lunar-trajectory ?prov:generated}
26
34
 
27
- **Launch** {+nasa:launch .prov:Activity} - Used Saturn V, generated orbit trajectory
35
+ ### Lunar Landing {=nasa:landing .prov:Activity label}
36
+ Started: [1969-07-20T20:05:00Z] {prov:startedAtTime ^^xsd:dateTime}
37
+ Ended: [1969-07-20T20:17:00Z] {prov:endedAtTime ^^xsd:dateTime}
38
+ Informed by: [Trans-Lunar Injection] {+nasa:tli ?prov:wasInformedBy}
39
+ Used: [LM Eagle] {+nasa:eagle .nasa:Module ?prov:used}
40
+ Generated: [Lunar Surface Presence] {+nasa:lunar-presence ?prov:generated}
28
41
 
29
- **Lunar Landing** {+nasa:landing .prov:Activity} - Used LM Eagle, generated lunar presence and samples
42
+ ## Personnel {=nasa:crew .prov:Entity label}
30
43
 
31
- **EVA** {+nasa:eva .prov:Activity} - 2h 18m, 250m, 21.5kg samples collected
44
+ Mission crew with defined roles and responsibilities.
32
45
 
33
- ## OBJECTIVES {=nasa:appollo11}
46
+ ### Mission Commander {=nasa:armstrong .prov:Person label}
47
+ Name: [Neil Armstrong] {rdfs:label}
48
+ Born: [1930-08-05] {nasa:birthDate ^^xsd:date}
49
+ Role: [Commander] {nasa:missionRole}
50
+ First step: [First human on Moon] {nasa:achievement}
34
51
 
35
- **Land on Moon** {+nasa:goal1 .nasa:Goal} - ACHIEVED 1969-07-20
36
- **Return safely** {+nasa:goal2 .nasa:Goal} - ACHIEVED 1969-07-24
37
- **Collect samples** {+nasa:goal3 .nasa:Goal} - ACHIEVED 21.5kg
52
+ ### Lunar Module Pilot {=nasa:aldrin .prov:Person label}
53
+ Name: [Buzz Aldrin] {rdfs:label}
54
+ Born: [1930-01-20] {nasa:birthDate ^^xsd:date}
55
+ Role: [Lunar Module Pilot] {nasa:missionRole}
56
+ EVA duration: [2h 18m] {nasa:evaDuration ^^xsd:string}
38
57
 
39
- ## RELATIONSHIPS
58
+ ### Command Module Pilot {=nasa:collins .prov:Person label}
59
+ Name: [Michael Collins] {rdfs:label}
60
+ Born: [1930-10-31] {nasa:birthDate ^^xsd:date}
61
+ Role: [Command Module Pilot] {nasa:missionRole}
62
+ Responsibility: [Orbital operations] {nasa:responsibility}
40
63
 
41
- Preceded by: [Apollo 10] {+nasa:apollo10 !nasa:precededBy .nasa:SpaceMission}, [Gemini 8] {+nasa:gemini8 !nasa:precededBy .nasa:SpaceMission}
64
+ ## Equipment {=nasa:equipment .prov:Entity label}
42
65
 
43
- Succeeded by: [Apollo 12] {+nasa:apollo12 ?nasa:succeededBy .nasa:SpaceMission}
66
+ All mission hardware and systems used.
44
67
 
45
- **Delegation** {=nasa:delegation .prov:Delegation ?prov:qualifiedDelegation}
68
+ ### Launch Vehicle {=nasa:saturnv .nasa:Rocket label}
69
+ Name: [Saturn V] {rdfs:label}
70
+ Manufacturer: [Boeing] {nasa:manufacturer}
71
+ Height: [363] {nasa:height ^^xsd:integer} ft
72
+ Thrust: [7.6] {nasa:thrust ^^xsd:decimal} million lbs
46
73
 
47
- Delegate: [Mission Control] {+nasa:mcc ?prov:agent .prov:Organization}
48
- Responsible: [NASA Admin] {+nasa:admin ?prov:agent .prov:Person}
74
+ ### Lunar Module {=nasa:eagle .nasa:Module label}
75
+ Name: [Eagle] {rdfs:label}
76
+ Manufacturer: [Grumman Aircraft] {nasa:manufacturer}
77
+ Mass: [15,897] {nasa:mass ^^xsd:decimal} lb
78
+ Crew capacity: [2] {nasa:crewCapacity ^^xsd:integer}
79
+
80
+ ### Command Module {=nasa:columbia .nasa:Module label}
81
+ Name: [Columbia] {rdfs:label}
82
+ Manufacturer: [North American Aviation] {nasa:manufacturer}
83
+ Mass: [28,801] {nasa:mass ^^xsd:decimal} lb
84
+ Crew capacity: [3] {nasa:crewCapacity ^^xsd:integer}
85
+
86
+ ## Mission Objectives {=nasa:objectives .prov:Entity label}
87
+
88
+ Primary goals and their achievement status.
89
+
90
+ ### Primary Objective {=nasa:primary-goal .nasa:Goal label}
91
+ Description: [Land humans on Moon and return safely] {rdfs:label}
92
+ Status: [Achieved] {nasa:achievementStatus}
93
+ Achievement date: [1969-07-20] {nasa:achievementDate ^^xsd:date}
94
+
95
+ ### Secondary Objectives
96
+
97
+ #### Lunar Sample Collection {=nasa:sample-goal .nasa:Goal label}
98
+ Description: [Collect lunar samples for scientific analysis] {rdfs:label}
99
+ Status: [Achieved] {nasa:achievementStatus}
100
+ Sample weight: [21.5] {nasa:sampleWeight ^^xsd:decimal} kg
101
+
102
+ #### EVA Operations {=nasa:eva-goal .nasa:Goal label}
103
+ Description: [Conduct extravehicular activities] {rdfs:label}
104
+ Status: [Achieved] {nasa:achievementStatus}
105
+ EVA duration: [2h 18m] {nasa:evaDuration ^^xsd:string}
106
+
107
+ ## Mission Control {=nasa:mission-control .prov:Organization label}
108
+
109
+ Ground support team with delegation structure.
110
+
111
+ ### Flight Directors {=nasa:flight-directors .prov:Organization label}
112
+ Role: [Mission supervision] {nasa:role}
113
+ Personnel: [Gene Kranz, Glynn Lunney, Gerald Griffin] {nasa:personnel}
114
+
115
+ ### Delegation Pattern {=nasa:operation-delegation .prov:Delegation ?prov:qualifiedDelegation}
116
+
117
+ NASA Administrator delegates operational authority to Mission Control.
118
+
119
+ Delegator: [NASA Administrator] {+nasa:admin ?prov:delegate}
120
+ Responsible: [Mission Control] {+nasa:mission-control ?prov:responsible}
121
+ Activity: [Flight Operations] {+nasa:flight-ops ?prov:hadActivity}
122
+ Role: [Flight Director] {+nasa:flight-director ?prov:hadRole}
123
+
124
+ This demonstrates:
125
+ - Complete PROV-O activity chains
126
+ - Proper temporal properties with XSD
127
+ - Organizational structure and delegation
128
+ - Equipment tracking and relationships
129
+ - Goal achievement modeling
@@ -0,0 +1,175 @@
1
+ [rdf] <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
2
+ [rdfs] <http://www.w3.org/2000/01/rdf-schema#>
3
+ [xsd] <http://www.w3.org/2001/XMLSchema#>
4
+ [prov] <http://www.w3.org/ns/prov#>
5
+ [sh] <http://www.w3.org/ns/shacl#>
6
+ [my] <tag:alice@example.com,2026:>
7
+
8
+ # Task Management System {=my:taskSystem .rdfs:Resource label}
9
+
10
+ Comprehensive task management combining multiple W3C ontologies for real-world workflow automation.
11
+
12
+ ## Ontology Foundation
13
+
14
+ ### User Class {=my:User .rdfs:Class label}
15
+
16
+ A user is a person who can be assigned tasks and projects.
17
+
18
+ Subclass of: [Person] {+rdfs:Person ?rdfs:subClassOf}
19
+
20
+ Properties:
21
+ - **Name**: [string] {+xsd:string ?rdfs:range}
22
+ - **Email**: [string] {+xsd:string ?rdfs:range}
23
+ - **Active**: [boolean] {+xsd:boolean ?rdfs:range}
24
+ - **Created**: [dateTime] {+xsd:dateTime ?rdfs:range}
25
+
26
+ ### Task Class {=my:Task .rdfs:Class label}
27
+
28
+ A task represents work to be completed with status and priority.
29
+
30
+ Subclass of: [Entity] {+rdfs:Resource ?rdfs:subClassOf}
31
+
32
+ Properties:
33
+ - **Title**: [string] {+xsd:string ?rdfs:range}
34
+ - **Description**: [string] {+xsd:string ?rdfs:range}
35
+ - **Status**: [string] {+xsd:string ?rdfs:range}
36
+ - **Priority**: [integer] {+xsd:integer ?rdfs:range}
37
+ - **Due Date**: [dateTime] {+xsd:dateTime ?rdfs:range}
38
+ - **Assigned To**: [User] {+my:User ?rdfs:range}
39
+
40
+ ### Project Class {=my:Project .rdfs:Class label}
41
+
42
+ A project contains multiple related tasks with timelines and goals.
43
+
44
+ Subclass of: [Entity] {+rdfs:Resource ?rdfs:subClassOf}
45
+
46
+ Properties:
47
+ - **Name**: [string] {+xsd:string ?rdfs:range}
48
+ - **Start Date**: [date] {+xsd:date ?rdfs:range}
49
+ - **End Date**: [date] {+xsd:date ?rdfs:range}
50
+ - **Status**: [string] {+xsd:string ?rdfs:range}
51
+ - **Budget**: [decimal] {+xsd:decimal ?rdfs:range}
52
+
53
+ ## Instance Data with Provenance
54
+
55
+ ### Project Alpha {=my:project-alpha .my:Project label}
56
+
57
+ Name: [Website Redesign] {rdfs:label}
58
+ Start date: [2026-06-01] {my:startDate ^^xsd:date}
59
+ End date: [2026-08-31] {my:endDate ^^xsd:date}
60
+ Budget: [50000.00] {my:budget ^^xsd:decimal}
61
+ Status: [active] {my:status}
62
+
63
+ **Project Creation Activity** {=my:project-creation .prov:Activity label}
64
+ - Started: [2026-05-15T09:00:00Z] {prov:startedAtTime ^^xsd:dateTime}
65
+ - Associated with: [Project Manager] {+my:project-manager .prov:Person ?prov:wasAssociatedWith}
66
+ - Used: [Requirements Document] {+my:requirements ?prov:used}
67
+ - Generated: [Project Alpha] {+my:project-alpha ?prov:generated}
68
+
69
+ ### Task Instances
70
+
71
+ #### Design Task {=my:task-design .my:Task label}
72
+
73
+ Title: [Design Homepage Layout] {rdfs:label}
74
+ Description: [Create responsive design for main website pages] {my:description}
75
+ Status: [in-progress] {my:status}
76
+ Priority: [1] {my:priority ^^xsd:integer}
77
+ Due date: [2026-06-15T17:00:00Z] {my:dueDate ^^xsd:dateTime}
78
+ Assigned to: [Alice Johnson] {+my:alice .my:User ?my:assignedTo}
79
+
80
+ **Task Assignment Activity** {=my:task-assignment .prov:Activity label}
81
+ - Started: [2026-06-01T10:00:00Z] {prov:startedAtTime ^^xsd:dateTime}
82
+ - Associated with: [Alice Johnson] {+my:alice ?prov:wasAssociatedWith}
83
+ - Used: [Design Task] {+my:task-design ?prov:used}
84
+ - Generated: [Task Assignment Record] {+my:assignment-record ?prov:generated}
85
+
86
+ #### Development Task {=my:task-dev .my:Task label}
87
+
88
+ Title: [Implement Homepage Backend] {rdfs:label}
89
+ Description: [Build API endpoints and database schema for homepage] {my:description}
90
+ Status: [todo] {my:status}
91
+ Priority: [2] {my:priority ^^xsd:integer}
92
+ Due date: [2026-06-30T17:00:00Z] {my:dueDate ^^xsd:dateTime}
93
+ Assigned to: [Bob Smith] {+my:bob .my:User ?my:assignedTo}
94
+
95
+ #### Testing Task {=my:task-test .my:Task label}
96
+
97
+ Title: [Test Homepage Functionality] {rdfs:label}
98
+ Description: [Comprehensive testing of all homepage features] {my:description}
99
+ Status: [todo] {my:status}
100
+ Priority: [3] {my:priority ^^xsd:integer}
101
+ Due date: [2026-07-15T17:00:00Z] {my:dueDate ^^xsd:dateTime}
102
+ Assigned to: [Carol Davis] {+my:carol .my:User ?my:assignedTo}
103
+
104
+ ## SHACL Validation Shapes
105
+
106
+ ### User Validation Shape {=my:UserShape .sh:NodeShape label}
107
+
108
+ Validates all [User] {+my:User ?sh:targetClass} instances.
109
+
110
+ **Name Constraint** {=my:UserShape-name .sh:PropertyShape ?sh:property}
111
+ Path: [name] {+rdfs:label ?sh:path}
112
+ Required: [1] {sh:minCount ^^xsd:integer sh:maxCount ^^xsd:integer}
113
+ Datatype: [string] {+xsd:string ?sh:datatype}
114
+
115
+ > User must have exactly one name. {sh:message}
116
+
117
+ **Email Constraint** {=my:UserShape-email .sh:PropertyShape ?sh:property}
118
+ Path: [email] {+my:email ?sh:path}
119
+ Required: [1] {sh:minCount ^^xsd:integer}
120
+ Pattern: [.*@.*] {sh:pattern}
121
+
122
+ > User must have valid email address. {sh:message}
123
+
124
+ ### Task Validation Shape {=my:TaskShape .sh:NodeShape label}
125
+
126
+ Validates all [Task] {+my:Task ?sh:targetClass} instances.
127
+
128
+ **Status Constraint** {=my:TaskShape-status .sh:PropertyShape ?sh:property}
129
+ Path: [status] {+my:status ?sh:path}
130
+ Required: [1] {sh:minCount ^^xsd:integer}
131
+ In: [todo, in-progress, done, blocked] {+my:status-values ?sh:in}
132
+
133
+ > Task status must be one of: todo, in-progress, done, blocked. {sh:message}
134
+
135
+ **Priority Constraint** {=my:TaskShape-priority .sh:PropertyShape ?sh:property}
136
+ Path: [priority] {+my:priority ?sh:path}
137
+ Required: [1] {sh:minCount ^^xsd:integer}
138
+ Datatype: [integer] {+xsd:integer ?sh:datatype}
139
+ Minimum: [1] {sh:minInclusive ^^xsd:integer}
140
+ Maximum: [5] {sh:maxInclusive ^^xsd:integer}
141
+
142
+ > Task priority must be between 1 and 5. {sh:message}
143
+
144
+ ## Test Data for Validation
145
+
146
+ ### Valid User {=my:valid-user .my:User label}
147
+
148
+ Name: [Alice Johnson] {rdfs:label}
149
+ Email: [alice@example.com] {my:email}
150
+ Active: [true] {my:active ^^xsd:boolean}
151
+
152
+ ### Invalid User {=my:invalid-user .my:User label}
153
+
154
+ Name: [Bob] {rdfs:label}
155
+ Email: [invalid-email] {my:email}
156
+
157
+ ### Valid Task {=my:valid-task .my:Task label}
158
+
159
+ Title: [Complete Documentation] {rdfs:label}
160
+ Status: [done] {my:status}
161
+ Priority: [2] {my:priority ^^xsd:integer}
162
+ Due date: [2026-06-30T17:00:00Z] {my:dueDate ^^xsd:dateTime}
163
+
164
+ ### Invalid Task {=my:invalid-task .my:Task label}
165
+
166
+ Title: [Invalid Task] {rdfs:label}
167
+ Status: [cancelled] {my:status}
168
+ Priority: [6] {my:priority ^^xsd:integer}
169
+
170
+ This comprehensive example demonstrates:
171
+ - **RDF/RDFS**: Class definitions, property domains/ranges, subclass relationships
172
+ - **XSD**: Typed literals for dates, numbers, strings, booleans
173
+ - **PROV-O**: Complete provenance chains for project and task creation
174
+ - **SHACL**: Validation shapes with constraints and test data
175
+ - **Integration**: All ontologies working together in real task management scenario
@@ -0,0 +1,91 @@
1
+ [xsd] <http://www.w3.org/2001/XMLSchema#>
2
+ [my] <tag:alice@example.com,2026:>
3
+
4
+ # XSD Datatypes Demo {=my:xsd-demo .prov:Entity label}
5
+
6
+ Demonstrates proper use of XSD datatypes in MD-LD annotations.
7
+
8
+ ## String Datatypes
9
+
10
+ ### Plain String
11
+ Title: [Data Types Demo] {my:title}
12
+
13
+ ### Language-Tagged String
14
+ Description: [This example shows language tagging] {my:description @en}
15
+ Description: [Este ejemplo muestra etiquetado de idioma] {my:description @es}
16
+ Description: [Cet exemple montre l'étiquetage de langue] {my:description @fr}
17
+
18
+ ## Numeric Datatypes
19
+
20
+ ### Integer
21
+ Count: [42] {my:count ^^xsd:integer}
22
+ Year: [2026] {my:year ^^xsd:gYear}
23
+ Month: [5] {my:month ^^xsd:gMonth}
24
+ Day: [6] {my:day ^^xsd:gDay}
25
+
26
+ ### Decimal
27
+ Price: [19.99] {my:price ^^xsd:decimal}
28
+ Percentage: [87.5] {my:percentage ^^xsd:decimal}
29
+ Ratio: [3.14159] {my:ratio ^^xsd:decimal}
30
+
31
+ ## Temporal Datatypes
32
+
33
+ ### Date
34
+ Created: [2026-05-06] {my:created ^^xsd:date}
35
+ Birthday: [1990-12-25] {my:birthday ^^xsd:date}
36
+
37
+ ### DateTime
38
+ Started: [2026-05-06T14:30:00Z] {my:startedAt ^^xsd:dateTime}
39
+ Deadline: [2026-12-31T23:59:59Z] {my:deadline ^^xsd:dateTime}
40
+
41
+ ### Time
42
+ Meeting time: [09:30:00] {my:meetingTime ^^xsd:time}
43
+ Duration: [02:45:00] {my:duration ^^xsd:time}
44
+
45
+ ### Duration
46
+ Project duration: [P1Y2M3DT4H30M] {my:projectDuration ^^xsd:duration}
47
+ Sprint length: [P2W] {my:sprintLength ^^xsd:duration}
48
+
49
+ ## Boolean and Binary
50
+
51
+ ### Boolean
52
+ Active: [true] {my:isActive ^^xsd:boolean}
53
+ Completed: [false] {my:isCompleted ^^xsd:boolean}
54
+ Available: [1] {my:isAvailable ^^xsd:boolean}
55
+
56
+ ## Specialized Types
57
+
58
+ ### URI/IRI
59
+ Website: [https://example.com] {my:website}
60
+ Identifier: [urn:isbn:978-3-16-148410-0] {my:isbn}
61
+
62
+ ### Base64 Binary
63
+ Avatar data: [SGVsbG8gdG8gdGVuIGRhdGE=] {my:avatar ^^xsd:base64Binary}
64
+
65
+ ## Real-World Example
66
+
67
+ ### Product Catalog Entry {=my:product .prov:Entity label}
68
+
69
+ Name: [Wireless Headphones] {my:title}
70
+ SKU: [WH-1000] {my:sku ^^xsd:string}
71
+ Price: [$79.99] {my:price ^^xsd:decimal}
72
+ Weight: [0.25] {my:weight ^^xsd:decimal}
73
+ In stock: [true] {my:inStock ^^xsd:boolean}
74
+ Release date: [2026-06-15] {my:releaseDate ^^xsd:date}
75
+ Last updated: [2026-05-06T09:15:00Z] {my:lastUpdated ^^xsd:dateTime}
76
+
77
+ ### Customer Order {=my:order .prov:Activity label}
78
+
79
+ Order ID: [ORD-2026-0542] {my:orderId ^^xsd:string}
80
+ Order date: [2026-05-06] {my:orderDate ^^xsd:date}
81
+ Total amount: [158.97] {my:totalAmount ^^xsd:decimal}
82
+ Priority shipping: [false] {my:priorityShipping ^^xsd:boolean}
83
+ Estimated delivery: [2026-05-08T14:00:00Z] {my:estimatedDelivery ^^xsd:dateTime}
84
+
85
+ This demonstrates comprehensive XSD datatype usage for:
86
+ - Text with language tags
87
+ - Various numeric formats
88
+ - Complete temporal coverage
89
+ - Boolean flags
90
+ - Specialized binary/URI types
91
+ - Real-world business scenarios