@comunica/actor-rdf-parse-n3
Advanced tools
Comparing version 1.22.0 to 2.0.1-alpha.5.0
import type { IActionRdfParse, IActorRdfParseFixedMediaTypesArgs, IActorRdfParseOutput } from '@comunica/bus-rdf-parse'; | ||
import { ActorRdfParseFixedMediaTypes } from '@comunica/bus-rdf-parse'; | ||
import type { ActionContext } from '@comunica/core'; | ||
import type { IActionContext } from '@comunica/types'; | ||
/** | ||
@@ -10,4 +10,21 @@ * An N3 RDF Parse actor that listens on the 'rdf-parse' bus. | ||
export declare class ActorRdfParseN3 extends ActorRdfParseFixedMediaTypes { | ||
/** | ||
* @param args - | ||
* \ @defaultNested {{ | ||
* "application/n-quads": 1.0, | ||
* "application/trig": 0.95, | ||
* "application/n-triples": 0.8, | ||
* "text/turtle": 0.6, | ||
* "text/n3": 0.35 | ||
* }} mediaTypePriorities | ||
* \ @defaultNested {{ | ||
* "application/n-quads": "http://www.w3.org/ns/formats/N-Quads", | ||
* "application/trig": "http://www.w3.org/ns/formats/TriG", | ||
* "application/n-triples": "http://www.w3.org/ns/formats/N-Triples", | ||
* "text/turtle": "http://www.w3.org/ns/formats/Turtle", | ||
* "text/n3": "http://www.w3.org/ns/formats/N3" | ||
* }} mediaTypeFormats | ||
*/ | ||
constructor(args: IActorRdfParseFixedMediaTypesArgs); | ||
runHandle(action: IActionRdfParse, mediaType: string, context: ActionContext): Promise<IActorRdfParseOutput>; | ||
runHandle(action: IActionRdfParse, mediaType: string, context: IActionContext): Promise<IActorRdfParseOutput>; | ||
} |
@@ -12,2 +12,19 @@ "use strict"; | ||
class ActorRdfParseN3 extends bus_rdf_parse_1.ActorRdfParseFixedMediaTypes { | ||
/** | ||
* @param args - | ||
* \ @defaultNested {{ | ||
* "application/n-quads": 1.0, | ||
* "application/trig": 0.95, | ||
* "application/n-triples": 0.8, | ||
* "text/turtle": 0.6, | ||
* "text/n3": 0.35 | ||
* }} mediaTypePriorities | ||
* \ @defaultNested {{ | ||
* "application/n-quads": "http://www.w3.org/ns/formats/N-Quads", | ||
* "application/trig": "http://www.w3.org/ns/formats/TriG", | ||
* "application/n-triples": "http://www.w3.org/ns/formats/N-Triples", | ||
* "text/turtle": "http://www.w3.org/ns/formats/Turtle", | ||
* "text/n3": "http://www.w3.org/ns/formats/N3" | ||
* }} mediaTypeFormats | ||
*/ | ||
constructor(args) { | ||
@@ -17,9 +34,11 @@ super(args); | ||
async runHandle(action, mediaType, context) { | ||
action.input.on('error', error => quads.emit('error', error)); | ||
const quads = action.input.pipe(new n3_1.StreamParser({ baseIRI: action.baseIRI })); | ||
action.data.on('error', error => data.emit('error', error)); | ||
const data = action.data.pipe(new n3_1.StreamParser({ baseIRI: action.metadata?.baseIRI })); | ||
return { | ||
quads, | ||
triples: mediaType === 'text/turtle' || | ||
mediaType === 'application/n-triples' || | ||
mediaType === 'text/n3', | ||
data, | ||
metadata: { | ||
triples: mediaType === 'text/turtle' || | ||
mediaType === 'application/n-triples' || | ||
mediaType === 'text/n3', | ||
}, | ||
}; | ||
@@ -26,0 +45,0 @@ } |
The MIT License (MIT) | ||
Copyright © 2017–2018 Ruben Taelman, Joachim Van Herwegen | ||
Ghent University – imec, Belgium | ||
Copyright © 2017–now Ruben Taelman, Joachim Van Herwegen | ||
Comunica Association and Ghent University – imec, Belgium | ||
@@ -6,0 +6,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
{ | ||
"name": "@comunica/actor-rdf-parse-n3", | ||
"version": "1.22.0", | ||
"version": "2.0.1-alpha.5.0", | ||
"description": "A N3 RDF Parse actor", | ||
"lsd:module": true, | ||
"main": "index.js", | ||
"typings": "index", | ||
"main": "lib/index.js", | ||
"typings": "lib/index", | ||
"repository": { | ||
@@ -28,41 +28,16 @@ "type": "git", | ||
"lib/**/*.d.ts", | ||
"lib/**/*.js", | ||
"index.d.ts", | ||
"index.js" | ||
"lib/**/*.js" | ||
], | ||
"peerDependencies": { | ||
"@comunica/bus-rdf-parse": "^1.0.0", | ||
"@comunica/core": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@comunica/bus-rdf-parse": "^1.22.0", | ||
"@comunica/core": "^1.22.0" | ||
}, | ||
"dependencies": { | ||
"@comunica/bus-rdf-parse": "2.0.1-alpha.5.0", | ||
"@comunica/core": "2.0.1-alpha.5.0", | ||
"@types/n3": "^1.4.4", | ||
"n3": "^1.6.3" | ||
}, | ||
"jest": { | ||
"globals": { | ||
"ts-jest": { | ||
"tsConfig": "../../tsconfig.json" | ||
} | ||
}, | ||
"transform": { | ||
"^.+\\.ts$": "ts-jest" | ||
}, | ||
"testRegex": "(/test/.*|(\\.|/)(test|spec))\\.ts$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"js" | ||
], | ||
"collectCoverage": true | ||
}, | ||
"scripts": { | ||
"test": "node \"../../node_modules/jest/bin/jest.js\" ${1}", | ||
"test-watch": "node \"../../node_modules/jest/bin/jest.js\" ${1} --watch", | ||
"build": "node \"../../node_modules/typescript/bin/tsc\"", | ||
"validate": "npm ls" | ||
"build": "npm run build:ts && npm run build:components", | ||
"build:ts": "node \"../../node_modules/typescript/bin/tsc\"", | ||
"build:components": "componentsjs-generator" | ||
}, | ||
"gitHead": "0a249ba341022eb2f1b9922fcf549a9564671d9f" | ||
"gitHead": "e2ae2e9e924bf0656df60cc99774f7e560d47695" | ||
} |
@@ -26,3 +26,3 @@ # Comunica N3 RDF Parse Actor | ||
... | ||
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-parse-n3/^1.0.0/components/context.jsonld" | ||
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-parse-n3/^2.0.0/components/context.jsonld" | ||
], | ||
@@ -32,3 +32,3 @@ "actors": [ | ||
{ | ||
"@id": "config-sets:rdf-parsers.json#myRdfParserN3", | ||
"@id": "urn:comunica:default:rdf-parse/actors#n3", | ||
"@type": "ActorRdfParseN3", | ||
@@ -43,2 +43,2 @@ "priorityScale": 1.0 | ||
* `caam:Actor/AbstractMediaTypedFixed/priorityScale`: An optional priority for this parser, used for content negotiation, defaults to `1`. | ||
* `priorityScale`: An optional priority for this parser, used for content negotiation, defaults to `1`. |
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
18792
0
88
2
+ Added@comunica/actor-abstract-mediatyped@2.0.1-alpha.5.0(transitive)
+ Added@comunica/actor-abstract-parse@2.0.1-alpha.5.0(transitive)
+ Added@comunica/bus-rdf-parse@2.0.1-alpha.5.0(transitive)
+ Added@comunica/context-entries@2.0.1-alpha.5.0(transitive)
+ Added@comunica/core@2.0.1-alpha.5.0(transitive)
+ Added@comunica/types@2.0.1-alpha.5.0(transitive)
+ Added@types/http-link-header@1.0.7(transitive)
+ Added@types/node@18.19.67(transitive)
+ Added@types/yargs@17.0.33(transitive)
+ Added@types/yargs-parser@21.0.3(transitive)
+ Addedcross-fetch@3.1.8(transitive)
+ Addedhttp-link-header@1.1.3(transitive)
+ Addedjsonld-context-parser@2.4.0(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedrelative-to-absolute-iri@1.0.7(transitive)
+ Addedsparqlalgebrajs@4.3.8(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedundici-types@5.26.5(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
- Removed@comunica/actor-abstract-mediatyped@1.22.0(transitive)
- Removed@comunica/bus-rdf-parse@1.22.0(transitive)
- Removed@comunica/context-entries@1.22.0(transitive)
- Removed@comunica/core@1.22.0(transitive)
- Removed@comunica/types@1.22.0(transitive)
- Removedsparqlalgebrajs@3.0.3(transitive)