@comunica/actor-rdf-parse-html-script 3.3.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/components/ActorRdfParseHtmlScript.jsonld +44 -12
- package/components/components.jsonld +1 -1
- package/components/context.jsonld +7 -1
- package/lib/ActorRdfParseHtmlScript.d.ts +2 -2
- package/lib/ActorRdfParseHtmlScript.js +2 -1
- package/lib/ActorRdfParseHtmlScript.js.map +1 -1
- package/package.json +12 -8
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ After installing, this package can be added to your engine's configuration as fo
|
|
|
23
23
|
{
|
|
24
24
|
"@context": [
|
|
25
25
|
...
|
|
26
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-parse-html-script/^
|
|
26
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-parse-html-script/^4.0.0/components/context.jsonld"
|
|
27
27
|
],
|
|
28
28
|
"actors": [
|
|
29
29
|
...
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-parse-html-script/^
|
|
4
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^
|
|
5
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-parse-html/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-parse-html-script/^4.0.0/components/context.jsonld",
|
|
4
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^4.0.0/components/context.jsonld",
|
|
5
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-parse-html/^4.0.0/components/context.jsonld"
|
|
6
6
|
],
|
|
7
7
|
"@id": "npmd:@comunica/actor-rdf-parse-html-script",
|
|
8
8
|
"components": [
|
|
@@ -45,29 +45,37 @@
|
|
|
45
45
|
"genericTypeInstances": [
|
|
46
46
|
{
|
|
47
47
|
"@type": "ParameterRangeGenericTypeReference",
|
|
48
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
48
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
"@type": "ParameterRangeGenericTypeReference",
|
|
52
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
52
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
"@type": "ParameterRangeGenericTypeReference",
|
|
56
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
56
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
60
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
57
61
|
}
|
|
58
62
|
]
|
|
59
63
|
},
|
|
60
64
|
{
|
|
61
65
|
"@type": "ParameterRangeGenericTypeReference",
|
|
62
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
66
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
70
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
63
71
|
},
|
|
64
72
|
{
|
|
65
73
|
"@type": "ParameterRangeGenericTypeReference",
|
|
66
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
74
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
67
75
|
},
|
|
68
76
|
{
|
|
69
77
|
"@type": "ParameterRangeGenericTypeReference",
|
|
70
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
78
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
71
79
|
}
|
|
72
80
|
]
|
|
73
81
|
},
|
|
@@ -77,6 +85,20 @@
|
|
|
77
85
|
},
|
|
78
86
|
"comment": "The bus this actor subscribes to."
|
|
79
87
|
},
|
|
88
|
+
{
|
|
89
|
+
"@id": "carphs:components/ActorRdfParseHtmlScript.jsonld#ActorRdfParseHtmlScript_args_busFailMessage",
|
|
90
|
+
"range": {
|
|
91
|
+
"@type": "ParameterRangeUnion",
|
|
92
|
+
"parameterRangeElements": [
|
|
93
|
+
"xsd:string",
|
|
94
|
+
{
|
|
95
|
+
"@type": "ParameterRangeUndefined"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"default": "RDF HTML parsing failed: none of the configured parsers were able to parse RDF in HTML",
|
|
100
|
+
"comment": "The message that will be configured in the bus for reporting failures. This message may be a template string that contains references to the executed `action`. For example, the following templated string is allowed: \"RDF dereferencing failed: no actors could handle ${action.handle.mediaType}\""
|
|
101
|
+
},
|
|
80
102
|
{
|
|
81
103
|
"@id": "carphs:components/ActorRdfParseHtmlScript.jsonld#ActorRdfParseHtmlScript_args_beforeActors",
|
|
82
104
|
"range": {
|
|
@@ -90,15 +112,19 @@
|
|
|
90
112
|
"genericTypeInstances": [
|
|
91
113
|
{
|
|
92
114
|
"@type": "ParameterRangeGenericTypeReference",
|
|
93
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
115
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
94
116
|
},
|
|
95
117
|
{
|
|
96
118
|
"@type": "ParameterRangeGenericTypeReference",
|
|
97
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
119
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
98
120
|
},
|
|
99
121
|
{
|
|
100
122
|
"@type": "ParameterRangeGenericTypeReference",
|
|
101
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
123
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
127
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
102
128
|
}
|
|
103
129
|
]
|
|
104
130
|
}
|
|
@@ -161,6 +187,12 @@
|
|
|
161
187
|
"@id": "carphs:components/ActorRdfParseHtmlScript.jsonld#ActorRdfParseHtmlScript_args_bus"
|
|
162
188
|
}
|
|
163
189
|
},
|
|
190
|
+
{
|
|
191
|
+
"keyRaw": "busFailMessage",
|
|
192
|
+
"value": {
|
|
193
|
+
"@id": "carphs:components/ActorRdfParseHtmlScript.jsonld#ActorRdfParseHtmlScript_args_busFailMessage"
|
|
194
|
+
}
|
|
195
|
+
},
|
|
164
196
|
{
|
|
165
197
|
"keyRaw": "beforeActors",
|
|
166
198
|
"value": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-parse-html-script/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-parse-html-script/^4.0.0/components/context.jsonld"
|
|
4
4
|
],
|
|
5
5
|
"@id": "npmd:@comunica/actor-rdf-parse-html-script",
|
|
6
6
|
"@type": "Module",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^6.0.0/components/context.jsonld",
|
|
4
4
|
{
|
|
5
5
|
"npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
|
|
6
|
-
"carphs": "npmd:@comunica/actor-rdf-parse-html-script/^
|
|
6
|
+
"carphs": "npmd:@comunica/actor-rdf-parse-html-script/^4.0.0/",
|
|
7
7
|
"ActorRdfParseHtmlScript": {
|
|
8
8
|
"@id": "carphs:components/ActorRdfParseHtmlScript.jsonld#ActorRdfParseHtmlScript",
|
|
9
9
|
"@prefix": true,
|
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
"args_bus": {
|
|
21
21
|
"@id": "carphs:components/ActorRdfParseHtmlScript.jsonld#ActorRdfParseHtmlScript_args_bus"
|
|
22
22
|
},
|
|
23
|
+
"args_busFailMessage": {
|
|
24
|
+
"@id": "carphs:components/ActorRdfParseHtmlScript.jsonld#ActorRdfParseHtmlScript_args_busFailMessage"
|
|
25
|
+
},
|
|
23
26
|
"args_beforeActors": {
|
|
24
27
|
"@id": "carphs:components/ActorRdfParseHtmlScript.jsonld#ActorRdfParseHtmlScript_args_beforeActors",
|
|
25
28
|
"@container": "@list"
|
|
@@ -36,6 +39,9 @@
|
|
|
36
39
|
"bus": {
|
|
37
40
|
"@id": "carphs:components/ActorRdfParseHtmlScript.jsonld#ActorRdfParseHtmlScript_args_bus"
|
|
38
41
|
},
|
|
42
|
+
"busFailMessage": {
|
|
43
|
+
"@id": "carphs:components/ActorRdfParseHtmlScript.jsonld#ActorRdfParseHtmlScript_args_busFailMessage"
|
|
44
|
+
},
|
|
39
45
|
"beforeActors": {
|
|
40
46
|
"@id": "carphs:components/ActorRdfParseHtmlScript.jsonld#ActorRdfParseHtmlScript_args_beforeActors",
|
|
41
47
|
"@container": "@list"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MediatorRdfParseHandle, MediatorRdfParseMediaTypes } from '@comunica/bus-rdf-parse';
|
|
2
2
|
import type { IActionRdfParseHtml, IActorRdfParseHtmlOutput, IActorRdfParseHtmlArgs } from '@comunica/bus-rdf-parse-html';
|
|
3
3
|
import { ActorRdfParseHtml } from '@comunica/bus-rdf-parse-html';
|
|
4
|
-
import type { IActorTest } from '@comunica/core';
|
|
4
|
+
import type { IActorTest, TestResult } from '@comunica/core';
|
|
5
5
|
/**
|
|
6
6
|
* A HTML script RDF Parse actor that listens on the 'rdf-parse' bus.
|
|
7
7
|
*
|
|
@@ -12,7 +12,7 @@ export declare class ActorRdfParseHtmlScript extends ActorRdfParseHtml {
|
|
|
12
12
|
private readonly mediatorRdfParseMediatypes;
|
|
13
13
|
private readonly mediatorRdfParseHandle;
|
|
14
14
|
constructor(args: IActorRdfParseHtmlScriptArgs);
|
|
15
|
-
test(_action: IActionRdfParseHtml): Promise<IActorTest
|
|
15
|
+
test(_action: IActionRdfParseHtml): Promise<TestResult<IActorTest>>;
|
|
16
16
|
run(action: IActionRdfParseHtml): Promise<IActorRdfParseHtmlOutput>;
|
|
17
17
|
}
|
|
18
18
|
export interface IActorRdfParseHtmlScriptArgs extends IActorRdfParseHtmlArgs {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ActorRdfParseHtmlScript = void 0;
|
|
4
4
|
const bus_rdf_parse_html_1 = require("@comunica/bus-rdf-parse-html");
|
|
5
|
+
const core_1 = require("@comunica/core");
|
|
5
6
|
const HtmlScriptListener_1 = require("./HtmlScriptListener");
|
|
6
7
|
/**
|
|
7
8
|
* A HTML script RDF Parse actor that listens on the 'rdf-parse' bus.
|
|
@@ -14,7 +15,7 @@ class ActorRdfParseHtmlScript extends bus_rdf_parse_html_1.ActorRdfParseHtml {
|
|
|
14
15
|
super(args);
|
|
15
16
|
}
|
|
16
17
|
async test(_action) {
|
|
17
|
-
return
|
|
18
|
+
return (0, core_1.passTestVoid)();
|
|
18
19
|
}
|
|
19
20
|
async run(action) {
|
|
20
21
|
const supportedTypes = (await this.mediatorRdfParseMediatypes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorRdfParseHtmlScript.js","sourceRoot":"","sources":["ActorRdfParseHtmlScript.ts"],"names":[],"mappings":";;;AAMA,qEAAiE;AAEjE,6DAA0D;AAE1D;;;;;GAKG;AACH,MAAa,uBAAwB,SAAQ,sCAAiB;IAI5D,YAAmB,IAAkC;QACnD,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,OAA4B;QAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"ActorRdfParseHtmlScript.js","sourceRoot":"","sources":["ActorRdfParseHtmlScript.ts"],"names":[],"mappings":";;;AAMA,qEAAiE;AAEjE,yCAA8C;AAC9C,6DAA0D;AAE1D;;;;;GAKG;AACH,MAAa,uBAAwB,SAAQ,sCAAiB;IAI5D,YAAmB,IAAkC;QACnD,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,OAA4B;QAC5C,OAAO,IAAA,mBAAY,GAAE,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,MAA2B;QAC1C,MAAM,cAAc,GAA2B,CAAC,MAAM,IAAI,CAAC,0BAA0B;aAClF,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;QACtE,MAAM,iBAAiB,GAAG,IAAI,uCAAkB,CAC9C,IAAI,CAAC,sBAAsB,EAC3B,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,GAAG,EACV,cAAc,EACd,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,OAAO,CACf,CAAC;QACF,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC/B,CAAC;CACF;AA3BD,0DA2BC","sourcesContent":["import type { MediatorRdfParseHandle, MediatorRdfParseMediaTypes } from '@comunica/bus-rdf-parse';\nimport type {\n IActionRdfParseHtml,\n IActorRdfParseHtmlOutput,\n IActorRdfParseHtmlArgs,\n} from '@comunica/bus-rdf-parse-html';\nimport { ActorRdfParseHtml } from '@comunica/bus-rdf-parse-html';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport { passTestVoid } from '@comunica/core';\nimport { HtmlScriptListener } from './HtmlScriptListener';\n\n/**\n * A HTML script RDF Parse actor that listens on the 'rdf-parse' bus.\n *\n * It is able to extract and parse any RDF serialization from script tags in HTML files\n * and announce the presence of them by media type.\n */\nexport class ActorRdfParseHtmlScript extends ActorRdfParseHtml {\n private readonly mediatorRdfParseMediatypes: MediatorRdfParseMediaTypes;\n private readonly mediatorRdfParseHandle: MediatorRdfParseHandle;\n\n public constructor(args: IActorRdfParseHtmlScriptArgs) {\n super(args);\n }\n\n public async test(_action: IActionRdfParseHtml): Promise<TestResult<IActorTest>> {\n return passTestVoid();\n }\n\n public async run(action: IActionRdfParseHtml): Promise<IActorRdfParseHtmlOutput> {\n const supportedTypes: Record<string, number> = (await this.mediatorRdfParseMediatypes\n .mediate({ context: action.context, mediaTypes: true })).mediaTypes;\n const htmlParseListener = new HtmlScriptListener(\n this.mediatorRdfParseHandle,\n action.emit,\n action.error,\n action.end,\n supportedTypes,\n action.context,\n action.baseIRI,\n action.headers,\n );\n return { htmlParseListener };\n }\n}\n\nexport interface IActorRdfParseHtmlScriptArgs extends IActorRdfParseHtmlArgs {\n /**\n * The RDF Parse mediator for collecting media types\n */\n mediatorRdfParseMediatypes: MediatorRdfParseMediaTypes;\n /**\n * The RDF Parse mediator for handling parsing\n */\n mediatorRdfParseHandle: MediatorRdfParseHandle;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comunica/actor-rdf-parse-html-script",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "A html-script rdf-parse actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"funding": {
|
|
8
|
+
"type": "opencollective",
|
|
9
|
+
"url": "https://opencollective.com/comunica-association"
|
|
10
|
+
},
|
|
7
11
|
"homepage": "https://comunica.dev/",
|
|
8
12
|
"repository": {
|
|
9
13
|
"type": "git",
|
|
@@ -37,14 +41,14 @@
|
|
|
37
41
|
"build:components": "componentsjs-generator"
|
|
38
42
|
},
|
|
39
43
|
"dependencies": {
|
|
40
|
-
"@comunica/bus-rdf-parse": "^
|
|
41
|
-
"@comunica/bus-rdf-parse-html": "^
|
|
42
|
-
"@comunica/context-entries": "^
|
|
43
|
-
"@comunica/core": "^
|
|
44
|
-
"@comunica/types": "^
|
|
44
|
+
"@comunica/bus-rdf-parse": "^4.0.1",
|
|
45
|
+
"@comunica/bus-rdf-parse-html": "^4.0.1",
|
|
46
|
+
"@comunica/context-entries": "^4.0.1",
|
|
47
|
+
"@comunica/core": "^4.0.1",
|
|
48
|
+
"@comunica/types": "^4.0.1",
|
|
45
49
|
"@rdfjs/types": "*",
|
|
46
|
-
"readable-stream": "^4.
|
|
50
|
+
"readable-stream": "^4.5.2",
|
|
47
51
|
"relative-to-absolute-iri": "^1.0.7"
|
|
48
52
|
},
|
|
49
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "67831ba79e45ea1ced41fe3f83c5d6e8802dbeaa"
|
|
50
54
|
}
|