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

@comunica/actor-rdf-parse-jsonld

Package Overview
Dependencies
Maintainers
3
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@comunica/actor-rdf-parse-jsonld - npm Package Compare versions

Comparing version 1.9.0 to 1.9.2

lib/DocumentLoaderMediated.d.ts

11

lib/ActorRdfParseJsonLd.d.ts

@@ -0,3 +1,4 @@

import { IActionHttp, IActorHttpOutput } from "@comunica/bus-http";
import { ActorRdfParseFixedMediaTypes, IActionRdfParse, IActorRdfParseFixedMediaTypesArgs, IActorRdfParseOutput } from "@comunica/bus-rdf-parse";
import { ActionContext } from "@comunica/core";
import { ActionContext, Actor, IActorTest, Mediator } from "@comunica/core";
/**

@@ -9,4 +10,8 @@ * A JSON-LD RDF Parse actor that listens on the 'rdf-parse' bus.

export declare class ActorRdfParseJsonLd extends ActorRdfParseFixedMediaTypes {
constructor(args: IActorRdfParseFixedMediaTypesArgs);
runHandle(action: IActionRdfParse, mediaType: string, context: ActionContext): Promise<IActorRdfParseOutput>;
readonly mediatorHttp: Mediator<Actor<IActionHttp, IActorTest, IActorHttpOutput>, IActionHttp, IActorTest, IActorHttpOutput>;
constructor(args: IActorRdfParseJsonLdArgs);
runHandle(action: IActionRdfParse, mediaType: string, actionContext: ActionContext): Promise<IActorRdfParseOutput>;
}
export interface IActorRdfParseJsonLdArgs extends IActorRdfParseFixedMediaTypesArgs {
mediatorHttp: Mediator<Actor<IActionHttp, IActorTest, IActorHttpOutput>, IActionHttp, IActorTest, IActorHttpOutput>;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const bus_rdf_parse_1 = require("@comunica/bus-rdf-parse");
const http_link_header_1 = require("http-link-header");
const jsonld_streaming_parser_1 = require("jsonld-streaming-parser");
const DocumentLoaderMediated_1 = require("./DocumentLoaderMediated");
/**

@@ -14,5 +16,23 @@ * A JSON-LD RDF Parse actor that listens on the 'rdf-parse' bus.

}
async runHandle(action, mediaType, context) {
const quads = new jsonld_streaming_parser_1.JsonLdParser({ baseIRI: action.baseIRI, allowOutOfOrderContext: true })
.import(action.input);
async runHandle(action, mediaType, actionContext) {
// Try to extract a JSON-LD context link header (https://w3c.github.io/json-ld-syntax/#interpreting-json-as-json-ld)
let context;
if (mediaType !== 'application/ld+json' && action.headers && action.headers.has('Link')) {
const linkHeader = http_link_header_1.parse(action.headers.get('Link'));
for (const link of linkHeader.get('rel', 'http://www.w3.org/ns/json-ld#context')) {
if (link.type === 'application/ld+json') {
if (context) {
throw new Error('Multiple JSON-LD context link headers were found on ' + action.baseIRI);
}
context = link.uri;
}
}
}
// Parse the JSON-LD
const quads = new jsonld_streaming_parser_1.JsonLdParser({
allowOutOfOrderContext: true,
baseIRI: action.baseIRI,
context,
documentLoader: new DocumentLoaderMediated_1.DocumentLoaderMediated(this.mediatorHttp, actionContext),
}).import(action.input);
return { quads };

@@ -19,0 +39,0 @@ }

{
"name": "@comunica/actor-rdf-parse-jsonld",
"version": "1.9.0",
"version": "1.9.2",
"description": "A JSON-LD RDF Parse actor",

@@ -36,2 +36,3 @@ "lsd:module": "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-parse-jsonld",

"peerDependencies": {
"@comunica/bus-http": "^1.0.0",
"@comunica/bus-rdf-parse": "^1.0.0",

@@ -41,6 +42,9 @@ "@comunica/core": "^1.0.0"

"devDependencies": {
"@comunica/bus-rdf-parse": "^1.9.0",
"@comunica/core": "^1.9.0"
"@comunica/bus-http": "^1.9.2",
"@comunica/bus-rdf-parse": "^1.9.2",
"@comunica/core": "^1.9.2"
},
"dependencies": {
"@types/http-link-header": "^1.0.1",
"http-link-header": "^1.0.2",
"jsonld-streaming-parser": "^1.1.0"

@@ -71,3 +75,3 @@ },

},
"gitHead": "2e0cba815fd65d5660f15c96ffc734f9099d8b6a"
"gitHead": "bb6eef43498d23416b4e063d93e73c49f5575ff4"
}

Sorry, the diff of this file is not supported yet

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