@comunica/actor-rdf-parse-jsonld
Advanced tools
Comparing version 3.3.0 to 4.0.1-alpha.48.0
import type { MediatorHttp } from '@comunica/bus-http'; | ||
import type { IActionRdfParse, IActorRdfParseFixedMediaTypesArgs, IActorRdfParseOutput } from '@comunica/bus-rdf-parse'; | ||
import { ActorRdfParseFixedMediaTypes } from '@comunica/bus-rdf-parse'; | ||
import type { IActorTest } from '@comunica/core'; | ||
import type { IActorTest, TestResult } from '@comunica/core'; | ||
import type { IActionContext } from '@comunica/types'; | ||
@@ -25,3 +25,3 @@ /** | ||
constructor(args: IActorRdfParseJsonLdArgs); | ||
testHandle(action: IActionRdfParse, mediaType: string | undefined, context: IActionContext): Promise<IActorTest>; | ||
testHandle(action: IActionRdfParse, mediaType: string | undefined, context: IActionContext): Promise<TestResult<IActorTest>>; | ||
runHandle(action: IActionRdfParse, mediaType: string, actionContext: IActionContext): Promise<IActorRdfParseOutput>; | ||
@@ -28,0 +28,0 @@ } |
@@ -6,2 +6,3 @@ "use strict"; | ||
const context_entries_1 = require("@comunica/context-entries"); | ||
const core_1 = require("@comunica/core"); | ||
const jsonld_streaming_parser_1 = require("jsonld-streaming-parser"); | ||
@@ -31,6 +32,6 @@ const DocumentLoaderMediated_1 = require("./DocumentLoaderMediated"); | ||
if (context.has(context_entries_1.KeysRdfParseHtmlScript.processingHtmlScript) && mediaType !== 'application/ld+json') { | ||
throw new Error(`JSON-LD in script tags can only have media type 'application/ld+json'`); | ||
return (0, core_1.failTest)(`JSON-LD in script tags can only have media type 'application/ld+json'`); | ||
} | ||
if (!mediaType || !(mediaType in this.mediaTypePriorities || mediaType.endsWith('+json'))) { | ||
throw new Error(`Unrecognized media type: ${mediaType}`); | ||
return (0, core_1.failTest)(`Unrecognized media type: ${mediaType}`); | ||
} | ||
@@ -40,3 +41,5 @@ return await this.testHandleChecked(action); | ||
async runHandle(action, mediaType, actionContext) { | ||
const dataFactory = action.context.getSafe(context_entries_1.KeysInitQuery.dataFactory); | ||
const parser = jsonld_streaming_parser_1.JsonLdParser.fromHttpResponse(action.metadata?.baseIRI ?? '', mediaType, action.headers, { | ||
dataFactory, | ||
documentLoader: actionContext.get(context_entries_1.KeysRdfParseJsonLd.documentLoader) ?? | ||
@@ -43,0 +46,0 @@ new DocumentLoaderMediated_1.DocumentLoaderMediated(this.mediatorHttp, actionContext), |
{ | ||
"name": "@comunica/actor-rdf-parse-jsonld", | ||
"version": "3.3.0", | ||
"version": "4.0.1-alpha.48.0", | ||
"description": "A JSON-LD RDF Parse actor", | ||
"lsd:module": true, | ||
"license": "MIT", | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/comunica-association" | ||
}, | ||
"homepage": "https://comunica.dev/", | ||
@@ -38,12 +42,12 @@ "repository": { | ||
"dependencies": { | ||
"@comunica/bus-http": "^3.3.0", | ||
"@comunica/bus-rdf-parse": "^3.3.0", | ||
"@comunica/context-entries": "^3.3.0", | ||
"@comunica/core": "^3.3.0", | ||
"@comunica/types": "^3.3.0", | ||
"@comunica/bus-http": "4.0.1-alpha.48.0", | ||
"@comunica/bus-rdf-parse": "4.0.1-alpha.48.0", | ||
"@comunica/context-entries": "4.0.1-alpha.48.0", | ||
"@comunica/core": "4.0.1-alpha.48.0", | ||
"@comunica/types": "4.0.1-alpha.48.0", | ||
"@jeswr/stream-to-string": "^2.0.0", | ||
"jsonld-context-parser": "^2.2.2", | ||
"jsonld-streaming-parser": "^3.0.1" | ||
"jsonld-streaming-parser": "^4.0.1" | ||
}, | ||
"gitHead": "02bde397d206f1f5a523643a6a604c89e792e2f9" | ||
"gitHead": "4cc37905eab2c94a2e1d9cee0f51c53604f07da1" | ||
} |
@@ -25,3 +25,3 @@ # Comunica JSON-LD RDF Parse Actor | ||
... | ||
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-parse-jsonld/^3.0.0/components/context.jsonld" | ||
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-parse-jsonld/^4.0.0/components/context.jsonld" | ||
], | ||
@@ -28,0 +28,0 @@ "actors": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36745
140
1
+ Added@comunica/actor-abstract-mediatyped@4.0.1-alpha.48.0(transitive)
+ Added@comunica/actor-abstract-parse@4.0.1-alpha.48.0(transitive)
+ Added@comunica/bus-http@4.0.1-alpha.48.0(transitive)
+ Added@comunica/bus-rdf-parse@4.0.1-alpha.48.0(transitive)
+ Added@comunica/context-entries@4.0.1-alpha.48.0(transitive)
+ Added@comunica/core@4.0.1-alpha.48.0(transitive)
+ Added@comunica/types@4.0.1-alpha.48.0(transitive)
+ Addedjsonld-context-parser@3.0.0(transitive)
+ Addedjsonld-streaming-parser@4.0.1(transitive)
+ Addedlru-cache@10.4.3(transitive)
- Removed@comunica/actor-abstract-mediatyped@3.3.0(transitive)
- Removed@comunica/actor-abstract-parse@3.3.0(transitive)
- Removed@comunica/bus-http@3.3.0(transitive)
- Removed@comunica/bus-rdf-parse@3.3.0(transitive)
- Removed@comunica/context-entries@3.3.0(transitive)
- Removed@comunica/core@3.3.0(transitive)
- Removed@comunica/types@3.3.0(transitive)
- Removed@types/readable-stream@2.3.15(transitive)
- Removedjsonld-streaming-parser@3.4.0(transitive)