@comunica/actor-rdf-parse-xml-rdfa 3.2.1 → 3.2.4-alpha.47.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.
@@ -83,6 +83,10 @@
83
83
  {
84
84
  "@type": "ParameterRangeGenericTypeReference",
85
85
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
86
+ },
87
+ {
88
+ "@type": "ParameterRangeGenericTypeReference",
89
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
86
90
  }
87
91
  ]
88
92
  },
@@ -97,6 +101,10 @@
97
101
  {
98
102
  "@type": "ParameterRangeGenericTypeReference",
99
103
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
104
+ },
105
+ {
106
+ "@type": "ParameterRangeGenericTypeReference",
107
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
100
108
  }
101
109
  ]
102
110
  },
@@ -106,6 +114,20 @@
106
114
  },
107
115
  "comment": "The bus this actor subscribes to."
108
116
  },
117
+ {
118
+ "@id": "carpxr:components/ActorRdfParseXmlRdfa.jsonld#ActorRdfParseXmlRdfa_args_busFailMessage",
119
+ "range": {
120
+ "@type": "ParameterRangeUnion",
121
+ "parameterRangeElements": [
122
+ "xsd:string",
123
+ {
124
+ "@type": "ParameterRangeUndefined"
125
+ }
126
+ ]
127
+ },
128
+ "default": "RDF parsing failed: none of the configured parsers were able to handle the media type ${action.handle.mediaType} for ${action.handle.url}",
129
+ "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}\""
130
+ },
109
131
  {
110
132
  "@id": "carpxr:components/ActorRdfParseXmlRdfa.jsonld#ActorRdfParseXmlRdfa_args_beforeActors",
111
133
  "range": {
@@ -128,6 +150,10 @@
128
150
  {
129
151
  "@type": "ParameterRangeGenericTypeReference",
130
152
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
153
+ },
154
+ {
155
+ "@type": "ParameterRangeGenericTypeReference",
156
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
131
157
  }
132
158
  ]
133
159
  }
@@ -184,6 +210,12 @@
184
210
  "@id": "carpxr:components/ActorRdfParseXmlRdfa.jsonld#ActorRdfParseXmlRdfa_args_bus"
185
211
  }
186
212
  },
213
+ {
214
+ "keyRaw": "busFailMessage",
215
+ "value": {
216
+ "@id": "carpxr:components/ActorRdfParseXmlRdfa.jsonld#ActorRdfParseXmlRdfa_args_busFailMessage"
217
+ }
218
+ },
187
219
  {
188
220
  "keyRaw": "beforeActors",
189
221
  "value": {
@@ -25,6 +25,9 @@
25
25
  "args_bus": {
26
26
  "@id": "carpxr:components/ActorRdfParseXmlRdfa.jsonld#ActorRdfParseXmlRdfa_args_bus"
27
27
  },
28
+ "args_busFailMessage": {
29
+ "@id": "carpxr:components/ActorRdfParseXmlRdfa.jsonld#ActorRdfParseXmlRdfa_args_busFailMessage"
30
+ },
28
31
  "args_beforeActors": {
29
32
  "@id": "carpxr:components/ActorRdfParseXmlRdfa.jsonld#ActorRdfParseXmlRdfa_args_beforeActors",
30
33
  "@container": "@list"
@@ -46,6 +49,9 @@
46
49
  "bus": {
47
50
  "@id": "carpxr:components/ActorRdfParseXmlRdfa.jsonld#ActorRdfParseXmlRdfa_args_bus"
48
51
  },
52
+ "busFailMessage": {
53
+ "@id": "carpxr:components/ActorRdfParseXmlRdfa.jsonld#ActorRdfParseXmlRdfa_args_busFailMessage"
54
+ },
49
55
  "beforeActors": {
50
56
  "@id": "carpxr:components/ActorRdfParseXmlRdfa.jsonld#ActorRdfParseXmlRdfa_args_beforeActors",
51
57
  "@container": "@list"
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActorRdfParseXmlRdfa = void 0;
4
4
  const bus_rdf_parse_1 = require("@comunica/bus-rdf-parse");
5
+ const context_entries_1 = require("@comunica/context-entries");
5
6
  const rdfa_streaming_parser_1 = require("rdfa-streaming-parser");
6
7
  /**
7
8
  * A comunica XML RDFa RDF Parse Actor.
@@ -24,9 +25,11 @@ class ActorRdfParseXmlRdfa extends bus_rdf_parse_1.ActorRdfParseFixedMediaTypes
24
25
  super(args);
25
26
  }
26
27
  async runHandle(action, _mediaType, _context) {
28
+ const dataFactory = action.context.getSafe(context_entries_1.KeysInitQuery.dataFactory);
27
29
  const language = (action.headers && action.headers.get('content-language')) ?? undefined;
28
30
  action.data.on('error', error => data.emit('error', error));
29
31
  const data = action.data.pipe(new rdfa_streaming_parser_1.RdfaParser({
32
+ dataFactory,
30
33
  baseIRI: action.metadata?.baseIRI,
31
34
  profile: 'xml',
32
35
  language,
@@ -1 +1 @@
1
- {"version":3,"file":"ActorRdfParseXmlRdfa.js","sourceRoot":"","sources":["ActorRdfParseXmlRdfa.ts"],"names":[],"mappings":";;;AACA,2DAAuE;AAEvE,iEAAmD;AAGnD;;GAEG;AACH,MAAa,oBAAqB,SAAQ,4CAA4B;IACpE;;;;;;;;;;;;OAYG;IACH,YAAmB,IAAuC;QACxD,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,MAAuB,EAAE,UAAkB,EAAE,QAAwB;QAE1F,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,SAAS,CAAC;QACzF,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;QAC5D,MAAM,IAAI,GAAkB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,kCAAU,CAAC;YAC1D,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO;YACjC,OAAO,EAAE,KAAK;YACd,QAAQ;SACT,CAAC,CAAC,CAAC;QACJ,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC;IAC9C,CAAC;CACF;AA7BD,oDA6BC","sourcesContent":["import type { IActionRdfParse, IActorRdfParseFixedMediaTypesArgs, IActorRdfParseOutput } from '@comunica/bus-rdf-parse';\nimport { ActorRdfParseFixedMediaTypes } from '@comunica/bus-rdf-parse';\nimport type { IActionContext } from '@comunica/types';\nimport { RdfaParser } from 'rdfa-streaming-parser';\nimport type { Readable } from 'readable-stream';\n\n/**\n * A comunica XML RDFa RDF Parse Actor.\n */\nexport class ActorRdfParseXmlRdfa extends ActorRdfParseFixedMediaTypes {\n /**\n * @param args -\n * \\ @defaultNested {{\n * \"application/xml\": 1.0,\n * \"text/xml\": 1.0,\n * \"image/svg+xml\": 1.0\n * }} mediaTypePriorities\n * \\ @defaultNested {{\n * \"application/xml\": \"http://www.w3.org/ns/formats/RDFa\",\n * \"text/xml\": \"http://www.w3.org/ns/formats/RDFa\",\n * \"image/svg+xml\": \"http://www.w3.org/ns/formats/RDFa\"\n * }} mediaTypeFormats\n */\n public constructor(args: IActorRdfParseFixedMediaTypesArgs) {\n super(args);\n }\n\n public async runHandle(action: IActionRdfParse, _mediaType: string, _context: IActionContext):\n Promise<IActorRdfParseOutput> {\n const language = (action.headers && action.headers.get('content-language')) ?? undefined;\n action.data.on('error', error => data.emit('error', error));\n const data = <Readable><any>action.data.pipe(new RdfaParser({\n baseIRI: action.metadata?.baseIRI,\n profile: 'xml',\n language,\n }));\n return { data, metadata: { triples: true }};\n }\n}\n"]}
1
+ {"version":3,"file":"ActorRdfParseXmlRdfa.js","sourceRoot":"","sources":["ActorRdfParseXmlRdfa.ts"],"names":[],"mappings":";;;AACA,2DAAuE;AACvE,+DAA0D;AAE1D,iEAAmD;AAGnD;;GAEG;AACH,MAAa,oBAAqB,SAAQ,4CAA4B;IACpE;;;;;;;;;;;;OAYG;IACH,YAAmB,IAAuC;QACxD,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,MAAuB,EAAE,UAAkB,EAAE,QAAwB;QAE1F,MAAM,WAAW,GAAwB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,+BAAa,CAAC,WAAW,CAAC,CAAC;QAC3F,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,SAAS,CAAC;QACzF,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;QAC5D,MAAM,IAAI,GAAkB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,kCAAU,CAAC;YAC1D,WAAW;YACX,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO;YACjC,OAAO,EAAE,KAAK;YACd,QAAQ;SACT,CAAC,CAAC,CAAC;QACJ,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC;IAC9C,CAAC;CACF;AA/BD,oDA+BC","sourcesContent":["import type { IActionRdfParse, IActorRdfParseFixedMediaTypesArgs, IActorRdfParseOutput } from '@comunica/bus-rdf-parse';\nimport { ActorRdfParseFixedMediaTypes } from '@comunica/bus-rdf-parse';\nimport { KeysInitQuery } from '@comunica/context-entries';\nimport type { ComunicaDataFactory, IActionContext } from '@comunica/types';\nimport { RdfaParser } from 'rdfa-streaming-parser';\nimport type { Readable } from 'readable-stream';\n\n/**\n * A comunica XML RDFa RDF Parse Actor.\n */\nexport class ActorRdfParseXmlRdfa extends ActorRdfParseFixedMediaTypes {\n /**\n * @param args -\n * \\ @defaultNested {{\n * \"application/xml\": 1.0,\n * \"text/xml\": 1.0,\n * \"image/svg+xml\": 1.0\n * }} mediaTypePriorities\n * \\ @defaultNested {{\n * \"application/xml\": \"http://www.w3.org/ns/formats/RDFa\",\n * \"text/xml\": \"http://www.w3.org/ns/formats/RDFa\",\n * \"image/svg+xml\": \"http://www.w3.org/ns/formats/RDFa\"\n * }} mediaTypeFormats\n */\n public constructor(args: IActorRdfParseFixedMediaTypesArgs) {\n super(args);\n }\n\n public async runHandle(action: IActionRdfParse, _mediaType: string, _context: IActionContext):\n Promise<IActorRdfParseOutput> {\n const dataFactory: ComunicaDataFactory = action.context.getSafe(KeysInitQuery.dataFactory);\n const language = (action.headers && action.headers.get('content-language')) ?? undefined;\n action.data.on('error', error => data.emit('error', error));\n const data = <Readable><any>action.data.pipe(new RdfaParser({\n dataFactory,\n baseIRI: action.metadata?.baseIRI,\n profile: 'xml',\n language,\n }));\n return { data, metadata: { triples: true }};\n }\n}\n"]}
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@comunica/actor-rdf-parse-xml-rdfa",
3
- "version": "3.2.1",
3
+ "version": "3.2.4-alpha.47.0",
4
4
  "description": "A xml-rdfa 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,9 +41,10 @@
37
41
  "build:components": "componentsjs-generator"
38
42
  },
39
43
  "dependencies": {
40
- "@comunica/bus-rdf-parse": "^3.2.1",
41
- "@comunica/types": "^3.2.1",
44
+ "@comunica/bus-rdf-parse": "3.2.4-alpha.47.0",
45
+ "@comunica/context-entries": "3.2.4-alpha.47.0",
46
+ "@comunica/types": "3.2.4-alpha.47.0",
42
47
  "rdfa-streaming-parser": "^2.0.1"
43
48
  },
44
- "gitHead": "f558377c3cefbd1606c51ede80440b862e7dda4f"
49
+ "gitHead": "85bd4c5cf07dfc293ebbc3a1416b70e2db8bfc48"
45
50
  }