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

shaclc-parse

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shaclc-parse - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

1

lib/index.d.ts

@@ -5,4 +5,5 @@ import { Quad } from '@rdfjs/types';

extendedSyntax?: boolean;
baseIRI?: string;
}
export declare function parse(str: string, options?: ParseOptions): Quad[] & { prefixes: Record<string, string> };

21

lib/index.js
const ShaclcParser = require('./ShaclcParser').Parser;
const N3 = require('n3');
// const arr = [];
// this._parser.Parser = {
// factory: N3.DataFactory,
// base: N3.DataFactory.namedNode('urn:x-base:default'),
// prefixes: {
// rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
// rdfs: 'http://www.w3.org/2000/01/rdf-schema#',
// sh: 'http://www.w3.org/ns/shacl#',
// xsd: 'http://www.w3.org/2001/XMLSchema#'
// },
// onQuad: (quad) => { arr.push(quad) },
// extended: extendedSyntax === true
// }
class Parser {

@@ -23,7 +8,7 @@ constructor() {

parse(str, { extendedSyntax } = {}) {
parse(str, { extendedSyntax, baseIRI } = {}) {
this._parser = new ShaclcParser();
this._parser.Parser.factory = N3.DataFactory;
this._parser.Parser.base = N3.DataFactory.namedNode('urn:x-base:default');
this._parser.Parser.base = N3.DataFactory.namedNode(baseIRI || 'urn:x-base:default');
this._parser.Parser.extended = extendedSyntax === true;

@@ -40,3 +25,3 @@ this._parser.Parser.prefixes = {

this._parser.Parser.tempCurrentNodeShape = undefined;
this._parser.Parser.n3Parser = new N3.Parser({ baseIRI: 'urn:x-base:default' });
this._parser.Parser.n3Parser = new N3.Parser({ baseIRI: baseIRI || 'urn:x-base:default' });

@@ -43,0 +28,0 @@ const arr = []

{
"name": "shaclc-parse",
"version": "1.3.1",
"version": "1.4.0",
"description": "A parser for files written with SHACL compact syntax",

@@ -5,0 +5,0 @@ "main": "lib/index.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