@comunica/actor-rdf-parse-html-rdfa 3.2.4-alpha.47.0 → 3.3.0

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.
@@ -44,10 +44,6 @@
44
44
  {
45
45
  "@type": "ParameterRangeGenericTypeReference",
46
46
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
47
- },
48
- {
49
- "@type": "ParameterRangeGenericTypeReference",
50
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
51
47
  }
52
48
  ]
53
49
  },
@@ -62,10 +58,6 @@
62
58
  {
63
59
  "@type": "ParameterRangeGenericTypeReference",
64
60
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
65
- },
66
- {
67
- "@type": "ParameterRangeGenericTypeReference",
68
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
69
61
  }
70
62
  ]
71
63
  },
@@ -75,20 +67,6 @@
75
67
  },
76
68
  "comment": "The bus this actor subscribes to."
77
69
  },
78
- {
79
- "@id": "carphr:components/ActorRdfParseHtmlRdfa.jsonld#ActorRdfParseHtmlRdfa_args_busFailMessage",
80
- "range": {
81
- "@type": "ParameterRangeUnion",
82
- "parameterRangeElements": [
83
- "xsd:string",
84
- {
85
- "@type": "ParameterRangeUndefined"
86
- }
87
- ]
88
- },
89
- "default": "RDF HTML parsing failed: none of the configured parsers were able to parse RDF in HTML",
90
- "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}\""
91
- },
92
70
  {
93
71
  "@id": "carphr:components/ActorRdfParseHtmlRdfa.jsonld#ActorRdfParseHtmlRdfa_args_beforeActors",
94
72
  "range": {
@@ -111,10 +89,6 @@
111
89
  {
112
90
  "@type": "ParameterRangeGenericTypeReference",
113
91
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
114
- },
115
- {
116
- "@type": "ParameterRangeGenericTypeReference",
117
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
118
92
  }
119
93
  ]
120
94
  }
@@ -157,12 +131,6 @@
157
131
  "@id": "carphr:components/ActorRdfParseHtmlRdfa.jsonld#ActorRdfParseHtmlRdfa_args_bus"
158
132
  }
159
133
  },
160
- {
161
- "keyRaw": "busFailMessage",
162
- "value": {
163
- "@id": "carphr:components/ActorRdfParseHtmlRdfa.jsonld#ActorRdfParseHtmlRdfa_args_busFailMessage"
164
- }
165
- },
166
134
  {
167
135
  "keyRaw": "beforeActors",
168
136
  "value": {
@@ -14,9 +14,6 @@
14
14
  "args_bus": {
15
15
  "@id": "carphr:components/ActorRdfParseHtmlRdfa.jsonld#ActorRdfParseHtmlRdfa_args_bus"
16
16
  },
17
- "args_busFailMessage": {
18
- "@id": "carphr:components/ActorRdfParseHtmlRdfa.jsonld#ActorRdfParseHtmlRdfa_args_busFailMessage"
19
- },
20
17
  "args_beforeActors": {
21
18
  "@id": "carphr:components/ActorRdfParseHtmlRdfa.jsonld#ActorRdfParseHtmlRdfa_args_beforeActors",
22
19
  "@container": "@list"
@@ -27,9 +24,6 @@
27
24
  "bus": {
28
25
  "@id": "carphr:components/ActorRdfParseHtmlRdfa.jsonld#ActorRdfParseHtmlRdfa_args_bus"
29
26
  },
30
- "busFailMessage": {
31
- "@id": "carphr:components/ActorRdfParseHtmlRdfa.jsonld#ActorRdfParseHtmlRdfa_args_busFailMessage"
32
- },
33
27
  "beforeActors": {
34
28
  "@id": "carphr:components/ActorRdfParseHtmlRdfa.jsonld#ActorRdfParseHtmlRdfa_args_beforeActors",
35
29
  "@container": "@list"
@@ -1,11 +1,11 @@
1
1
  import type { IActionRdfParseHtml, IActorRdfParseHtmlOutput, IActorRdfParseHtmlArgs } from '@comunica/bus-rdf-parse-html';
2
2
  import { ActorRdfParseHtml } from '@comunica/bus-rdf-parse-html';
3
- import type { IActorTest, TestResult } from '@comunica/core';
3
+ import type { IActorTest } from '@comunica/core';
4
4
  /**
5
5
  * A comunica RDFa RDF Parse Html Actor.
6
6
  */
7
7
  export declare class ActorRdfParseHtmlRdfa extends ActorRdfParseHtml {
8
8
  constructor(args: IActorRdfParseHtmlArgs);
9
- test(_action: IActionRdfParseHtml): Promise<TestResult<IActorTest>>;
9
+ test(_action: IActionRdfParseHtml): Promise<IActorTest>;
10
10
  run(action: IActionRdfParseHtml): Promise<IActorRdfParseHtmlOutput>;
11
11
  }
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActorRdfParseHtmlRdfa = void 0;
4
4
  const bus_rdf_parse_html_1 = require("@comunica/bus-rdf-parse-html");
5
- const context_entries_1 = require("@comunica/context-entries");
6
- const core_1 = require("@comunica/core");
7
5
  const rdfa_streaming_parser_1 = require("rdfa-streaming-parser");
8
6
  /**
9
7
  * A comunica RDFa RDF Parse Html Actor.
@@ -13,14 +11,13 @@ class ActorRdfParseHtmlRdfa extends bus_rdf_parse_html_1.ActorRdfParseHtml {
13
11
  super(args);
14
12
  }
15
13
  async test(_action) {
16
- return (0, core_1.passTestVoid)();
14
+ return true;
17
15
  }
18
16
  async run(action) {
19
- const dataFactory = action.context.getSafe(context_entries_1.KeysInitQuery.dataFactory);
20
17
  const mediaType = action.headers ? action.headers.get('content-type') : null;
21
18
  const language = (action.headers && action.headers.get('content-language')) ?? undefined;
22
19
  const profile = mediaType && mediaType.includes('xml') ? 'xhtml' : 'html';
23
- const htmlParseListener = new rdfa_streaming_parser_1.RdfaParser({ dataFactory, baseIRI: action.baseIRI, profile, language });
20
+ const htmlParseListener = new rdfa_streaming_parser_1.RdfaParser({ baseIRI: action.baseIRI, profile, language });
24
21
  htmlParseListener.on('error', action.error);
25
22
  htmlParseListener.on('data', action.emit);
26
23
  // eslint-disable-next-line ts/unbound-method
@@ -1 +1 @@
1
- {"version":3,"file":"ActorRdfParseHtmlRdfa.js","sourceRoot":"","sources":["ActorRdfParseHtmlRdfa.ts"],"names":[],"mappings":";;;AAKA,qEAAiE;AACjE,+DAA0D;AAE1D,yCAA8C;AAE9C,iEAAmD;AAEnD;;GAEG;AACH,MAAa,qBAAsB,SAAQ,sCAAiB;IAC1D,YAAmB,IAA4B;QAC7C,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,WAAW,GAAwB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,+BAAa,CAAC,WAAW,CAAC,CAAC;QAC3F,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC7E,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,SAAS,CAAC;QACzF,MAAM,OAAO,GAAG,SAAS,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;QAE1E,MAAM,iBAAiB,GAAG,IAAI,kCAAU,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;QACtG,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5C,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QAC1C,6CAA6C;QAC7C,MAAM,WAAW,GAAG,iBAAiB,CAAC,KAAK,CAAC;QAC5C,iBAAiB,CAAC,KAAK,GAAG,GAAG,EAAE;YAC7B,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YACpC,MAAM,CAAC,GAAG,EAAE,CAAC;QACf,CAAC,CAAC;QACF,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC/B,CAAC;CACF;AA1BD,sDA0BC","sourcesContent":["import type {\n IActionRdfParseHtml,\n IActorRdfParseHtmlOutput,\n IActorRdfParseHtmlArgs,\n} from '@comunica/bus-rdf-parse-html';\nimport { ActorRdfParseHtml } from '@comunica/bus-rdf-parse-html';\nimport { KeysInitQuery } from '@comunica/context-entries';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport { passTestVoid } from '@comunica/core';\nimport type { ComunicaDataFactory } from '@comunica/types';\nimport { RdfaParser } from 'rdfa-streaming-parser';\n\n/**\n * A comunica RDFa RDF Parse Html Actor.\n */\nexport class ActorRdfParseHtmlRdfa extends ActorRdfParseHtml {\n public constructor(args: IActorRdfParseHtmlArgs) {\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 dataFactory: ComunicaDataFactory = action.context.getSafe(KeysInitQuery.dataFactory);\n const mediaType = action.headers ? action.headers.get('content-type') : null;\n const language = (action.headers && action.headers.get('content-language')) ?? undefined;\n const profile = mediaType && mediaType.includes('xml') ? 'xhtml' : 'html';\n\n const htmlParseListener = new RdfaParser({ dataFactory, baseIRI: action.baseIRI, profile, language });\n htmlParseListener.on('error', action.error);\n htmlParseListener.on('data', action.emit);\n // eslint-disable-next-line ts/unbound-method\n const onTagEndOld = htmlParseListener.onEnd;\n htmlParseListener.onEnd = () => {\n onTagEndOld.call(htmlParseListener);\n action.end();\n };\n return { htmlParseListener };\n }\n}\n"]}
1
+ {"version":3,"file":"ActorRdfParseHtmlRdfa.js","sourceRoot":"","sources":["ActorRdfParseHtmlRdfa.ts"],"names":[],"mappings":";;;AAKA,qEAAiE;AAEjE,iEAAmD;AAEnD;;GAEG;AACH,MAAa,qBAAsB,SAAQ,sCAAiB;IAC1D,YAAmB,IAA4B;QAC7C,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,OAA4B;QAC5C,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,MAA2B;QAC1C,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC7E,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,SAAS,CAAC;QACzF,MAAM,OAAO,GAAG,SAAS,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;QAE1E,MAAM,iBAAiB,GAAG,IAAI,kCAAU,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;QACzF,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5C,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QAC1C,6CAA6C;QAC7C,MAAM,WAAW,GAAG,iBAAiB,CAAC,KAAK,CAAC;QAC5C,iBAAiB,CAAC,KAAK,GAAG,GAAG,EAAE;YAC7B,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YACpC,MAAM,CAAC,GAAG,EAAE,CAAC;QACf,CAAC,CAAC;QACF,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC/B,CAAC;CACF;AAzBD,sDAyBC","sourcesContent":["import 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 } from '@comunica/core';\nimport { RdfaParser } from 'rdfa-streaming-parser';\n\n/**\n * A comunica RDFa RDF Parse Html Actor.\n */\nexport class ActorRdfParseHtmlRdfa extends ActorRdfParseHtml {\n public constructor(args: IActorRdfParseHtmlArgs) {\n super(args);\n }\n\n public async test(_action: IActionRdfParseHtml): Promise<IActorTest> {\n return true;\n }\n\n public async run(action: IActionRdfParseHtml): Promise<IActorRdfParseHtmlOutput> {\n const mediaType = action.headers ? action.headers.get('content-type') : null;\n const language = (action.headers && action.headers.get('content-language')) ?? undefined;\n const profile = mediaType && mediaType.includes('xml') ? 'xhtml' : 'html';\n\n const htmlParseListener = new RdfaParser({ baseIRI: action.baseIRI, profile, language });\n htmlParseListener.on('error', action.error);\n htmlParseListener.on('data', action.emit);\n // eslint-disable-next-line ts/unbound-method\n const onTagEndOld = htmlParseListener.onEnd;\n htmlParseListener.onEnd = () => {\n onTagEndOld.call(htmlParseListener);\n action.end();\n };\n return { htmlParseListener };\n }\n}\n"]}
package/package.json CHANGED
@@ -1,13 +1,9 @@
1
1
  {
2
2
  "name": "@comunica/actor-rdf-parse-html-rdfa",
3
- "version": "3.2.4-alpha.47.0",
3
+ "version": "3.3.0",
4
4
  "description": "A rdfa rdf-parse-html actor",
5
5
  "lsd:module": true,
6
6
  "license": "MIT",
7
- "funding": {
8
- "type": "opencollective",
9
- "url": "https://opencollective.com/comunica-association"
10
- },
11
7
  "homepage": "https://comunica.dev/",
12
8
  "repository": {
13
9
  "type": "git",
@@ -41,11 +37,9 @@
41
37
  "build:components": "componentsjs-generator"
42
38
  },
43
39
  "dependencies": {
44
- "@comunica/bus-rdf-parse-html": "3.2.4-alpha.47.0",
45
- "@comunica/context-entries": "3.2.4-alpha.47.0",
46
- "@comunica/core": "3.2.4-alpha.47.0",
47
- "@comunica/types": "3.2.4-alpha.47.0",
40
+ "@comunica/bus-rdf-parse-html": "^3.3.0",
41
+ "@comunica/core": "^3.3.0",
48
42
  "rdfa-streaming-parser": "^2.0.1"
49
43
  },
50
- "gitHead": "85bd4c5cf07dfc293ebbc3a1416b70e2db8bfc48"
44
+ "gitHead": "02bde397d206f1f5a523643a6a604c89e792e2f9"
51
45
  }