@rmlio/yarrrml-parser
Advanced tools
Comparing version 0.3.10 to 0.3.11
@@ -10,2 +10,7 @@ # Changelog | ||
## [0.3.11] - 2019-12-02 | ||
### Fixed | ||
- Object is number (see [issue 32](https://github.com/RMLio/yarrrml-parser/issues/32)) | ||
## [0.3.10] - 2019-10-28 | ||
@@ -120,2 +125,3 @@ | ||
[0.3.11]: https://github.com/RMLio/yarrrml-parser/compare/v0.3.10...v0.3.11 | ||
[0.3.10]: https://github.com/RMLio/yarrrml-parser/compare/v0.3.9...v0.3.10 | ||
@@ -122,0 +128,0 @@ [0.3.9]: https://github.com/RMLio/yarrrml-parser/compare/v0.3.8...v0.3.9 |
@@ -196,4 +196,4 @@ /** | ||
if (typeof po.objects === 'string') { | ||
po.objects = [po.objects]; | ||
if (typeof po.objects === 'string' || typeof po.objects === 'number') { | ||
po.objects = ['' + po.objects]; | ||
} else if (typeof po.objects === 'object' && !Array.isArray(po.objects)) { | ||
@@ -200,0 +200,0 @@ po.objects = [po.objects] |
@@ -453,2 +453,33 @@ /** | ||
}); | ||
it('object is number', () => { | ||
const input = { | ||
mappings: { | ||
person: { | ||
predicateobjects: [ | ||
["schema:test", 2] | ||
] | ||
} | ||
} | ||
}; | ||
const expectedOutput = { | ||
mappings: { | ||
person: { | ||
predicateobjects: [ | ||
{ | ||
predicates: ["schema:test"], | ||
objects: [{ | ||
value: "2", | ||
type: 'literal' | ||
}] | ||
} | ||
] | ||
} | ||
} | ||
}; | ||
const output = expand(input); | ||
assert.deepStrictEqual(output, expectedOutput); | ||
}); | ||
}); | ||
@@ -455,0 +486,0 @@ |
@@ -135,2 +135,6 @@ /** | ||
}); | ||
it('object is number', function (done) { | ||
work('object-number/mapping.yarrrml', 'object-number/mapping.rml.ttl', done); | ||
}); | ||
}); | ||
@@ -137,0 +141,0 @@ |
{ | ||
"name": "@rmlio/yarrrml-parser", | ||
"version": "0.3.10", | ||
"version": "0.3.11", | ||
"description": "Parse YARRRML descriptions into RML RDF statements", | ||
@@ -5,0 +5,0 @@ "main": "lib/yarrrml2rml.js", |
288914
120
3383