openmath 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/README.adoc +26 -5
- data/lib/openmath/cd/collection.rb +92 -0
- data/lib/openmath/cd/configuration.rb +65 -0
- data/lib/openmath/cd/definition.rb +42 -0
- data/lib/openmath/cd/document.rb +50 -0
- data/lib/openmath/cd/example.rb +22 -0
- data/lib/openmath/cd/fmp.rb +21 -0
- data/lib/openmath/cd/namespace.rb +13 -0
- data/lib/openmath/cd/validation.rb +10 -0
- data/lib/openmath/cd.rb +27 -0
- data/lib/openmath/evaluation/binding_table.rb +58 -0
- data/lib/openmath/evaluation/error_value.rb +27 -0
- data/lib/openmath/evaluation/errors.rb +65 -0
- data/lib/openmath/evaluation/evaluator.rb +141 -0
- data/lib/openmath/evaluation/operations.rb +126 -0
- data/lib/openmath/evaluation.rb +29 -0
- data/lib/openmath/v2.rb +1 -1
- data/lib/openmath/v3/common_elements.rb +48 -0
- data/lib/openmath/v3/configuration.rb +35 -0
- data/lib/openmath/v3/oma.rb +9 -0
- data/lib/openmath/v3/omatp.rb +9 -0
- data/lib/openmath/v3/omattr.rb +9 -0
- data/lib/openmath/v3/omb.rb +9 -0
- data/lib/openmath/v3/ombind.rb +9 -0
- data/lib/openmath/v3/ombvar.rb +9 -0
- data/lib/openmath/v3/ome.rb +9 -0
- data/lib/openmath/v3/omf.rb +9 -0
- data/lib/openmath/v3/omforeign.rb +9 -0
- data/lib/openmath/v3/omi.rb +9 -0
- data/lib/openmath/v3/omobj.rb +9 -0
- data/lib/openmath/v3/omr.rb +9 -0
- data/lib/openmath/v3/oms.rb +9 -0
- data/lib/openmath/v3/omstr.rb +9 -0
- data/lib/openmath/v3/omv.rb +9 -0
- data/lib/openmath/v3.rb +55 -0
- data/lib/openmath/validation.rb +62 -0
- data/lib/openmath/version.rb +1 -1
- data/lib/openmath.rb +28 -1
- data/schemas/PROVENANCE.md +17 -0
- data/schemas/om3-common.rng +257 -0
- data/schemas/omcd2.rng +180 -0
- data/schemas/openmath2.rnc +88 -0
- data/schemas/openmath2.rng +248 -0
- data/schemas/openmath3.rng +19 -0
- metadata +60 -9
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!-- RELAX NG Schema for OpenMath 2 -->
|
|
3
|
+
<grammar ns="http://www.openmath.org/OpenMath" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
4
|
+
<start>
|
|
5
|
+
<ref name="OMOBJ"/>
|
|
6
|
+
</start>
|
|
7
|
+
<!-- OpenMath object constructor -->
|
|
8
|
+
<define name="OMOBJ">
|
|
9
|
+
<element name="OMOBJ">
|
|
10
|
+
<ref name="compound.attributes"/>
|
|
11
|
+
<optional>
|
|
12
|
+
<attribute name="version">
|
|
13
|
+
<data type="string"/>
|
|
14
|
+
</attribute>
|
|
15
|
+
</optional>
|
|
16
|
+
<ref name="omel"/>
|
|
17
|
+
</element>
|
|
18
|
+
</define>
|
|
19
|
+
<!-- Elements which can appear inside an OpenMath object -->
|
|
20
|
+
<define name="omel">
|
|
21
|
+
<choice>
|
|
22
|
+
<ref name="OMS"/>
|
|
23
|
+
<ref name="OMV"/>
|
|
24
|
+
<ref name="OMI"/>
|
|
25
|
+
<ref name="OMB"/>
|
|
26
|
+
<ref name="OMSTR"/>
|
|
27
|
+
<ref name="OMF"/>
|
|
28
|
+
<ref name="OMA"/>
|
|
29
|
+
<ref name="OMBIND"/>
|
|
30
|
+
<ref name="OME"/>
|
|
31
|
+
<ref name="OMATTR"/>
|
|
32
|
+
<ref name="OMR"/>
|
|
33
|
+
</choice>
|
|
34
|
+
</define>
|
|
35
|
+
<!-- things which can be variables -->
|
|
36
|
+
<define name="omvar">
|
|
37
|
+
<choice>
|
|
38
|
+
<ref name="OMV"/>
|
|
39
|
+
<ref name="attvar"/>
|
|
40
|
+
</choice>
|
|
41
|
+
</define>
|
|
42
|
+
<define name="attvar">
|
|
43
|
+
<element name="OMATTR">
|
|
44
|
+
<ref name="common.attributes"/>
|
|
45
|
+
<group>
|
|
46
|
+
<ref name="OMATP"/>
|
|
47
|
+
<choice>
|
|
48
|
+
<ref name="OMV"/>
|
|
49
|
+
<ref name="attvar"/>
|
|
50
|
+
</choice>
|
|
51
|
+
</group>
|
|
52
|
+
</element>
|
|
53
|
+
</define>
|
|
54
|
+
<define name="cdbase">
|
|
55
|
+
<optional>
|
|
56
|
+
<attribute name="cdbase">
|
|
57
|
+
<data type="anyURI"/>
|
|
58
|
+
</attribute>
|
|
59
|
+
</optional>
|
|
60
|
+
</define>
|
|
61
|
+
<!-- attributes common to all elements -->
|
|
62
|
+
<define name="common.attributes">
|
|
63
|
+
<optional>
|
|
64
|
+
<attribute name="id">
|
|
65
|
+
<data type="ID"/>
|
|
66
|
+
</attribute>
|
|
67
|
+
</optional>
|
|
68
|
+
</define>
|
|
69
|
+
<!-- attributes common to all elements that construct compount OM objects. -->
|
|
70
|
+
<define name="compound.attributes">
|
|
71
|
+
<ref name="common.attributes"/>
|
|
72
|
+
<ref name="cdbase"/>
|
|
73
|
+
</define>
|
|
74
|
+
<!-- symbol -->
|
|
75
|
+
<define name="OMS">
|
|
76
|
+
<element name="OMS">
|
|
77
|
+
<ref name="common.attributes"/>
|
|
78
|
+
<attribute name="name">
|
|
79
|
+
<data type="NCName"/>
|
|
80
|
+
</attribute>
|
|
81
|
+
<attribute name="cd">
|
|
82
|
+
<data type="NCName"/>
|
|
83
|
+
</attribute>
|
|
84
|
+
<ref name="cdbase"/>
|
|
85
|
+
</element>
|
|
86
|
+
</define>
|
|
87
|
+
<!-- variable -->
|
|
88
|
+
<define name="OMV">
|
|
89
|
+
<element name="OMV">
|
|
90
|
+
<ref name="common.attributes"/>
|
|
91
|
+
<attribute name="name">
|
|
92
|
+
<data type="NCName"/>
|
|
93
|
+
</attribute>
|
|
94
|
+
</element>
|
|
95
|
+
</define>
|
|
96
|
+
<!-- integer -->
|
|
97
|
+
<define name="OMI">
|
|
98
|
+
<element name="OMI">
|
|
99
|
+
<ref name="common.attributes"/>
|
|
100
|
+
<data type="string">
|
|
101
|
+
<param name="pattern">\s*(-\s?)?[0-9]+(\s[0-9]+)*\s*</param>
|
|
102
|
+
</data>
|
|
103
|
+
</element>
|
|
104
|
+
</define>
|
|
105
|
+
<!-- byte array -->
|
|
106
|
+
<define name="OMB">
|
|
107
|
+
<element name="OMB">
|
|
108
|
+
<ref name="common.attributes"/>
|
|
109
|
+
<data type="base64Binary"/>
|
|
110
|
+
</element>
|
|
111
|
+
</define>
|
|
112
|
+
<!-- string -->
|
|
113
|
+
<define name="OMSTR">
|
|
114
|
+
<element name="OMSTR">
|
|
115
|
+
<ref name="common.attributes"/>
|
|
116
|
+
<text/>
|
|
117
|
+
</element>
|
|
118
|
+
</define>
|
|
119
|
+
<!-- IEEE floating point number -->
|
|
120
|
+
<define name="OMF">
|
|
121
|
+
<element name="OMF">
|
|
122
|
+
<ref name="common.attributes"/>
|
|
123
|
+
<choice>
|
|
124
|
+
<attribute name="dec">
|
|
125
|
+
<data type="double"/>
|
|
126
|
+
</attribute>
|
|
127
|
+
<attribute name="hex">
|
|
128
|
+
<data type="string">
|
|
129
|
+
<param name="pattern">[0-9A-F]+</param>
|
|
130
|
+
</data>
|
|
131
|
+
</attribute>
|
|
132
|
+
</choice>
|
|
133
|
+
</element>
|
|
134
|
+
</define>
|
|
135
|
+
<!-- apply constructor -->
|
|
136
|
+
<define name="OMA">
|
|
137
|
+
<element name="OMA">
|
|
138
|
+
<ref name="compound.attributes"/>
|
|
139
|
+
<oneOrMore>
|
|
140
|
+
<ref name="omel"/>
|
|
141
|
+
</oneOrMore>
|
|
142
|
+
</element>
|
|
143
|
+
</define>
|
|
144
|
+
<!-- binding constructor -->
|
|
145
|
+
<define name="OMBIND">
|
|
146
|
+
<element name="OMBIND">
|
|
147
|
+
<ref name="compound.attributes"/>
|
|
148
|
+
<ref name="omel"/>
|
|
149
|
+
<ref name="OMBVAR"/>
|
|
150
|
+
<ref name="omel"/>
|
|
151
|
+
</element>
|
|
152
|
+
</define>
|
|
153
|
+
<!-- variables used in binding constructor -->
|
|
154
|
+
<define name="OMBVAR">
|
|
155
|
+
<element name="OMBVAR">
|
|
156
|
+
<ref name="common.attributes"/>
|
|
157
|
+
<oneOrMore>
|
|
158
|
+
<ref name="omvar"/>
|
|
159
|
+
</oneOrMore>
|
|
160
|
+
</element>
|
|
161
|
+
</define>
|
|
162
|
+
<!-- error constructor -->
|
|
163
|
+
<define name="OME">
|
|
164
|
+
<element name="OME">
|
|
165
|
+
<ref name="common.attributes"/>
|
|
166
|
+
<ref name="OMS"/>
|
|
167
|
+
<zeroOrMore>
|
|
168
|
+
<choice>
|
|
169
|
+
<ref name="omel"/>
|
|
170
|
+
<ref name="OMFOREIGN"/>
|
|
171
|
+
</choice>
|
|
172
|
+
</zeroOrMore>
|
|
173
|
+
</element>
|
|
174
|
+
</define>
|
|
175
|
+
<!-- attribution constructor and attribute pair constructor -->
|
|
176
|
+
<define name="OMATTR">
|
|
177
|
+
<element name="OMATTR">
|
|
178
|
+
<ref name="compound.attributes"/>
|
|
179
|
+
<ref name="OMATP"/>
|
|
180
|
+
<ref name="omel"/>
|
|
181
|
+
</element>
|
|
182
|
+
</define>
|
|
183
|
+
<define name="OMATP">
|
|
184
|
+
<element name="OMATP">
|
|
185
|
+
<ref name="compound.attributes"/>
|
|
186
|
+
<oneOrMore>
|
|
187
|
+
<ref name="OMS"/>
|
|
188
|
+
<choice>
|
|
189
|
+
<ref name="omel"/>
|
|
190
|
+
<ref name="OMFOREIGN"/>
|
|
191
|
+
</choice>
|
|
192
|
+
</oneOrMore>
|
|
193
|
+
</element>
|
|
194
|
+
</define>
|
|
195
|
+
<!-- foreign constructor -->
|
|
196
|
+
<define name="OMFOREIGN">
|
|
197
|
+
<element name="OMFOREIGN">
|
|
198
|
+
<ref name="compound.attributes"/>
|
|
199
|
+
<optional>
|
|
200
|
+
<attribute name="encoding">
|
|
201
|
+
<data type="string"/>
|
|
202
|
+
</attribute>
|
|
203
|
+
</optional>
|
|
204
|
+
<zeroOrMore>
|
|
205
|
+
<choice>
|
|
206
|
+
<ref name="omel"/>
|
|
207
|
+
<ref name="notom"/>
|
|
208
|
+
</choice>
|
|
209
|
+
</zeroOrMore>
|
|
210
|
+
</element>
|
|
211
|
+
</define>
|
|
212
|
+
<!--
|
|
213
|
+
Any elements not in the om namespace
|
|
214
|
+
(valid om is allowed as a descendant)
|
|
215
|
+
-->
|
|
216
|
+
<define name="notom">
|
|
217
|
+
<choice>
|
|
218
|
+
<element>
|
|
219
|
+
<anyName>
|
|
220
|
+
<except>
|
|
221
|
+
<nsName/>
|
|
222
|
+
</except>
|
|
223
|
+
</anyName>
|
|
224
|
+
<zeroOrMore>
|
|
225
|
+
<attribute>
|
|
226
|
+
<anyName/>
|
|
227
|
+
</attribute>
|
|
228
|
+
</zeroOrMore>
|
|
229
|
+
<zeroOrMore>
|
|
230
|
+
<choice>
|
|
231
|
+
<ref name="omel"/>
|
|
232
|
+
<ref name="notom"/>
|
|
233
|
+
</choice>
|
|
234
|
+
</zeroOrMore>
|
|
235
|
+
</element>
|
|
236
|
+
<text/>
|
|
237
|
+
</choice>
|
|
238
|
+
</define>
|
|
239
|
+
<!-- reference constructor -->
|
|
240
|
+
<define name="OMR">
|
|
241
|
+
<element name="OMR">
|
|
242
|
+
<ref name="common.attributes"/>
|
|
243
|
+
<attribute name="href">
|
|
244
|
+
<data type="anyURI"/>
|
|
245
|
+
</attribute>
|
|
246
|
+
</element>
|
|
247
|
+
</define>
|
|
248
|
+
</grammar>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!-- RELAX NG Schema for OpenMath 3 -->
|
|
3
|
+
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
|
|
4
|
+
<start>
|
|
5
|
+
<ref name="OMOBJ"/>
|
|
6
|
+
</start>
|
|
7
|
+
<include href="om3-common.rng"/>
|
|
8
|
+
<!-- the content models -->
|
|
9
|
+
<define name="OMA.content" combine="choice">
|
|
10
|
+
<oneOrMore>
|
|
11
|
+
<ref name="omel"/>
|
|
12
|
+
</oneOrMore>
|
|
13
|
+
</define>
|
|
14
|
+
<define name="OMBIND.content" combine="choice">
|
|
15
|
+
<ref name="omel"/>
|
|
16
|
+
<ref name="OMBVAR"/>
|
|
17
|
+
<ref name="omel"/>
|
|
18
|
+
</define>
|
|
19
|
+
</grammar>
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openmath
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-11-16 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: lutaml-model
|
|
@@ -16,9 +17,6 @@ dependencies:
|
|
|
16
17
|
- - "~>"
|
|
17
18
|
- !ruby/object:Gem::Version
|
|
18
19
|
version: '0.8'
|
|
19
|
-
- - ">="
|
|
20
|
-
- !ruby/object:Gem::Version
|
|
21
|
-
version: 0.8.162
|
|
22
20
|
type: :runtime
|
|
23
21
|
prerelease: false
|
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -26,9 +24,6 @@ dependencies:
|
|
|
26
24
|
- - "~>"
|
|
27
25
|
- !ruby/object:Gem::Version
|
|
28
26
|
version: '0.8'
|
|
29
|
-
- - ">="
|
|
30
|
-
- !ruby/object:Gem::Version
|
|
31
|
-
version: 0.8.162
|
|
32
27
|
- !ruby/object:Gem::Dependency
|
|
33
28
|
name: moxml
|
|
34
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -43,6 +38,20 @@ dependencies:
|
|
|
43
38
|
- - "~>"
|
|
44
39
|
- !ruby/object:Gem::Version
|
|
45
40
|
version: 0.6.1
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: nokogiri
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '1.16'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '1.16'
|
|
46
55
|
description: |
|
|
47
56
|
OpenMath 2 and OpenMath 3 XML encoding parsed into a typed model
|
|
48
57
|
declared with LutaML Model, with content-dictionary-aware semantics.
|
|
@@ -73,7 +82,22 @@ files:
|
|
|
73
82
|
- lib/openmath/base/oms.rb
|
|
74
83
|
- lib/openmath/base/omstr.rb
|
|
75
84
|
- lib/openmath/base/omv.rb
|
|
85
|
+
- lib/openmath/cd.rb
|
|
86
|
+
- lib/openmath/cd/collection.rb
|
|
87
|
+
- lib/openmath/cd/configuration.rb
|
|
88
|
+
- lib/openmath/cd/definition.rb
|
|
89
|
+
- lib/openmath/cd/document.rb
|
|
90
|
+
- lib/openmath/cd/example.rb
|
|
91
|
+
- lib/openmath/cd/fmp.rb
|
|
92
|
+
- lib/openmath/cd/namespace.rb
|
|
93
|
+
- lib/openmath/cd/validation.rb
|
|
76
94
|
- lib/openmath/common_elements.rb
|
|
95
|
+
- lib/openmath/evaluation.rb
|
|
96
|
+
- lib/openmath/evaluation/binding_table.rb
|
|
97
|
+
- lib/openmath/evaluation/error_value.rb
|
|
98
|
+
- lib/openmath/evaluation/errors.rb
|
|
99
|
+
- lib/openmath/evaluation/evaluator.rb
|
|
100
|
+
- lib/openmath/evaluation/operations.rb
|
|
77
101
|
- lib/openmath/namespace.rb
|
|
78
102
|
- lib/openmath/v2.rb
|
|
79
103
|
- lib/openmath/v2/common_elements.rb
|
|
@@ -93,12 +117,38 @@ files:
|
|
|
93
117
|
- lib/openmath/v2/oms.rb
|
|
94
118
|
- lib/openmath/v2/omstr.rb
|
|
95
119
|
- lib/openmath/v2/omv.rb
|
|
120
|
+
- lib/openmath/v3.rb
|
|
121
|
+
- lib/openmath/v3/common_elements.rb
|
|
122
|
+
- lib/openmath/v3/configuration.rb
|
|
123
|
+
- lib/openmath/v3/oma.rb
|
|
124
|
+
- lib/openmath/v3/omatp.rb
|
|
125
|
+
- lib/openmath/v3/omattr.rb
|
|
126
|
+
- lib/openmath/v3/omb.rb
|
|
127
|
+
- lib/openmath/v3/ombind.rb
|
|
128
|
+
- lib/openmath/v3/ombvar.rb
|
|
129
|
+
- lib/openmath/v3/ome.rb
|
|
130
|
+
- lib/openmath/v3/omf.rb
|
|
131
|
+
- lib/openmath/v3/omforeign.rb
|
|
132
|
+
- lib/openmath/v3/omi.rb
|
|
133
|
+
- lib/openmath/v3/omobj.rb
|
|
134
|
+
- lib/openmath/v3/omr.rb
|
|
135
|
+
- lib/openmath/v3/oms.rb
|
|
136
|
+
- lib/openmath/v3/omstr.rb
|
|
137
|
+
- lib/openmath/v3/omv.rb
|
|
138
|
+
- lib/openmath/validation.rb
|
|
96
139
|
- lib/openmath/version.rb
|
|
140
|
+
- schemas/PROVENANCE.md
|
|
141
|
+
- schemas/om3-common.rng
|
|
142
|
+
- schemas/omcd2.rng
|
|
143
|
+
- schemas/openmath2.rnc
|
|
144
|
+
- schemas/openmath2.rng
|
|
145
|
+
- schemas/openmath3.rng
|
|
97
146
|
homepage: https://github.com/plurimath/openmath
|
|
98
147
|
licenses:
|
|
99
148
|
- BSD-2-Clause
|
|
100
149
|
metadata:
|
|
101
150
|
rubygems_mfa_required: 'true'
|
|
151
|
+
post_install_message:
|
|
102
152
|
rdoc_options: []
|
|
103
153
|
require_paths:
|
|
104
154
|
- lib
|
|
@@ -113,7 +163,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
113
163
|
- !ruby/object:Gem::Version
|
|
114
164
|
version: '0'
|
|
115
165
|
requirements: []
|
|
116
|
-
rubygems_version:
|
|
166
|
+
rubygems_version: 3.5.22
|
|
167
|
+
signing_key:
|
|
117
168
|
specification_version: 4
|
|
118
169
|
summary: OpenMath parser by Plurimath.
|
|
119
170
|
test_files: []
|