Socket
Socket
Sign inDemoInstall

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 3.0.0 to 3.0.1

2

bin/sparqlalgebrajs.js

@@ -7,3 +7,3 @@ #! /usr/bin/env node

const sparql_1 = require("../lib/sparql");
const util_1 = require("../test/util");
const util_1 = require("../lib/util");
const args = minimist(process.argv.slice(2), {

@@ -10,0 +10,0 @@ boolean: ['q', 'r', 's'],

@@ -13,2 +13,6 @@ import { Wildcard } from 'sparqljs';

/**
* Outputs a JSON object corresponding to the input algebra-like.
*/
static objectify(algebra: any): any;
/**
* Detects all in-scope variables.

@@ -15,0 +19,0 @@ * In practice this means iterating through the entire algebra tree, finding all variables,

@@ -14,2 +14,37 @@ "use strict";

/**
* Outputs a JSON object corresponding to the input algebra-like.
*/
static objectify(algebra) {
if (algebra.termType) {
if (algebra.termType === 'Quad') {
return {
type: 'pattern',
termType: 'Quad',
value: '',
subject: Util.objectify(algebra.subject),
predicate: Util.objectify(algebra.predicate),
object: Util.objectify(algebra.object),
graph: Util.objectify(algebra.graph),
};
}
else {
let result = { termType: algebra.termType, value: algebra.value };
if (algebra.language)
result.language = algebra.language;
if (algebra.datatype)
result.datatype = Util.objectify(algebra.datatype);
return result;
}
}
if (Array.isArray(algebra))
return algebra.map(e => Util.objectify(e));
if (algebra === Object(algebra)) {
let result = {};
for (let key of Object.keys(algebra))
result[key] = Util.objectify(algebra[key]);
return result;
}
return algebra;
}
/**
* Detects all in-scope variables.

@@ -16,0 +51,0 @@ * In practice this means iterating through the entire algebra tree, finding all variables,

{
"name": "sparqlalgebrajs",
"version": "3.0.0",
"version": "3.0.1",
"description": "Convert SPARQL to SPARQL algebra",

@@ -26,5 +26,5 @@ "author": "Joachim Van Herwegen",

"@types/chai": "^4.2.18",
"@types/mocha": "^8.2.2",
"@types/mocha": "^9.0.0",
"chai": "^4.3.4",
"mocha": "^8.4.0",
"mocha": "^9.0.3",
"nyc": "^15.1.0",

@@ -31,0 +31,0 @@ "pre-commit": "^1.2.2",

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