New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@rmlio/yarrrml-parser

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rmlio/yarrrml-parser - npm Package Compare versions

Comparing version 0.3.5 to 0.3.6

test/condition-function-on-po/mapping.rml.ttl

6

CHANGELOG.md

@@ -10,2 +10,7 @@ # Changelog

## [0.3.6] - 2019-08-12
### Fixed
- Condition and function on the same predicate object (see [issue 17](https://github.com/RMLio/yarrrml-parser/issues/17))
## [0.3.5] - 2019-08-05

@@ -89,2 +94,3 @@

[0.3.6]: https://github.com/RMLio/yarrrml-parser/compare/v0.3.5...v0.3.6
[0.3.5]: https://github.com/RMLio/yarrrml-parser/compare/v0.3.4...v0.3.5

@@ -91,0 +97,0 @@ [0.3.4]: https://github.com/RMLio/yarrrml-parser/compare/v0.3.3...v0.3.4

5

lib/expander.js

@@ -373,4 +373,5 @@ /**

parameter: idlabfn + 'str',
value: o.value,
from: 'subject'
value: o.function ? o : o.value,
type: o.type,
from: o.function ? 'function' : 'subject'
}

@@ -377,0 +378,0 @@ ],

@@ -566,2 +566,157 @@ /**

});
it('condition and function on same po', () => {
const input = {
mappings: {
person: {
po: [
{
predicates: 'foaf:firstName',
objects: [
{
function: 'grel:toUpperCase',
parameters: [
{
parameter: 'grel:valueParamter',
value: '$(firstname)'
}
]
}
],
condition: {
function: 'idlab-fn:stringContainsOtherString',
parameters: [
{
parameter: 'idlab-fn:str',
value: '$(firstname)'
},
{
parameter: 'idlab-fn:otherStr',
value: 'J'
},
{
parameter: 'idlab-fn:delimiter',
value: ''
}
]
}
}
]
}
}
};
const expectedOutput = {
mappings:
{
person:
{
predicateobjects:
[{
predicates: ['foaf:firstName'],
objects:
[{
function: 'http://example.com/idlab/function/trueCondition',
parameters:
[{
parameter: 'http://example.com/idlab/function/strBoolean',
value:
{
function: 'idlab-fn:stringContainsOtherString',
parameters:
[{parameter: 'idlab-fn:str', value: '$(firstname)'},
{parameter: 'idlab-fn:otherStr', value: 'J'},
{parameter: 'idlab-fn:delimiter', value: ''}]
},
from: 'function'
},
{
parameter: 'http://example.com/idlab/function/str',
value:
{
function: 'grel:toUpperCase',
parameters:
[{parameter: 'grel:valueParamter', value: '$(firstname)'}]
},
type: undefined,
from: 'function'
}],
type: undefined
}]
}]
}
}
}
;
const output = expand(input);
assert.deepStrictEqual(output, expectedOutput);
});
it('condition on po', () => {
const input = {
mappings: {
person: {
po: [
{
predicates: 'foaf:firstName',
objects: '$(firstname)',
condition: {
function: 'idlab-fn:equal',
parameters: [
{
parameter: 'grel:valueParameter',
value: '$(firstname)'
},
{
parameter: 'grel:valueParameter2',
value: 'test'
}
]
}
}
]
}
}
};
const expectedOutput = {
mappings:
{
person:
{
predicateobjects:
[{
predicates: ['foaf:firstName'],
objects:
[{
function: 'http://example.com/idlab/function/trueCondition',
parameters:
[{
parameter: 'http://example.com/idlab/function/strBoolean',
value:
{
function: 'idlab-fn:equal',
parameters:
[{parameter: 'grel:valueParameter', value: '$(firstname)'},
{parameter: 'grel:valueParameter2', value: 'test'}]
},
from: 'function'
},
{
parameter: 'http://example.com/idlab/function/str',
value: '$(firstname)',
type: 'literal',
from: 'subject'
}],
type: 'literal'
}]
}]
}
}
};
const output = expand(input);
assert.deepStrictEqual(output, expectedOutput);
});
});

4

lib/yarrrml2rml.test.js

@@ -107,2 +107,6 @@ /**

});
it('condition and function on same po', function (done) {
work('condition-function-on-po/mapping.yarrrml', 'condition-function-on-po/mapping.rml.ttl', done);
});
});

@@ -109,0 +113,0 @@

{
"name": "@rmlio/yarrrml-parser",
"version": "0.3.5",
"version": "0.3.6",
"description": "Parse YARRRML descriptions into RML RDF statements",

@@ -5,0 +5,0 @@ "main": "lib/yarrrml2rml.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc