eyeling 1.7.18 → 1.7.19
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.
- package/examples/output/json-reconcile-vat.n3 +151 -0
- package/eyeling.js +25 -10
- package/package.json +1 -1
|
@@ -73,3 +73,154 @@ genid:8e2eaee7-90fd-39b8-cf83-6d8c8e5816c8 ex:email "ada@other.example" .
|
|
|
73
73
|
<urn:example:customer:vat:NL999999999B01> a ex:CustomerEmailConflict .
|
|
74
74
|
<urn:example:customer:vat:NL999999999B01> ex:conflictingEmail "acct@company.nl" .
|
|
75
75
|
<urn:example:customer:vat:NL999999999B01> ex:conflictingEmail "billing@company.nl" .
|
|
76
|
+
<urn:example:order:A100> ex:line <urn:example:order:A100#line:0> .
|
|
77
|
+
<urn:example:order:A100#line:0> a ex:OrderLine .
|
|
78
|
+
<urn:example:order:A100#line:0> ex:lineIndex 0 .
|
|
79
|
+
<urn:example:order:A100#line:0> ex:product ex:Widget .
|
|
80
|
+
<urn:example:order:A100#line:0> ex:sku "WID-001" .
|
|
81
|
+
<urn:example:order:A100#line:0> ex:qty 2 .
|
|
82
|
+
<urn:example:order:A100#line:0> ex:unitCents 999 .
|
|
83
|
+
<urn:example:order:A100#line:0> ex:netCents 1998 .
|
|
84
|
+
<urn:example:order:A100> ex:line <urn:example:order:A100#line:1> .
|
|
85
|
+
<urn:example:order:A100#line:1> a ex:OrderLine .
|
|
86
|
+
<urn:example:order:A100#line:1> ex:lineIndex 1 .
|
|
87
|
+
<urn:example:order:A100#line:1> ex:product ex:Gadget .
|
|
88
|
+
<urn:example:order:A100#line:1> ex:sku "GAD-002" .
|
|
89
|
+
<urn:example:order:A100#line:1> ex:qty 1 .
|
|
90
|
+
<urn:example:order:A100#line:1> ex:unitCents 1500 .
|
|
91
|
+
<urn:example:order:A100#line:1> ex:netCents 1500 .
|
|
92
|
+
<urn:example:order:A200> ex:line <urn:example:order:A200#line:0> .
|
|
93
|
+
<urn:example:order:A200#line:0> a ex:OrderLine .
|
|
94
|
+
<urn:example:order:A200#line:0> ex:lineIndex 0 .
|
|
95
|
+
<urn:example:order:A200#line:0> ex:product ex:Widget .
|
|
96
|
+
<urn:example:order:A200#line:0> ex:sku "WID-001" .
|
|
97
|
+
<urn:example:order:A200#line:0> ex:qty 2 .
|
|
98
|
+
<urn:example:order:A200#line:0> ex:unitCents 999 .
|
|
99
|
+
<urn:example:order:A200#line:0> ex:netCents 1998 .
|
|
100
|
+
<urn:example:order:A200> ex:line <urn:example:order:A200#line:1> .
|
|
101
|
+
<urn:example:order:A200#line:1> a ex:OrderLine .
|
|
102
|
+
<urn:example:order:A200#line:1> ex:lineIndex 1 .
|
|
103
|
+
<urn:example:order:A200#line:1> ex:product ex:Gadget .
|
|
104
|
+
<urn:example:order:A200#line:1> ex:sku "GAD-002" .
|
|
105
|
+
<urn:example:order:A200#line:1> ex:qty 1 .
|
|
106
|
+
<urn:example:order:A200#line:1> ex:unitCents 1500 .
|
|
107
|
+
<urn:example:order:A200#line:1> ex:netCents 1500 .
|
|
108
|
+
<urn:example:order:A300> ex:line <urn:example:order:A300#line:0> .
|
|
109
|
+
<urn:example:order:A300#line:0> a ex:OrderLine .
|
|
110
|
+
<urn:example:order:A300#line:0> ex:lineIndex 0 .
|
|
111
|
+
<urn:example:order:A300#line:0> ex:product ex:Widget .
|
|
112
|
+
<urn:example:order:A300#line:0> ex:sku "WID-001" .
|
|
113
|
+
<urn:example:order:A300#line:0> ex:qty 2 .
|
|
114
|
+
<urn:example:order:A300#line:0> ex:unitCents 999 .
|
|
115
|
+
<urn:example:order:A300#line:0> ex:netCents 1998 .
|
|
116
|
+
<urn:example:order:A300> ex:line <urn:example:order:A300#line:1> .
|
|
117
|
+
<urn:example:order:A300#line:1> a ex:OrderLine .
|
|
118
|
+
<urn:example:order:A300#line:1> ex:lineIndex 1 .
|
|
119
|
+
<urn:example:order:A300#line:1> ex:product ex:Gadget .
|
|
120
|
+
<urn:example:order:A300#line:1> ex:sku "GAD-002" .
|
|
121
|
+
<urn:example:order:A300#line:1> ex:qty 1 .
|
|
122
|
+
<urn:example:order:A300#line:1> ex:unitCents 1500 .
|
|
123
|
+
<urn:example:order:A300#line:1> ex:netCents 1500 .
|
|
124
|
+
<urn:example:order:A301> ex:line <urn:example:order:A301#line:0> .
|
|
125
|
+
<urn:example:order:A301#line:0> a ex:OrderLine .
|
|
126
|
+
<urn:example:order:A301#line:0> ex:lineIndex 0 .
|
|
127
|
+
<urn:example:order:A301#line:0> ex:product ex:Widget .
|
|
128
|
+
<urn:example:order:A301#line:0> ex:sku "WID-001" .
|
|
129
|
+
<urn:example:order:A301#line:0> ex:qty 2 .
|
|
130
|
+
<urn:example:order:A301#line:0> ex:unitCents 999 .
|
|
131
|
+
<urn:example:order:A301#line:0> ex:netCents 1998 .
|
|
132
|
+
<urn:example:order:A301> ex:line <urn:example:order:A301#line:1> .
|
|
133
|
+
<urn:example:order:A301#line:1> a ex:OrderLine .
|
|
134
|
+
<urn:example:order:A301#line:1> ex:lineIndex 1 .
|
|
135
|
+
<urn:example:order:A301#line:1> ex:product ex:Gadget .
|
|
136
|
+
<urn:example:order:A301#line:1> ex:sku "GAD-002" .
|
|
137
|
+
<urn:example:order:A301#line:1> ex:qty 1 .
|
|
138
|
+
<urn:example:order:A301#line:1> ex:unitCents 1500 .
|
|
139
|
+
<urn:example:order:A301#line:1> ex:netCents 1500 .
|
|
140
|
+
<urn:example:order:A400> ex:line <urn:example:order:A400#line:0> .
|
|
141
|
+
<urn:example:order:A400#line:0> a ex:OrderLine .
|
|
142
|
+
<urn:example:order:A400#line:0> ex:lineIndex 0 .
|
|
143
|
+
<urn:example:order:A400#line:0> ex:product ex:Widget .
|
|
144
|
+
<urn:example:order:A400#line:0> ex:sku "WID-001" .
|
|
145
|
+
<urn:example:order:A400#line:0> ex:qty 2 .
|
|
146
|
+
<urn:example:order:A400#line:0> ex:unitCents 999 .
|
|
147
|
+
<urn:example:order:A400#line:0> ex:netCents 1998 .
|
|
148
|
+
<urn:example:order:A400> ex:line <urn:example:order:A400#line:1> .
|
|
149
|
+
<urn:example:order:A400#line:1> a ex:OrderLine .
|
|
150
|
+
<urn:example:order:A400#line:1> ex:lineIndex 1 .
|
|
151
|
+
<urn:example:order:A400#line:1> ex:product ex:Gadget .
|
|
152
|
+
<urn:example:order:A400#line:1> ex:sku "GAD-002" .
|
|
153
|
+
<urn:example:order:A400#line:1> ex:qty 1 .
|
|
154
|
+
<urn:example:order:A400#line:1> ex:unitCents 1500 .
|
|
155
|
+
<urn:example:order:A400#line:1> ex:netCents 1500 .
|
|
156
|
+
<urn:example:order:A200#line:0> ex:vatBps 0 .
|
|
157
|
+
<urn:example:order:A200#line:0> ex:vatCents 0 .
|
|
158
|
+
<urn:example:order:A200#line:0> ex:grossCents 1998 .
|
|
159
|
+
<urn:example:order:A200#line:0> ex:vatReason ex:Export .
|
|
160
|
+
<urn:example:order:A200#line:1> ex:vatBps 0 .
|
|
161
|
+
<urn:example:order:A200#line:1> ex:vatCents 0 .
|
|
162
|
+
<urn:example:order:A200#line:1> ex:grossCents 1500 .
|
|
163
|
+
<urn:example:order:A200#line:1> ex:vatReason ex:Export .
|
|
164
|
+
<urn:example:order:A300#line:0> ex:vatBps 0 .
|
|
165
|
+
<urn:example:order:A300#line:0> ex:vatCents 0 .
|
|
166
|
+
<urn:example:order:A300#line:0> ex:grossCents 1998 .
|
|
167
|
+
<urn:example:order:A300#line:0> ex:vatReason ex:ReverseCharge .
|
|
168
|
+
<urn:example:order:A300#line:1> ex:vatBps 0 .
|
|
169
|
+
<urn:example:order:A300#line:1> ex:vatCents 0 .
|
|
170
|
+
<urn:example:order:A300#line:1> ex:grossCents 1500 .
|
|
171
|
+
<urn:example:order:A300#line:1> ex:vatReason ex:ReverseCharge .
|
|
172
|
+
<urn:example:order:A301#line:0> ex:vatBps 0 .
|
|
173
|
+
<urn:example:order:A301#line:0> ex:vatCents 0 .
|
|
174
|
+
<urn:example:order:A301#line:0> ex:grossCents 1998 .
|
|
175
|
+
<urn:example:order:A301#line:0> ex:vatReason ex:ReverseCharge .
|
|
176
|
+
<urn:example:order:A301#line:1> ex:vatBps 0 .
|
|
177
|
+
<urn:example:order:A301#line:1> ex:vatCents 0 .
|
|
178
|
+
<urn:example:order:A301#line:1> ex:grossCents 1500 .
|
|
179
|
+
<urn:example:order:A301#line:1> ex:vatReason ex:ReverseCharge .
|
|
180
|
+
<urn:example:order:A100#line:0> ex:vatBps 2100 .
|
|
181
|
+
<urn:example:order:A100#line:0> ex:vatCents 419 .
|
|
182
|
+
<urn:example:order:A100#line:0> ex:grossCents 2417 .
|
|
183
|
+
<urn:example:order:A100#line:0> ex:vatReason ex:Domestic .
|
|
184
|
+
<urn:example:order:A100#line:1> ex:vatBps 600 .
|
|
185
|
+
<urn:example:order:A100#line:1> ex:vatCents 90 .
|
|
186
|
+
<urn:example:order:A100#line:1> ex:grossCents 1590 .
|
|
187
|
+
<urn:example:order:A100#line:1> ex:vatReason ex:Domestic .
|
|
188
|
+
<urn:example:order:A400#line:0> ex:vatBps 2100 .
|
|
189
|
+
<urn:example:order:A400#line:0> ex:vatCents 419 .
|
|
190
|
+
<urn:example:order:A400#line:0> ex:grossCents 2417 .
|
|
191
|
+
<urn:example:order:A400#line:0> ex:vatReason ex:Domestic .
|
|
192
|
+
<urn:example:order:A400#line:1> ex:vatBps 600 .
|
|
193
|
+
<urn:example:order:A400#line:1> ex:vatCents 90 .
|
|
194
|
+
<urn:example:order:A400#line:1> ex:grossCents 1590 .
|
|
195
|
+
<urn:example:order:A400#line:1> ex:vatReason ex:Domestic .
|
|
196
|
+
<urn:example:order:A100> ex:computedNetCents 3498 .
|
|
197
|
+
<urn:example:order:A100> ex:computedVatCents 509 .
|
|
198
|
+
<urn:example:order:A100> ex:computedGrossCents 4007 .
|
|
199
|
+
<urn:example:order:A200> ex:computedNetCents 3498 .
|
|
200
|
+
<urn:example:order:A200> ex:computedVatCents 0 .
|
|
201
|
+
<urn:example:order:A200> ex:computedGrossCents 3498 .
|
|
202
|
+
<urn:example:order:A300> ex:computedNetCents 3498 .
|
|
203
|
+
<urn:example:order:A300> ex:computedVatCents 0 .
|
|
204
|
+
<urn:example:order:A300> ex:computedGrossCents 3498 .
|
|
205
|
+
<urn:example:order:A301> ex:computedNetCents 3498 .
|
|
206
|
+
<urn:example:order:A301> ex:computedVatCents 0 .
|
|
207
|
+
<urn:example:order:A301> ex:computedGrossCents 3498 .
|
|
208
|
+
<urn:example:order:A400> ex:computedNetCents 3498 .
|
|
209
|
+
<urn:example:order:A400> ex:computedVatCents 509 .
|
|
210
|
+
<urn:example:order:A400> ex:computedGrossCents 4007 .
|
|
211
|
+
<urn:example:order:A100> a ex:OrderOk .
|
|
212
|
+
<urn:example:order:A200> a ex:OrderOk .
|
|
213
|
+
<urn:example:order:A300> a ex:OrderOk .
|
|
214
|
+
<urn:example:order:A301> a ex:OrderOk .
|
|
215
|
+
<urn:example:issue:A400:vat> a ex:Issue .
|
|
216
|
+
<urn:example:issue:A400:vat> ex:onOrder <urn:example:order:A400> .
|
|
217
|
+
<urn:example:issue:A400:vat> ex:field "vatCents" .
|
|
218
|
+
<urn:example:issue:A400:vat> ex:declared 508 .
|
|
219
|
+
<urn:example:issue:A400:vat> ex:computed 509 .
|
|
220
|
+
<urn:example:order:A400> ex:hasIssue <urn:example:issue:A400:vat> .
|
|
221
|
+
<urn:example:issue:A400:gross> a ex:Issue .
|
|
222
|
+
<urn:example:issue:A400:gross> ex:onOrder <urn:example:order:A400> .
|
|
223
|
+
<urn:example:issue:A400:gross> ex:field "grossCents" .
|
|
224
|
+
<urn:example:issue:A400:gross> ex:declared 4006 .
|
|
225
|
+
<urn:example:issue:A400:gross> ex:computed 4007 .
|
|
226
|
+
<urn:example:order:A400> ex:hasIssue <urn:example:issue:A400:gross> .
|
package/eyeling.js
CHANGED
|
@@ -3081,19 +3081,34 @@ function termToJsXsdStringNoLang(t) {
|
|
|
3081
3081
|
}
|
|
3082
3082
|
|
|
3083
3083
|
function termToJsString(t) {
|
|
3084
|
-
//
|
|
3085
|
-
//
|
|
3086
|
-
//
|
|
3087
|
-
//
|
|
3084
|
+
// Domain is xsd:string for SWAP/N3 string builtins (string:*).
|
|
3085
|
+
//
|
|
3086
|
+
// Per the N3 Builtins spec, when the domain is xsd:string we must be able to
|
|
3087
|
+
// cast *any* IRI or literal value (incl. numeric, boolean, dateTime, anyURI,
|
|
3088
|
+
// rdf:langString, and plain literals) to a string.
|
|
3089
|
+
//
|
|
3090
|
+
// We implement this as:
|
|
3091
|
+
// - IRI -> its IRI string
|
|
3092
|
+
// - Literal:
|
|
3093
|
+
// * quoted lexical form: decode N3/Turtle escapes and strip quotes
|
|
3094
|
+
// * unquoted lexical form: use as-is (e.g., 1234, true, 1971-..., 1.23E4)
|
|
3095
|
+
// - Everything else (blank nodes, lists, formulas, vars) -> fail
|
|
3096
|
+
if (t instanceof Iri) return t.value;
|
|
3088
3097
|
if (!(t instanceof Literal)) return null;
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3098
|
+
|
|
3099
|
+
const [lex, _dt] = literalParts(t.value);
|
|
3100
|
+
|
|
3101
|
+
if (isQuotedLexical(lex)) {
|
|
3102
|
+
// Interpret N3/Turtle string escapes (\" \n \uXXXX \UXXXXXXXX …)
|
|
3103
|
+
// to obtain the actual string value.
|
|
3104
|
+
return decodeN3StringEscapes(stripQuotes(lex));
|
|
3105
|
+
}
|
|
3106
|
+
|
|
3107
|
+
// Unquoted lexical (numbers/booleans/dateTimes, etc.)
|
|
3108
|
+
return typeof lex === 'string' ? lex : String(lex);
|
|
3095
3109
|
}
|
|
3096
3110
|
|
|
3111
|
+
|
|
3097
3112
|
function makeStringLiteral(str) {
|
|
3098
3113
|
// JSON.stringify gives us a valid N3/Turtle-style quoted string
|
|
3099
3114
|
// (with proper escaping for quotes, backslashes, newlines, …).
|