Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sparqlalgebrajs

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sparqlalgebrajs - npm Package Compare versions

Comparing version 0.7.2 to 0.7.3

27

lib/sparql.js

@@ -16,3 +16,6 @@ "use strict";

op = removeQuads(op);
return translateOperation(op);
let result = translateOperation(op);
if (result.type === 'group')
return result.patterns[0];
return result;
}

@@ -126,2 +129,7 @@ exports.toSparqlJs = toSparqlJs;

function translateOperatorExpression(expr) {
if (expr.operator === 'desc') {
let result = { expression: translateExpression(expr.args[0]) };
result.descending = true;
return result;
}
let result = {

@@ -166,3 +174,4 @@ type: 'operation',

let result = translateOperation(op.input);
result.distinct = true;
// project is nested in group object
result.patterns[0].distinct = true;
return result;

@@ -335,4 +344,5 @@ }

});
// descending expressions will already be in the correct format due to the structure of those
if (context.order.length > 0)
result.order = context.order.map(translateOperation).map(o => ({ expression: o }));
result.order = context.order.map(translateOperation).map(o => o.descending ? o : ({ expression: o }));
// this needs to happen after the group because it might depend on variables generated there

@@ -365,2 +375,4 @@ if (result.variables) {

context.order = order;
// subqueries need to be in a group
result = { type: 'group', patterns: [result] };
return result;

@@ -377,3 +389,4 @@ }

let result = translateOperation(op.input);
result.reduced = true;
// project is nested in group object
result.patterns[0].reduced = true;
return result;

@@ -383,6 +396,8 @@ }

let result = translateOperation(op.input);
// project is nested in group object
let obj = result.patterns[0];
if (op.start !== 0)
result.offset = op.start;
obj.offset = op.start;
if (op.length !== undefined)
result.limit = op.length;
obj.limit = op.length;
return result;

@@ -389,0 +404,0 @@ }

{
"name": "sparqlalgebrajs",
"version": "0.7.2",
"version": "0.7.3",
"description": "Convert SPARQL to SPARL algebra",

@@ -16,3 +16,4 @@ "author": "Joachim Van Herwegen",

"rdf-data-model": "^1.0.0",
"sparqljs": "^2.0.2"
"rdf-string": "^1.1.1",
"sparqljs": "^2.0.3"
},

@@ -19,0 +20,0 @@ "devDependencies": {

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