rdfa-streaming-parser 1.5.0 → 2.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/index.js +5 -1
- package/index.js.map +1 -0
- package/lib/IActiveTag.js.map +1 -0
- package/lib/IHtmlParseListener.js.map +1 -0
- package/lib/IRdfaPattern.js.map +1 -0
- package/lib/RdfaParser.d.ts +3 -3
- package/lib/RdfaParser.js +4 -4
- package/lib/RdfaParser.js.map +1 -0
- package/lib/RdfaProfile.js.map +1 -0
- package/lib/Util.js +4 -4
- package/lib/Util.js.map +1 -0
- package/package.json +18 -14
package/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,2DAAyC;AACzC,qDAAmC;AACnC,mDAAiC;AACjC,oDAAkC;AAClC,6CAA2B","sourcesContent":["export * from './lib/IActiveTag';\nexport * from './lib/IHtmlParseListener';\nexport * from './lib/IRdfaPattern';\nexport * from './lib/RdfaParser';\nexport * from './lib/RdfaProfile';\nexport * from './lib/Util';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IActiveTag.js","sourceRoot":"","sources":["IActiveTag.ts"],"names":[],"mappings":"","sourcesContent":["import * as RDF from \"@rdfjs/types\";\nimport {IRdfaPattern} from \"./IRdfaPattern\";\n\n/**\n * Data holder for the RDFa state in XML tags.\n */\nexport interface IActiveTag {\n name: string;\n prefixesAll: {[prefix: string]: string};\n prefixesCustom: {[prefix: string]: string};\n subject?: RDF.NamedNode | RDF.BlankNode | boolean;\n explicitNewSubject?: boolean;\n predicates?: RDF.NamedNode[];\n object?: RDF.NamedNode | RDF.BlankNode | boolean;\n text?: string[];\n vocab?: string;\n language?: string;\n datatype?: RDF.NamedNode;\n collectChildTags?: boolean;\n collectedPatternTag?: IRdfaPattern;\n interpretObjectAsTime?: boolean;\n incompleteTriples?: { predicate: RDF.Quad_Predicate, reverse: boolean, list?: boolean }[];\n inlist: boolean;\n listMapping: {[predicate: string]: (RDF.Term|boolean)[]};\n listMappingLocal: {[predicate: string]: (RDF.Term|boolean)[]};\n skipElement: boolean;\n localBaseIRI?: RDF.NamedNode;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IHtmlParseListener.js","sourceRoot":"","sources":["IHtmlParseListener.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * An HTML parsing listener.\n */\nexport interface IHtmlParseListener {\n /**\n * Called when a tag is opened.\n * @param {string} name The tag name.\n * @param {{[p: string]: string}} attributes A hash of attributes.\n */\n onTagOpen(name: string, attributes: {[s: string]: string}): void;\n\n /**\n * Called when a tag is closed.\n */\n onTagClose(): void;\n\n /**\n * Called when text contents are parsed.\n * Note that this can be called multiple times per tag,\n * when for example the string is spread over multiple chunks.\n * @param {string} data A string.\n */\n onText(data: string): void;\n\n /**\n * Called when parsing has ended.\n */\n onEnd(): void;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IRdfaPattern.js","sourceRoot":"","sources":["IRdfaPattern.ts"],"names":[],"mappings":"","sourcesContent":["import * as RDF from \"@rdfjs/types\";\nimport {IActiveTag} from \"./IActiveTag\";\n\n/**\n * A datastructure for storing an rdfa:Pattern.\n */\nexport interface IRdfaPattern {\n rootPattern: boolean;\n name: string;\n attributes: {[s: string]: string};\n text: string[];\n children: IRdfaPattern[];\n referenced: boolean;\n parentTag?: IActiveTag;\n constructedBlankNodes?: RDF.BlankNode[];\n}\n"]}
|
package/lib/RdfaParser.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import EventEmitter = NodeJS.EventEmitter;
|
|
3
3
|
import { Parser as HtmlParser } from "htmlparser2";
|
|
4
4
|
import * as RDF from "@rdfjs/types";
|
|
5
|
-
import { Transform
|
|
5
|
+
import { Transform } from "readable-stream";
|
|
6
6
|
import { IActiveTag } from "./IActiveTag";
|
|
7
7
|
import { IHtmlParseListener } from "./IHtmlParseListener";
|
|
8
8
|
import { IRdfaPattern } from "./IRdfaPattern";
|
|
@@ -27,8 +27,8 @@ export declare class RdfaParser extends Transform implements RDF.Sink<EventEmitt
|
|
|
27
27
|
* @return {RDF.Stream} A quad stream.
|
|
28
28
|
*/
|
|
29
29
|
import(stream: EventEmitter): RDF.Stream;
|
|
30
|
-
_transform(chunk: any, encoding: string, callback:
|
|
31
|
-
_flush(callback:
|
|
30
|
+
_transform(chunk: any, encoding: string, callback: (error?: Error | null, data?: any) => void): void;
|
|
31
|
+
_flush(callback: (error?: Error | null, data?: any) => void): void;
|
|
32
32
|
onTagOpen(name: string, attributes: {
|
|
33
33
|
[s: string]: string;
|
|
34
34
|
}): void;
|
package/lib/RdfaParser.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RdfaParser = void 0;
|
|
4
4
|
const htmlparser2_1 = require("htmlparser2");
|
|
5
|
-
const
|
|
5
|
+
const readable_stream_1 = require("readable-stream");
|
|
6
6
|
const INITIAL_CONTEXT_XHTML = require("./initial-context-xhtml.json");
|
|
7
7
|
const INITIAL_CONTEXT = require("./initial-context.json");
|
|
8
8
|
const RdfaProfile_1 = require("./RdfaProfile");
|
|
@@ -10,7 +10,7 @@ const Util_1 = require("./Util");
|
|
|
10
10
|
/**
|
|
11
11
|
* A stream transformer that parses RDFa (text) streams to an {@link RDF.Stream}.
|
|
12
12
|
*/
|
|
13
|
-
class RdfaParser extends
|
|
13
|
+
class RdfaParser extends readable_stream_1.Transform {
|
|
14
14
|
constructor(options) {
|
|
15
15
|
super({ readableObjectMode: true });
|
|
16
16
|
this.activeTagStack = [];
|
|
@@ -43,7 +43,7 @@ class RdfaParser extends stream_1.Transform {
|
|
|
43
43
|
* @return {RDF.Stream} A quad stream.
|
|
44
44
|
*/
|
|
45
45
|
import(stream) {
|
|
46
|
-
const output = new
|
|
46
|
+
const output = new readable_stream_1.PassThrough({ readableObjectMode: true });
|
|
47
47
|
stream.on('error', (error) => parsed.emit('error', error));
|
|
48
48
|
stream.on('data', (data) => output.push(data));
|
|
49
49
|
stream.on('end', () => output.push(null));
|
|
@@ -51,7 +51,7 @@ class RdfaParser extends stream_1.Transform {
|
|
|
51
51
|
return parsed;
|
|
52
52
|
}
|
|
53
53
|
_transform(chunk, encoding, callback) {
|
|
54
|
-
this.parser.write(chunk);
|
|
54
|
+
this.parser.write(chunk.toString());
|
|
55
55
|
callback();
|
|
56
56
|
}
|
|
57
57
|
_flush(callback) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RdfaParser.js","sourceRoot":"","sources":["RdfaParser.ts"],"names":[],"mappings":";;;AAEA,6CAAiD;AAEjD,qDAAuD;AAGvD,sEAAsE;AACtE,0DAA0D;AAE1D,+CAAwE;AACxE,iCAA4B;AAE5B;;GAEG;AACH,MAAa,UAAW,SAAQ,2BAAS;IAavC,YAAY,OAA4B;QACtC,KAAK,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;QAHrB,mBAAc,GAAiB,EAAE,CAAC;QAIjD,OAAO,GAAG,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CAAC,CAAC;oBAClB,IAAI,IAAI,CAAC,iBAAiB,EAAE;wBAC1B,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;qBACrC;iBACF;gBAAC,OAAO,CAAC,EAAE;oBACV,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;iBACvB;YACH,CAAC;SACF,EACD;YACE,cAAc,EAAE,IAAI;YACpB,oBAAoB,EAAE,IAAI;YAC1B,OAAO;SACR,CAAC,CAAC;IACP,CAAC;CAEF;AA52BD,gCA42BC","sourcesContent":["import {DomHandler} from \"domhandler\";\nimport EventEmitter = NodeJS.EventEmitter;\nimport {Parser as HtmlParser} from \"htmlparser2\";\nimport * as RDF from \"@rdfjs/types\";\nimport {PassThrough, Transform} from \"readable-stream\";\nimport {IActiveTag} from \"./IActiveTag\";\nimport {IHtmlParseListener} from \"./IHtmlParseListener\";\nimport * as INITIAL_CONTEXT_XHTML from \"./initial-context-xhtml.json\";\nimport * as INITIAL_CONTEXT from \"./initial-context.json\";\nimport {IRdfaPattern} from \"./IRdfaPattern\";\nimport {IRdfaFeatures, RDFA_FEATURES, RdfaProfile} from \"./RdfaProfile\";\nimport {Util} from \"./Util\";\n\n/**\n * A stream transformer that parses RDFa (text) streams to an {@link RDF.Stream}.\n */\nexport class RdfaParser extends Transform implements RDF.Sink<EventEmitter, RDF.Stream> {\n\n private readonly options: IRdfaParserOptions;\n private readonly util: Util;\n private readonly defaultGraph?: RDF.Quad_Graph;\n private readonly parser: HtmlParser;\n private readonly features: IRdfaFeatures;\n private readonly htmlParseListener?: IHtmlParseListener;\n private readonly rdfaPatterns: {[patternId: string]: IRdfaPattern};\n private readonly pendingRdfaPatternCopies: {[copyTargetPatternId: string]: IActiveTag[]};\n\n private readonly activeTagStack: IActiveTag[] = [];\n\n constructor(options?: IRdfaParserOptions) {\n super({ readableObjectMode: true });\n options = options || {};\n this.options = options;\n\n this.util = new Util(options.dataFactory, options.baseIRI);\n this.defaultGraph = options.defaultGraph || this.util.dataFactory.defaultGraph();\n const profile = options.contentType ? Util.contentTypeToProfile(options.contentType) : options.profile || '';\n this.features = options.features || RDFA_FEATURES[profile];\n this.htmlParseListener = options.htmlParseListener;\n this.rdfaPatterns = this.features.copyRdfaPatterns ? {} : null;\n this.pendingRdfaPatternCopies = this.features.copyRdfaPatterns ? {} : null;\n\n this.parser = this.initializeParser(profile === 'xml');\n\n this.activeTagStack.push({\n incompleteTriples: [],\n inlist: false,\n language: options.language,\n listMapping: {},\n listMappingLocal: {},\n name: '',\n prefixesAll: {\n ...INITIAL_CONTEXT['@context'],\n ...this.features.xhtmlInitialContext ? INITIAL_CONTEXT_XHTML['@context'] : {},\n },\n prefixesCustom : {},\n skipElement: false,\n vocab: options.vocab,\n });\n }\n\n /**\n * Parses the given text stream into a quad stream.\n * @param {NodeJS.EventEmitter} stream A text stream.\n * @return {RDF.Stream} A quad stream.\n */\n public import(stream: EventEmitter): RDF.Stream {\n const output = new PassThrough({ readableObjectMode: true });\n stream.on('error', (error) => parsed.emit('error', error));\n stream.on('data', (data) => output.push(data));\n stream.on('end', () => output.push(null));\n const parsed = output.pipe(new RdfaParser(this.options));\n return parsed;\n }\n\n public _transform(chunk: any, encoding: string, callback: (error?: Error | null, data?: any) => void): void {\n this.parser.write(chunk.toString());\n callback();\n }\n\n public _flush(callback: (error?: Error | null, data?: any) => void): void {\n this.parser.end();\n callback();\n }\n\n public onTagOpen(name: string, attributes: {[s: string]: string}) {\n // Determine the parent tag (ignore skipped tags)\n let parentTagI: number = this.activeTagStack.length - 1;\n while (parentTagI > 0 && this.activeTagStack[parentTagI].skipElement) {\n parentTagI--;\n }\n let parentTag: IActiveTag = this.activeTagStack[parentTagI];\n // If we skipped a tag, make sure we DO use the lang, prefixes and vocab of the skipped tag\n if (parentTagI !== this.activeTagStack.length - 1) {\n parentTag = {\n ...parentTag,\n language: this.activeTagStack[this.activeTagStack.length - 1].language,\n prefixesAll: this.activeTagStack[this.activeTagStack.length - 1].prefixesAll,\n prefixesCustom: this.activeTagStack[this.activeTagStack.length - 1].prefixesCustom,\n vocab: this.activeTagStack[this.activeTagStack.length - 1].vocab,\n };\n }\n\n // Create a new active tag and inherit language scope and baseIRI from parent\n const activeTag: IActiveTag = {\n collectChildTags: parentTag.collectChildTags,\n incompleteTriples: [],\n inlist: 'inlist' in attributes,\n listMapping: <{[predicate: string]: (RDF.Term|boolean)[]}> <any> [],\n listMappingLocal: parentTag.listMapping,\n localBaseIRI: parentTag.localBaseIRI,\n name,\n prefixesAll: null,\n prefixesCustom: null,\n skipElement: false,\n };\n this.activeTagStack.push(activeTag);\n\n // Save the tag contents if needed\n if (activeTag.collectChildTags) {\n // Add explicitly defined xmlns, xmlns:* and prefixes to attributes, as required by the spec (Step 11, note)\n // Sort prefixes alphabetically for deterministic namespace declaration order\n for (const prefix of Object.keys(parentTag.prefixesCustom).sort()) {\n const suffix = parentTag.prefixesCustom[prefix];\n const attributeKey = prefix === '' ? 'xmlns' : 'xmlns:' + prefix;\n if (!(attributeKey in attributes)) {\n attributes[attributeKey] = suffix;\n }\n }\n\n const attributesSerialized = Object.keys(attributes).map((key) => `${key}=\"${attributes[key]}\"`).join(' ');\n activeTag.text = [`<${name}${attributesSerialized ? ' ' + attributesSerialized : ''}>`];\n if (this.features.skipHandlingXmlLiteralChildren) {\n return;\n }\n }\n\n let allowTermsInRelPredicates: boolean = true;\n let allowTermsInRevPredicates: boolean = true;\n if (this.features.onlyAllowUriRelRevIfProperty) {\n // Ignore illegal rel/rev values when property is present\n if ('property' in attributes && 'rel' in attributes) {\n allowTermsInRelPredicates = false;\n if (attributes.rel.indexOf(':') < 0) {\n delete attributes.rel;\n }\n }\n if ('property' in attributes && 'rev' in attributes) {\n allowTermsInRevPredicates = false;\n if (attributes.rev.indexOf(':') < 0) {\n delete attributes.rev;\n }\n }\n }\n\n if (this.features.copyRdfaPatterns) {\n // Save the tag if needed\n if (parentTag.collectedPatternTag) {\n const patternTag: IRdfaPattern = {\n attributes,\n children: [],\n name,\n referenced: false,\n rootPattern: false,\n text: [],\n };\n parentTag.collectedPatternTag.children.push(patternTag);\n activeTag.collectedPatternTag = patternTag;\n return;\n }\n\n // Store tags with type rdfa:Pattern as patterns\n if (attributes.typeof === 'rdfa:Pattern') {\n activeTag.collectedPatternTag = {\n attributes,\n children: [],\n name,\n parentTag,\n referenced: false,\n rootPattern: true,\n text: [],\n };\n return;\n }\n\n // Instantiate patterns on rdfa:copy\n if (attributes.property === 'rdfa:copy') {\n const copyTargetPatternId: string = attributes.resource || attributes.href || attributes.src;\n if (this.rdfaPatterns[copyTargetPatternId]) {\n this.emitPatternCopy(parentTag, this.rdfaPatterns[copyTargetPatternId], copyTargetPatternId);\n } else {\n if (!this.pendingRdfaPatternCopies[copyTargetPatternId]) {\n this.pendingRdfaPatternCopies[copyTargetPatternId] = [];\n }\n this.pendingRdfaPatternCopies[copyTargetPatternId].push(parentTag);\n }\n return;\n }\n }\n\n // <base> tags override the baseIRI of the whole document\n if (this.features.baseTag && name === 'base' && attributes.href) {\n this.util.baseIRI = this.util.getBaseIRI(attributes.href);\n }\n // xml:base attributes override the baseIRI of the current tag and children\n if (this.features.xmlBase && attributes['xml:base']) {\n activeTag.localBaseIRI = this.util.getBaseIRI(attributes['xml:base']);\n }\n\n // <time> tags set an initial datatype\n if (this.features.timeTag && name === 'time' && !attributes.datatype) {\n activeTag.interpretObjectAsTime = true;\n }\n\n // Processing based on https://www.w3.org/TR/rdfa-core/#s_rdfaindetail\n // 1: initialize values\n let newSubject: RDF.NamedNode | RDF.BlankNode | boolean;\n let currentObjectResource: RDF.NamedNode | RDF.BlankNode | boolean;\n let typedResource: RDF.NamedNode | RDF.BlankNode | boolean;\n\n // 2: handle vocab attribute to set active vocabulary\n // Vocab sets the active vocabulary\n if ('vocab' in attributes) {\n if (attributes.vocab) {\n activeTag.vocab = attributes.vocab;\n this.emitTriple(\n this.util.getBaseIriTerm(activeTag),\n this.util.dataFactory.namedNode(Util.RDFA + 'usesVocabulary'),\n this.util.dataFactory.namedNode(activeTag.vocab),\n );\n } else {\n // If vocab is set to '', then we fallback to the root vocab as defined via the parser constructor\n activeTag.vocab = this.activeTagStack[0].vocab;\n }\n } else {\n activeTag.vocab = parentTag.vocab;\n }\n\n // 3: handle prefixes\n activeTag.prefixesCustom = Util.parsePrefixes(attributes, parentTag.prefixesCustom,\n this.features.xmlnsPrefixMappings);\n activeTag.prefixesAll = Object.keys(activeTag.prefixesCustom).length > 0\n ? { ...parentTag.prefixesAll, ...activeTag.prefixesCustom } : parentTag.prefixesAll;\n\n // Handle role attribute\n if (this.features.roleAttribute && attributes.role) {\n const roleSubject = attributes.id\n ? this.util.createIri('#' + attributes.id, activeTag, false, false, false)\n : this.util.createBlankNode();\n // Temporarily override vocab\n const vocabOld = activeTag.vocab;\n activeTag.vocab = 'http://www.w3.org/1999/xhtml/vocab#';\n for (const role of this.util.createVocabIris(attributes.role, activeTag, true, false)) {\n this.emitTriple(\n roleSubject,\n this.util.dataFactory.namedNode('http://www.w3.org/1999/xhtml/vocab#role'),\n role,\n );\n }\n activeTag.vocab = vocabOld;\n }\n\n // 4: handle language\n // Save language attribute value in active tag\n if ('xml:lang' in attributes || (this.features.langAttribute && 'lang' in attributes)) {\n activeTag.language = attributes['xml:lang'] || attributes.lang;\n } else {\n activeTag.language = parentTag.language;\n }\n\n const isRootTag: boolean = this.activeTagStack.length === 2;\n if (!('rel' in attributes) && !('rev' in attributes)) {\n // 5: Determine the new subject when rel and rev are not present\n if ('property' in attributes && !('content' in attributes) && !('datatype' in attributes)) {\n // 5.1: property is present, but not content and datatype\n // Determine new subject\n if ('about' in attributes) {\n newSubject = this.util.createIri(attributes.about, activeTag, false, true, true);\n activeTag.explicitNewSubject = !!newSubject;\n } else if (isRootTag) {\n newSubject = true;\n } else if (parentTag.object) {\n newSubject = parentTag.object;\n }\n\n // Determine type\n if ('typeof' in attributes) {\n if ('about' in attributes) {\n typedResource = this.util.createIri(attributes.about, activeTag, false, true, true);\n }\n if (!typedResource && isRootTag) {\n typedResource = true;\n }\n if (!typedResource && 'resource' in attributes) {\n typedResource = this.util.createIri(attributes.resource, activeTag, false, true, true);\n }\n if (!typedResource && ('href' in attributes || 'src' in attributes)) {\n typedResource = this.util.createIri(attributes.href || attributes.src, activeTag, false, false, true);\n }\n if (!typedResource && this.isInheritSubjectInHeadBody(name)) {\n typedResource = newSubject;\n }\n if (!typedResource) {\n typedResource = this.util.createBlankNode();\n }\n\n currentObjectResource = typedResource;\n }\n } else {\n // 5.2\n if ('about' in attributes || 'resource' in attributes) {\n newSubject = this.util.createIri(attributes.about || attributes.resource, activeTag, false, true, true);\n activeTag.explicitNewSubject = !!newSubject;\n }\n if (!newSubject && ('href' in attributes || 'src' in attributes)) {\n newSubject = this.util.createIri(attributes.href || attributes.src,\n activeTag, false, false, true);\n activeTag.explicitNewSubject = !!newSubject;\n }\n if (!newSubject) {\n if (isRootTag) {\n newSubject = true;\n } else if (this.isInheritSubjectInHeadBody(name)) {\n newSubject = parentTag.object;\n } else if ('typeof' in attributes) {\n newSubject = this.util.createBlankNode();\n activeTag.explicitNewSubject = true;\n } else if (parentTag.object) {\n newSubject = parentTag.object;\n if (!('property' in attributes)) {\n activeTag.skipElement = true;\n }\n }\n }\n\n // Determine type\n if ('typeof' in attributes) {\n typedResource = newSubject;\n }\n }\n } else { // either rel or rev is present\n // 6: Determine the new subject when rel or rev are present\n\n // Define new subject\n if ('about' in attributes) {\n newSubject = this.util.createIri(attributes.about, activeTag, false, true, true);\n activeTag.explicitNewSubject = !!newSubject;\n if ('typeof' in attributes) {\n typedResource = newSubject;\n }\n } else if (isRootTag) {\n newSubject = true;\n } else if (parentTag.object) {\n newSubject = parentTag.object;\n }\n\n // Define object\n if ('resource' in attributes) {\n currentObjectResource = this.util.createIri(attributes.resource, activeTag, false, true, true);\n }\n if (!currentObjectResource) {\n if ('href' in attributes || 'src' in attributes) {\n currentObjectResource = this.util.createIri(attributes.href || attributes.src, activeTag, false, false, true);\n } else if ('typeof' in attributes && !('about' in attributes) && !this.isInheritSubjectInHeadBody(name)) {\n currentObjectResource = this.util.createBlankNode();\n }\n }\n\n // Set typed resource\n if ('typeof' in attributes && !('about' in attributes)) {\n if (this.isInheritSubjectInHeadBody(name)) {\n typedResource = newSubject;\n } else {\n typedResource = currentObjectResource;\n }\n }\n }\n\n // 7: If a typed resource was defined, emit it as a triple\n if (typedResource) {\n for (const type of this.util.createVocabIris(attributes.typeof, activeTag, true, true)) {\n this.emitTriple(\n this.util.getResourceOrBaseIri(typedResource, activeTag),\n this.util.dataFactory.namedNode(Util.RDF + 'type'),\n type,\n );\n }\n }\n\n // 8: Reset list mapping if we have a new subject\n if (newSubject) {\n activeTag.listMapping = {};\n }\n\n // 9: If an object was defined, emit triples for it\n if (currentObjectResource) {\n // Handle list mapping\n if ('rel' in attributes && 'inlist' in attributes) {\n for (const predicate of this.util.createVocabIris(attributes.rel, activeTag, allowTermsInRelPredicates,\n false)) {\n this.addListMapping(activeTag, newSubject, predicate, currentObjectResource);\n }\n }\n\n // Determine predicates using rel or rev (unless rel and inlist are present)\n if (!('rel' in attributes && 'inlist' in attributes)) {\n if ('rel' in attributes) {\n for (const predicate of this.util.createVocabIris(attributes.rel, activeTag, allowTermsInRelPredicates,\n false)) {\n this.emitTriple(\n this.util.getResourceOrBaseIri(newSubject, activeTag),\n predicate,\n this.util.getResourceOrBaseIri(currentObjectResource, activeTag),\n );\n }\n }\n if ('rev' in attributes) {\n for (const predicate of this.util.createVocabIris(attributes.rev, activeTag, allowTermsInRevPredicates,\n false)) {\n this.emitTriple(\n this.util.getResourceOrBaseIri(currentObjectResource, activeTag),\n predicate,\n this.util.getResourceOrBaseIri(newSubject, activeTag),\n );\n }\n }\n }\n }\n\n // 10: Store incomplete triples if we don't have an object, but we do have predicates\n if (!currentObjectResource) {\n if ('rel' in attributes) {\n if ('inlist' in attributes) {\n for (const predicate of this.util.createVocabIris(attributes.rel, activeTag, allowTermsInRelPredicates,\n false)) {\n this.addListMapping(activeTag, newSubject, predicate, null);\n activeTag.incompleteTriples.push({ predicate, reverse: false, list: true });\n }\n } else {\n for (const predicate of this.util.createVocabIris(attributes.rel, activeTag, allowTermsInRelPredicates,\n false)) {\n activeTag.incompleteTriples.push({ predicate, reverse: false });\n }\n }\n }\n if ('rev' in attributes) {\n for (const predicate of this.util.createVocabIris(attributes.rev, activeTag, allowTermsInRevPredicates,\n false)) {\n activeTag.incompleteTriples.push({ predicate, reverse: true });\n }\n }\n\n // Set a blank node object, so the children can make use of this when completing the triples\n if (activeTag.incompleteTriples.length > 0) {\n currentObjectResource = this.util.createBlankNode();\n }\n }\n\n // 11: Determine current property value\n if ('property' in attributes) {\n // Create predicates\n activeTag.predicates = this.util.createVocabIris(attributes.property, activeTag, true, false);\n\n // Save datatype attribute value in active tag\n let localObjectResource: RDF.Term | boolean;\n if ('datatype' in attributes) {\n activeTag.datatype = <RDF.NamedNode> this.util.createIri(attributes.datatype, activeTag, true, true, false);\n if (activeTag.datatype\n && (activeTag.datatype.value === Util.RDF + 'XMLLiteral'\n || (this.features.htmlDatatype && activeTag.datatype.value === Util.RDF + 'HTML'))) {\n activeTag.collectChildTags = true;\n }\n } else {\n // Try to determine resource\n if (!('rev' in attributes) && !('rel' in attributes) && !('content' in attributes)) {\n if ('resource' in attributes) {\n localObjectResource = this.util.createIri(attributes.resource, activeTag, false, true, true);\n }\n if (!localObjectResource && 'href' in attributes) {\n localObjectResource = this.util.createIri(attributes.href, activeTag, false, false, true);\n }\n if (!localObjectResource && 'src' in attributes) {\n localObjectResource = this.util.createIri(attributes.src, activeTag, false, false, true);\n }\n }\n if ('typeof' in attributes && !('about' in attributes)) {\n localObjectResource = typedResource;\n }\n }\n\n if ('content' in attributes) {\n // Emit triples based on content attribute has preference over text content\n const object = this.util.createLiteral(attributes.content, activeTag);\n if ('inlist' in attributes) {\n for (const predicate of activeTag.predicates) {\n this.addListMapping(activeTag, newSubject, predicate, object);\n }\n } else {\n const subject = this.util.getResourceOrBaseIri(newSubject, activeTag);\n for (const predicate of activeTag.predicates) {\n this.emitTriple(subject, predicate, object);\n }\n }\n\n // Unset predicate to avoid text contents to produce new triples\n activeTag.predicates = null;\n } else if (this.features.datetimeAttribute && 'datetime' in attributes) {\n activeTag.interpretObjectAsTime = true;\n // Datetime attribute on time tag has preference over text content\n const object = this.util.createLiteral(attributes.datetime, activeTag);\n if ('inlist' in attributes) {\n for (const predicate of activeTag.predicates) {\n this.addListMapping(activeTag, newSubject, predicate, object);\n }\n } else {\n const subject = this.util.getResourceOrBaseIri(newSubject, activeTag);\n for (const predicate of activeTag.predicates) {\n this.emitTriple(subject, predicate, object);\n }\n }\n\n // Unset predicate to avoid text contents to produce new triples\n activeTag.predicates = null;\n } else if (localObjectResource) {\n // Emit triples for all resource objects\n const object = this.util.getResourceOrBaseIri(localObjectResource, activeTag);\n if ('inlist' in attributes) {\n for (const predicate of activeTag.predicates) {\n this.addListMapping(activeTag, newSubject, predicate, object);\n }\n } else {\n const subject = this.util.getResourceOrBaseIri(newSubject, activeTag);\n for (const predicate of activeTag.predicates) {\n this.emitTriple(subject, predicate, object);\n }\n }\n\n // Unset predicate to avoid text contents to produce new triples\n activeTag.predicates = null;\n }\n }\n\n // 12: Complete incomplete triples\n let incompleteTriplesCompleted = false;\n if (!activeTag.skipElement && newSubject && parentTag.incompleteTriples.length > 0) {\n incompleteTriplesCompleted = true;\n const subject = this.util.getResourceOrBaseIri(parentTag.subject, activeTag);\n const object = this.util.getResourceOrBaseIri(newSubject, activeTag);\n for (const incompleteTriple of parentTag.incompleteTriples) {\n if (!incompleteTriple.reverse) {\n if (incompleteTriple.list) {\n // Find the active tag that defined the list by going up the stack\n let firstInListTag = null;\n for (let i = this.activeTagStack.length - 1; i >= 0; i--) {\n if (this.activeTagStack[i].inlist) {\n firstInListTag = this.activeTagStack[i];\n break;\n }\n }\n // firstInListTag is guaranteed to be non-null\n this.addListMapping(firstInListTag, newSubject, incompleteTriple.predicate, object);\n } else {\n this.emitTriple(subject, incompleteTriple.predicate, object);\n }\n } else {\n this.emitTriple(object, incompleteTriple.predicate, subject);\n }\n }\n }\n if (!incompleteTriplesCompleted && parentTag.incompleteTriples.length > 0) {\n activeTag.incompleteTriples = activeTag.incompleteTriples.concat(parentTag.incompleteTriples);\n }\n\n // 13: Save evaluation context into active tag\n activeTag.subject = newSubject || parentTag.subject;\n activeTag.object = currentObjectResource || newSubject;\n }\n\n public onText(data: string) {\n const activeTag: IActiveTag = this.activeTagStack[this.activeTagStack.length - 1];\n\n // Collect text in pattern tag if needed\n if (this.features.copyRdfaPatterns && activeTag.collectedPatternTag) {\n activeTag.collectedPatternTag.text.push(data);\n return;\n }\n\n // Save the text inside the active tag\n if (!activeTag.text) {\n activeTag.text = [];\n }\n activeTag.text.push(data);\n }\n\n public onTagClose() {\n // Get the active tag\n const activeTag: IActiveTag = this.activeTagStack[this.activeTagStack.length - 1];\n const parentTag: IActiveTag = this.activeTagStack[this.activeTagStack.length - 2];\n\n if (!(activeTag.collectChildTags && parentTag.collectChildTags && this.features.skipHandlingXmlLiteralChildren)) {\n\n // If we detect a finalized rdfa:Pattern tag, store it\n if (this.features.copyRdfaPatterns && activeTag.collectedPatternTag\n && activeTag.collectedPatternTag.rootPattern) {\n const patternId = activeTag.collectedPatternTag.attributes.resource;\n\n // Remove resource and typeof attributes to avoid it being seen as a new pattern\n delete activeTag.collectedPatternTag.attributes.resource;\n delete activeTag.collectedPatternTag.attributes.typeof;\n\n // Store the pattern\n this.rdfaPatterns[patternId] = activeTag.collectedPatternTag;\n\n // Apply all pending copies for this pattern\n if (this.pendingRdfaPatternCopies[patternId]) {\n for (const tag of this.pendingRdfaPatternCopies[patternId]) {\n this.emitPatternCopy(tag, activeTag.collectedPatternTag, patternId);\n }\n delete this.pendingRdfaPatternCopies[patternId];\n }\n\n // Remove the active tag from the stack\n this.activeTagStack.pop();\n\n return;\n }\n\n // Emit all triples that were determined in the active tag\n if (activeTag.predicates) {\n const subject = this.util.getResourceOrBaseIri(activeTag.subject, activeTag);\n let textSegments: string[] = activeTag.text || [];\n if (activeTag.collectChildTags && parentTag.collectChildTags) {\n // If we are inside an XMLLiteral child that also has RDFa content, ignore the tag name that was collected.\n textSegments = textSegments.slice(1);\n }\n const object = this.util.createLiteral(textSegments.join(''), activeTag);\n if (activeTag.inlist) {\n for (const predicate of activeTag.predicates) {\n this.addListMapping(activeTag, subject, predicate, object);\n }\n } else {\n for (const predicate of activeTag.predicates) {\n this.emitTriple(subject, predicate, object);\n }\n }\n\n // Reset text, unless the parent is also collecting text\n if (!parentTag.predicates) {\n activeTag.text = null;\n }\n }\n\n // 14: Handle local list mapping\n if (activeTag.object && Object.keys(activeTag.listMapping).length > 0) {\n const subject = this.util.getResourceOrBaseIri(activeTag.object, activeTag);\n for (const predicateValue in activeTag.listMapping) {\n const predicate = this.util.dataFactory.namedNode(predicateValue);\n const values = activeTag.listMapping[predicateValue];\n\n if (values.length > 0) {\n // Non-empty list, emit linked list of rdf:first and rdf:rest chains\n const bnodes = values.map(() => this.util.createBlankNode());\n for (let i = 0; i < values.length; i++) {\n const object = this.util.getResourceOrBaseIri(values[i], activeTag);\n this.emitTriple(bnodes[i], this.util.dataFactory.namedNode(Util.RDF + 'first'),\n object);\n this.emitTriple(bnodes[i], this.util.dataFactory.namedNode(Util.RDF + 'rest'),\n (i < values.length - 1) ? bnodes[i + 1] : this.util.dataFactory.namedNode(Util.RDF + 'nil'));\n }\n\n // Emit triple for the first linked list chain\n this.emitTriple(subject, predicate, bnodes[0]);\n } else {\n // Empty list, just emit rdf:nil\n this.emitTriple(subject, predicate, this.util.dataFactory.namedNode(Util.RDF + 'nil'));\n }\n }\n }\n\n }\n\n // Remove the active tag from the stack\n this.activeTagStack.pop();\n\n // Save the tag contents if needed\n if (activeTag.collectChildTags && activeTag.text) {\n activeTag.text.push(`</${activeTag.name}>`);\n }\n\n // If we still have text contents, try to append it to the parent tag\n if (activeTag.text && parentTag) {\n if (!parentTag.text) {\n parentTag.text = activeTag.text;\n } else {\n parentTag.text = parentTag.text.concat(activeTag.text);\n }\n }\n }\n\n public onEnd() {\n if (this.features.copyRdfaPatterns) {\n this.features.copyRdfaPatterns = false;\n\n // Emit all unreferenced patterns\n for (const patternId in this.rdfaPatterns) {\n const pattern = this.rdfaPatterns[patternId];\n if (!pattern.referenced) {\n pattern.attributes.typeof = 'rdfa:Pattern';\n pattern.attributes.resource = patternId;\n this.emitPatternCopy(pattern.parentTag, pattern, patternId);\n pattern.referenced = false;\n delete pattern.attributes.typeof;\n delete pattern.attributes.resource;\n }\n }\n\n // Emit all unreferenced copy links\n for (const patternId in this.pendingRdfaPatternCopies) {\n for (const parentTag of this.pendingRdfaPatternCopies[patternId]) {\n this.activeTagStack.push(parentTag);\n this.onTagOpen('link', { property: 'rdfa:copy', href: patternId });\n this.onTagClose();\n this.activeTagStack.pop();\n }\n }\n\n this.features.copyRdfaPatterns = true;\n }\n }\n\n /**\n * If the new subject can be inherited from the parent object\n * if the resource defines no new subject.\n * @param {string} name The current tag name.\n * @returns {boolean} If the subject can be inherited.\n */\n protected isInheritSubjectInHeadBody(name: string) {\n return this.features.inheritSubjectInHeadBody && (name === 'head' || name === 'body');\n }\n\n /**\n * Add a list mapping for the given predicate and object in the active tag.\n * @param {IActiveTag} activeTag The active tag.\n * @param {Term | boolean} subject A subject term, this will only be used to create a separate list\n * if activeTag.explicitNewSubject is true.\n * @param {Term} predicate A predicate term.\n * @param {Term | boolean} currentObjectResource The current object resource.\n */\n protected addListMapping(activeTag: IActiveTag, subject: RDF.Quad_Subject | boolean, predicate: RDF.Quad_Predicate,\n currentObjectResource: RDF.Quad_Object | boolean) {\n if (activeTag.explicitNewSubject) {\n const bNode = this.util.createBlankNode();\n this.emitTriple(this.util.getResourceOrBaseIri(subject, activeTag), predicate, bNode);\n this.emitTriple(bNode, this.util.dataFactory.namedNode(Util.RDF + 'first'),\n this.util.getResourceOrBaseIri(currentObjectResource, activeTag));\n this.emitTriple(bNode, this.util.dataFactory.namedNode(Util.RDF + 'rest'),\n this.util.dataFactory.namedNode(Util.RDF + 'nil'));\n } else {\n let predicateList = activeTag.listMappingLocal[predicate.value];\n if (!predicateList) {\n activeTag.listMappingLocal[predicate.value] = predicateList = [];\n }\n if (currentObjectResource) {\n predicateList.push(currentObjectResource);\n }\n }\n }\n\n /**\n * Emit the given triple to the stream.\n * @param {Term} subject A subject term.\n * @param {Term} predicate A predicate term.\n * @param {Term} object An object term.\n */\n protected emitTriple(subject: RDF.Quad_Subject, predicate: RDF.Quad_Predicate, object: RDF.Quad_Object) {\n // Validate IRIs\n if ((subject.termType === 'NamedNode' && subject.value.indexOf(':') < 0)\n || (predicate.termType === 'NamedNode' && predicate.value.indexOf(':') < 0)\n || (object.termType === 'NamedNode' && object.value.indexOf(':') < 0)) {\n return;\n }\n this.push(this.util.dataFactory.quad(subject, predicate, object, this.defaultGraph));\n }\n\n /**\n * Emit an instantiation of the given pattern with the given parent tag.\n * @param {IActiveTag} parentTag The parent tag to instantiate in.\n * @param {IRdfaPattern} pattern The pattern to instantiate.\n * @param {string} rootPatternId The pattern id.\n */\n protected emitPatternCopy(parentTag: IActiveTag, pattern: IRdfaPattern, rootPatternId: string) {\n this.activeTagStack.push(parentTag);\n pattern.referenced = true;\n\n // Ensure that blank nodes within patterns are instantiated only once.\n // All next pattern copies will reuse the instantiated blank nodes from the first pattern.\n if (!pattern.constructedBlankNodes) {\n pattern.constructedBlankNodes = [];\n this.util.blankNodeFactory = () => {\n const bNode = this.util.dataFactory.blankNode();\n pattern.constructedBlankNodes.push(bNode);\n return bNode;\n };\n } else {\n let blankNodeIndex = 0;\n this.util.blankNodeFactory = () => pattern.constructedBlankNodes[blankNodeIndex++];\n }\n\n // Apply everything within the pattern\n this.emitPatternCopyAbsolute(pattern, true, rootPatternId);\n\n this.util.blankNodeFactory = null;\n this.activeTagStack.pop();\n }\n\n /**\n * Emit an instantiation of the given pattern with the given parent tag.\n *\n * This should probably not be called directly,\n * call {@link emitPatternCopy} instead.\n *\n * @param {IRdfaPattern} pattern The pattern to instantiate.\n * @param {boolean} root If this is the root call for the given pattern.\n * @param {string} rootPatternId The pattern id.\n */\n protected emitPatternCopyAbsolute(pattern: IRdfaPattern, root: boolean, rootPatternId: string) {\n // Stop on detection of cyclic patterns\n if (!root && pattern.attributes.property === 'rdfa:copy' && pattern.attributes.href === rootPatternId) {\n return;\n }\n\n this.onTagOpen(pattern.name, pattern.attributes);\n for (const text of pattern.text) {\n this.onText(text);\n }\n for (const child of pattern.children) {\n this.emitPatternCopyAbsolute(child, false, rootPatternId);\n }\n this.onTagClose();\n }\n\n protected initializeParser(xmlMode: boolean): HtmlParser {\n return new HtmlParser(\n <DomHandler> <any> {\n onclosetag: () => {\n try {\n this.onTagClose();\n if (this.htmlParseListener) {\n this.htmlParseListener.onTagClose();\n }\n } catch (e) {\n this.emit('error', e);\n }\n },\n onend: () => {\n try {\n this.onEnd();\n if (this.htmlParseListener) {\n this.htmlParseListener.onEnd();\n }\n } catch (e) {\n this.emit('error', e);\n }\n },\n onopentag: (name: string, attributes: {[s: string]: string}) => {\n try {\n this.onTagOpen(name, attributes);\n if (this.htmlParseListener) {\n this.htmlParseListener.onTagOpen(name, attributes);\n }\n } catch (e) {\n this.emit('error', e);\n }\n },\n ontext: (data: string) => {\n try {\n this.onText(data);\n if (this.htmlParseListener) {\n this.htmlParseListener.onText(data);\n }\n } catch (e) {\n this.emit('error', e);\n }\n },\n },\n {\n decodeEntities: true,\n recognizeSelfClosing: true,\n xmlMode,\n });\n }\n\n}\n\nexport interface IRdfaParserOptions {\n /**\n * A custom RDFJS DataFactory to construct terms and triples.\n */\n dataFactory?: RDF.DataFactory;\n /**\n * An initital default base IRI.\n */\n baseIRI?: string;\n /**\n * A default language for string literals.\n */\n language?: string;\n /**\n * The initial vocabulary.\n */\n vocab?: string;\n /**\n * The default graph for constructing quads.\n */\n defaultGraph?: RDF.Quad_Graph;\n /**\n * A hash of features that should be enabled.\n * Defaults to the features defined by the profile.\n */\n features?: IRdfaFeatures;\n /**\n * The RDFa profile to use.\n * Defaults to a profile with all possible features enabled.\n */\n profile?: RdfaProfile;\n /**\n * The content type of the document that should be parsed.\n * This can be used as an alternative to the 'profile' option.\n */\n contentType?: string;\n /**\n * An optional listener for the internal HTML parse events.\n */\n htmlParseListener?: IHtmlParseListener;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RdfaProfile.js","sourceRoot":"","sources":["RdfaProfile.ts"],"names":[],"mappings":";;;AAqEA;;GAEG;AACH,0CAA0C;AAC7B,QAAA,aAAa,GAAuC;IAC/D,EAAE,EAAE;QACF,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,IAAI;QACb,aAAa,EAAE,IAAI;QACnB,4BAA4B,EAAE,IAAI;QAClC,wBAAwB,EAAE,IAAI;QAC9B,iBAAiB,EAAE,IAAI;QACvB,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,IAAI;QAClB,gBAAgB,EAAE,IAAI;QACtB,mBAAmB,EAAE,IAAI;QACzB,mBAAmB,EAAE,IAAI;QACzB,aAAa,EAAE,IAAI;KACpB;IACD,MAAM,EAAE;QACN,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,IAAI;QACnB,4BAA4B,EAAE,IAAI;QAClC,wBAAwB,EAAE,KAAK;QAC/B,iBAAiB,EAAE,KAAK;QACxB,OAAO,EAAE,KAAK;QACd,YAAY,EAAE,KAAK;QACnB,gBAAgB,EAAE,IAAI;QACtB,mBAAmB,EAAE,IAAI;QACzB,mBAAmB,EAAE,KAAK;QAC1B,aAAa,EAAE,KAAK;KACrB;IACD,MAAM,EAAE;QACN,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,IAAI;QACnB,4BAA4B,EAAE,IAAI;QAClC,wBAAwB,EAAE,IAAI;QAC9B,iBAAiB,EAAE,IAAI;QACvB,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,IAAI;QAClB,gBAAgB,EAAE,IAAI;QACtB,mBAAmB,EAAE,IAAI;QACzB,mBAAmB,EAAE,KAAK;QAC1B,aAAa,EAAE,IAAI;KACpB;IACD,OAAO,EAAE;QACP,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,IAAI;QACnB,4BAA4B,EAAE,IAAI;QAClC,wBAAwB,EAAE,IAAI;QAC9B,iBAAiB,EAAE,IAAI;QACvB,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,IAAI;QAClB,gBAAgB,EAAE,IAAI;QACtB,mBAAmB,EAAE,IAAI;QACzB,mBAAmB,EAAE,IAAI;QACzB,aAAa,EAAE,IAAI;KACpB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,IAAI;QACb,aAAa,EAAE,IAAI;QACnB,4BAA4B,EAAE,KAAK;QACnC,wBAAwB,EAAE,KAAK;QAC/B,iBAAiB,EAAE,IAAI;QACvB,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,KAAK;QACnB,gBAAgB,EAAE,KAAK;QACvB,mBAAmB,EAAE,IAAI;QACzB,mBAAmB,EAAE,KAAK;QAC1B,aAAa,EAAE,IAAI;KACpB;CACF,CAAC;AACF,yCAAyC;AAEzC,0CAA0C;AAC7B,QAAA,iBAAiB,GAAyC;IACrE,OAAO;IACP,WAAW,EAAE,MAAM;IAEnB,QAAQ;IACR,uBAAuB,EAAE,OAAO;IAEhC,MAAM;IACN,iBAAiB,EAAE,KAAK;IACxB,UAAU,EAAE,KAAK;IACjB,eAAe,EAAE,KAAK;CACvB,CAAC;AACF,yCAAyC","sourcesContent":["/**\n * A type of RDFa profile\n */\nexport type RdfaProfile =\n '' | // All possible RDFa features\n 'core' | // https://www.w3.org/TR/rdfa-core/\n 'html' | // https://www.w3.org/TR/html-rdfa/\n 'xhtml' | // https://www.w3.org/TR/xhtml-rdfa/\n 'xml';\n\nexport interface IRdfaFeatures {\n /**\n * If the baseIRI can be set via the <base> tag.\n */\n baseTag?: boolean;\n /**\n * If the baseIRI can be set via the xml:base attribute.\n */\n xmlBase?: boolean;\n /**\n * If the language can be set via the language attribute.\n */\n langAttribute?: boolean;\n /**\n * If non-CURIE and non-URI rel and rev have to be ignored if property is present.\n */\n onlyAllowUriRelRevIfProperty?: boolean;\n /**\n * If the new subject can be inherited from the parent object if we're inside <head> or <body>\n * if the resource defines no new subject.\n */\n inheritSubjectInHeadBody?: boolean;\n /**\n * If the datetime attribute must be interpreted as datetimes.\n */\n datetimeAttribute?: boolean;\n /**\n * If the time tag contents should be interpreted as datetimes.\n */\n timeTag?: boolean;\n /**\n * If rdf:HTML as datatype should cause tag contents to be serialized to text.\n */\n htmlDatatype?: boolean;\n /**\n * If rdfa:copy property links can refer to rdfa:Pattern's for copying.\n */\n copyRdfaPatterns?: boolean;\n /**\n * If prefixes should be extracted from xmlnsPrefixMappings.\n */\n xmlnsPrefixMappings?: boolean;\n /**\n * If children of rdf:XMLLiteral should not be handled as RDFa anymore.\n * This is not part of the RDFa spec.\n */\n skipHandlingXmlLiteralChildren?: boolean;\n /**\n * If the XHTML initial context should be included in the initial prefixes.\n * see https://www.w3.org/2011/rdfa-context/xhtml-rdfa-1.1\n */\n xhtmlInitialContext?: boolean;\n /**\n * If the role attribute should be handled\n * as described in https://www.w3.org/TR/role-attribute/#using-role-in-conjunction-with-rdfa\n */\n roleAttribute?: boolean;\n}\n\n/**\n * A mapping of RDFa profile to a features object.\n */\n// tslint:disable:object-literal-sort-keys\nexport const RDFA_FEATURES: {[profile: string]: IRdfaFeatures} = {\n '': {\n baseTag: true,\n xmlBase: true,\n langAttribute: true,\n onlyAllowUriRelRevIfProperty: true,\n inheritSubjectInHeadBody: true,\n datetimeAttribute: true,\n timeTag: true,\n htmlDatatype: true,\n copyRdfaPatterns: true,\n xmlnsPrefixMappings: true,\n xhtmlInitialContext: true,\n roleAttribute: true,\n },\n 'core': {\n baseTag: false,\n xmlBase: false,\n langAttribute: true,\n onlyAllowUriRelRevIfProperty: true,\n inheritSubjectInHeadBody: false,\n datetimeAttribute: false,\n timeTag: false,\n htmlDatatype: false,\n copyRdfaPatterns: true,\n xmlnsPrefixMappings: true,\n xhtmlInitialContext: false,\n roleAttribute: false,\n },\n 'html': {\n baseTag: true,\n xmlBase: false,\n langAttribute: true,\n onlyAllowUriRelRevIfProperty: true,\n inheritSubjectInHeadBody: true,\n datetimeAttribute: true,\n timeTag: true,\n htmlDatatype: true,\n copyRdfaPatterns: true,\n xmlnsPrefixMappings: true,\n xhtmlInitialContext: false,\n roleAttribute: true,\n },\n 'xhtml': {\n baseTag: true,\n xmlBase: false,\n langAttribute: true,\n onlyAllowUriRelRevIfProperty: true,\n inheritSubjectInHeadBody: true,\n datetimeAttribute: true,\n timeTag: true,\n htmlDatatype: true,\n copyRdfaPatterns: true,\n xmlnsPrefixMappings: true,\n xhtmlInitialContext: true,\n roleAttribute: true,\n },\n 'xml': {\n baseTag: false,\n xmlBase: true,\n langAttribute: true,\n onlyAllowUriRelRevIfProperty: false,\n inheritSubjectInHeadBody: false,\n datetimeAttribute: true,\n timeTag: true,\n htmlDatatype: false,\n copyRdfaPatterns: false,\n xmlnsPrefixMappings: true,\n xhtmlInitialContext: false,\n roleAttribute: true,\n },\n};\n// tslint:enable:object-literal-sort-keys\n\n// tslint:disable:object-literal-sort-keys\nexport const RDFA_CONTENTTYPES: {[contentType: string]: RdfaProfile} = {\n // HTML\n 'text/html': 'html',\n\n // XHTML\n 'application/xhtml+xml': 'xhtml',\n\n // XML\n 'application/xml': 'xml',\n 'text/xml': 'xml',\n 'image/svg+xml': 'xml',\n};\n// tslint:enable:object-literal-sort-keys\n"]}
|
package/lib/Util.js
CHANGED
|
@@ -107,7 +107,7 @@ class Util {
|
|
|
107
107
|
if (fragmentIndex >= 0) {
|
|
108
108
|
href = href.substr(0, fragmentIndex);
|
|
109
109
|
}
|
|
110
|
-
return this.dataFactory.namedNode(relative_to_absolute_iri_1.resolve(href, this.baseIRI.value));
|
|
110
|
+
return this.dataFactory.namedNode((0, relative_to_absolute_iri_1.resolve)(href, this.baseIRI.value));
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* If the term is a boolean, return the baseIRI, otherwise return the term as-is.
|
|
@@ -163,7 +163,7 @@ class Util {
|
|
|
163
163
|
term = term || '';
|
|
164
164
|
if (!allowSafeCurie) {
|
|
165
165
|
if (!vocab) {
|
|
166
|
-
term = relative_to_absolute_iri_1.resolve(term, this.getBaseIriTerm(activeTag).value);
|
|
166
|
+
term = (0, relative_to_absolute_iri_1.resolve)(term, this.getBaseIriTerm(activeTag).value);
|
|
167
167
|
}
|
|
168
168
|
if (!Util.isValidIri(term)) {
|
|
169
169
|
return null;
|
|
@@ -192,10 +192,10 @@ class Util {
|
|
|
192
192
|
let iri = Util.expandPrefixedTerm(term, activeTag);
|
|
193
193
|
// Resolve against baseIRI if in base-mode, or if the term was a prefixed relative IRI
|
|
194
194
|
if (!vocab) {
|
|
195
|
-
iri = relative_to_absolute_iri_1.resolve(iri, this.getBaseIriTerm(activeTag).value);
|
|
195
|
+
iri = (0, relative_to_absolute_iri_1.resolve)(iri, this.getBaseIriTerm(activeTag).value);
|
|
196
196
|
}
|
|
197
197
|
else if (term !== iri) {
|
|
198
|
-
iri = relative_to_absolute_iri_1.resolve(iri, this.baseIRIDocument.value);
|
|
198
|
+
iri = (0, relative_to_absolute_iri_1.resolve)(iri, this.baseIRIDocument.value);
|
|
199
199
|
}
|
|
200
200
|
if (!Util.isValidIri(iri)) {
|
|
201
201
|
return null;
|
package/lib/Util.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Util.js","sourceRoot":"","sources":["Util.ts"],"names":[],"mappings":";;;AACA,uEAAiD;AAEjD,+CAA6D;AAC7D,uDAA6C;AAE7C;;GAEG;AACH,MAAa,IAAI;IA4Bf,YAAY,WAA4B,EAAE,OAAe;QACvD,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,IAAI,8BAAW,EAAE,CAAC;QAC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IAAI,EAAE,UAAU;KACjB;IACD,EAAE,KAAK,EAAE,kCAAkC,EAAE,IAAI,EAAE,MAAM,EAAE;IAC3D,EAAE,KAAK,EAAE,uEAAuE,EAAE,IAAI,EAAE,MAAM,EAAE;IAChG,EAAE,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,YAAY,EAAE;IACpD,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE;CACrC,CAAC;AACsB,cAAS,GAAW,kDAAkD,CAAC","sourcesContent":["import * as RDF from \"@rdfjs/types\";\nimport {resolve} from \"relative-to-absolute-iri\";\nimport {IActiveTag} from \"./IActiveTag\";\nimport {RDFA_CONTENTTYPES, RdfaProfile} from \"./RdfaProfile\";\nimport {DataFactory} from \"rdf-data-factory\";\n\n/**\n * A collection of utility functions.\n */\nexport class Util {\n\n public static readonly RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';\n public static readonly XSD = 'http://www.w3.org/2001/XMLSchema#';\n public static readonly RDFA = 'http://www.w3.org/ns/rdfa#';\n\n private static readonly PREFIX_REGEX: RegExp = /\\s*([^:\\s]*)*:\\s*([^\\s]*)*\\s*/g;\n private static readonly TIME_REGEXES: { regex: RegExp, type: string }[] = [\n {\n regex: /^-?P([0-9]+Y)?([0-9]+M)?([0-9]+D)?(T([0-9]+H)?([0-9]+M)?([0-9]+(\\.[0-9])?S)?)?$/,\n type: 'duration',\n },\n {\n regex: /^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]((Z?)|([\\+-][0-9][0-9]:[0-9][0-9]))$/,\n type: 'dateTime',\n },\n { regex: /^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/, type: 'date' },\n { regex: /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9]((Z?)|([\\+-][0-9][0-9]:[0-9][0-9]))$/, type: 'time' },\n { regex: /^[0-9]+-[0-9][0-9]$/, type: 'gYearMonth' },\n { regex: /^[0-9]+$/, type: 'gYear' },\n ];\n private static readonly IRI_REGEX: RegExp = /^([A-Za-z][A-Za-z0-9+-.]*|_):[^ \"<>{}|\\\\\\[\\]`]*$/;\n\n public readonly dataFactory: RDF.DataFactory;\n public baseIRI: RDF.NamedNode;\n public blankNodeFactory: () => RDF.BlankNode;\n private readonly baseIRIDocument: RDF.NamedNode;\n\n constructor(dataFactory: RDF.DataFactory, baseIRI: string) {\n this.dataFactory = dataFactory || new DataFactory();\n this.baseIRI = this.dataFactory.namedNode(baseIRI || '');\n this.baseIRIDocument = this.baseIRI;\n }\n\n /**\n * Retrieve the prefixes of the current tag's attributes.\n * @param {{[p: string]: string}} attributes A tag's attributes.\n * @param {{[p: string]: string}} parentPrefixes The prefixes from the parent tag.\n * @param {boolean} xmlnsPrefixMappings If prefixes should be extracted from xmlnsPrefixMappings.\n * @return {{[p: string]: string}} The new prefixes.\n */\n public static parsePrefixes(attributes: {[s: string]: string},\n parentPrefixes: {[prefix: string]: string},\n xmlnsPrefixMappings: boolean): {[prefix: string]: string} {\n const additionalPrefixes: {[prefix: string]: string} = {};\n if (xmlnsPrefixMappings) {\n for (const attribute in attributes) {\n if (attribute.startsWith('xmlns')) {\n additionalPrefixes[attribute.substr(6)] = attributes[attribute];\n }\n }\n }\n\n if (attributes.prefix || Object.keys(additionalPrefixes).length > 0) {\n const prefixes: {[prefix: string]: string} = { ...parentPrefixes, ...additionalPrefixes };\n\n if (attributes.prefix) {\n let prefixMatch;\n // tslint:disable-next-line:no-conditional-assignment\n while (prefixMatch = Util.PREFIX_REGEX.exec(attributes.prefix)) {\n prefixes[prefixMatch[1]] = prefixMatch[2];\n }\n }\n\n return prefixes;\n } else {\n return parentPrefixes;\n }\n }\n\n /**\n * Expand the given term value based on the given prefixes.\n * @param {string} term A term value.\n * @param {{[p: string]: string}[]} prefixes The available prefixes.\n * @return {string} An expanded URL, or the term as-is.\n */\n public static expandPrefixedTerm(term: string, activeTag: IActiveTag): string {\n // Check if the term is prefixed\n const colonIndex: number = term.indexOf(':');\n let prefix: string;\n let local: string;\n if (colonIndex >= 0) {\n prefix = term.substr(0, colonIndex);\n local = term.substr(colonIndex + 1);\n }\n\n // Expand default namespace\n if (prefix === '') {\n return 'http://www.w3.org/1999/xhtml/vocab#' + local;\n }\n\n // Try to expand the prefix\n if (prefix) {\n const prefixElement = activeTag.prefixesAll[prefix];\n if (prefixElement) {\n return prefixElement + local;\n }\n }\n\n // Try to expand the term\n if (term) {\n const expandedTerm = activeTag.prefixesAll[term.toLocaleLowerCase()];\n if (expandedTerm) {\n return expandedTerm;\n }\n }\n\n return term;\n }\n\n /**\n * Check if the given IRI is valid.\n * @param {string} iri A potential IRI.\n * @return {boolean} If the given IRI is valid.\n */\n public static isValidIri(iri: string): boolean {\n return Util.IRI_REGEX.test(iri);\n }\n\n /**\n * Determine the RDFa profile from the given content type.\n * Defaults to the default RDFa profile (all features enabled) for unknown content types.\n * @param {string} contentType A content type.\n * @returns {RdfaProfile} An RDFa profile.\n */\n public static contentTypeToProfile(contentType: string): RdfaProfile {\n return RDFA_CONTENTTYPES[contentType] || '';\n }\n\n /**\n * Get the base IRI.\n * @param {string} baseIriValue A base IRI value.\n * @return A base IRI named node.\n */\n public getBaseIRI(baseIriValue: string): RDF.NamedNode {\n let href: string = baseIriValue;\n const fragmentIndex = href.indexOf('#');\n if (fragmentIndex >= 0) {\n href = href.substr(0, fragmentIndex);\n }\n return this.dataFactory.namedNode(resolve(href, this.baseIRI.value));\n }\n\n /**\n * If the term is a boolean, return the baseIRI, otherwise return the term as-is.\n * @param {Term | boolean} term A term or boolean, where the boolean indicates the baseIRI.\n * @param {IActiveTag} activeTag An active tag.\n * @returns {Term} A term.\n */\n public getResourceOrBaseIri(term: RDF.Term | boolean, activeTag: IActiveTag): RDF.NamedNode {\n return term === true ? this.getBaseIriTerm(activeTag) : <RDF.NamedNode> term;\n }\n\n /**\n * Get the active base IRI as an RDF term.\n * @param {IActiveTag} activeTag The active tag.\n * @return {NamedNode} The base IRI term.\n */\n public getBaseIriTerm(activeTag: IActiveTag): RDF.NamedNode {\n return activeTag.localBaseIRI || this.baseIRI;\n }\n\n /**\n * Create vocab terms for the given terms attribute.\n * @param {string} terms An attribute value.\n * @param {IActiveTag} activeTag The current active tag.\n * @param {boolean} allowTerms If terms are allowed (strings without ':')\n * @param {boolean} allowBlankNode If blank nodes are allowed.\n * @return {Term[]} The IRI terms.\n */\n public createVocabIris<B extends boolean>(terms: string, activeTag: IActiveTag, allowTerms: boolean,\n allowBlankNode: B): B extends true\n ? (RDF.BlankNode | RDF.NamedNode)[] : RDF.NamedNode[];\n public createVocabIris(terms: string, activeTag: IActiveTag, allowTerms: boolean,\n allowBlankNode: boolean): (RDF.NamedNode | RDF.BlankNode)[] {\n return terms.split(/\\s+/)\n .filter((term) => term && (allowTerms || term.indexOf(':') >= 0))\n .map((property) => this.createIri(property, activeTag, true, true, allowBlankNode))\n .filter((term) => term != null);\n }\n\n /**\n * Create a new literal node.\n * @param {string} literal The literal value.\n * @param {IActiveTag} activeTag The current active tag.\n * @return {Literal} A new literal node.\n */\n public createLiteral(literal: string, activeTag: IActiveTag): RDF.Literal {\n if (activeTag.interpretObjectAsTime && !activeTag.datatype) {\n for (const entry of Util.TIME_REGEXES) {\n if (literal.match(entry.regex)) {\n activeTag.datatype = this.dataFactory.namedNode(Util.XSD + entry.type);\n break;\n }\n }\n }\n return this.dataFactory.literal(literal, activeTag.datatype || activeTag.language);\n }\n\n /**\n * Create a blank node.\n * @returns {BlankNode} A new blank node.\n */\n public createBlankNode(): RDF.BlankNode {\n if (this.blankNodeFactory) {\n return this.blankNodeFactory();\n }\n return this.dataFactory.blankNode();\n }\n\n /**\n * Create a named node for the given term.\n * This will take care of prefix detection.\n * @param {string} term A term string (CURIE or IRI, aka safe-CURIE in RDFa spec).\n * @param {IActiveTag} activeTag The current active tag.\n * @param {boolean} vocab If creating an IRI in vocab-mode (based on vocab IRI),\n * or in base-mode (based on base IRI).\n * @param {boolean} allowSafeCurie If safe CURIEs are allowed\n * (invalid CURIEs between square brackets will return null)\n * Otherwise, only IRIs are allowed.\n * @param {boolean} allowBlankNode If blank nodes are allowed. Otherwise null will be returned.\n * @return {Term} An RDF term or null.\n */\n public createIri<B extends boolean>(term: string, activeTag: IActiveTag, vocab: boolean, allowSafeCurie: boolean,\n allowBlankNode: B): B extends true\n ? (RDF.NamedNode | RDF.BlankNode) : RDF.NamedNode;\n public createIri<B extends boolean>(term: string, activeTag: IActiveTag, vocab: boolean, allowSafeCurie: boolean,\n allowBlankNode: B): RDF.NamedNode | RDF.BlankNode {\n term = term || '';\n\n if (!allowSafeCurie) {\n if (!vocab) {\n term = resolve(term, this.getBaseIriTerm(activeTag).value);\n }\n if (!Util.isValidIri(term)) {\n return null;\n }\n return this.dataFactory.namedNode(term);\n }\n\n // Handle strict CURIEs\n if (term.length > 0 && term[0] === '[' && term[term.length - 1] === ']') {\n term = term.substr(1, term.length - 2);\n\n // Strict CURIEs MUST have a prefix separator\n if (term.indexOf(':') < 0) {\n return null;\n }\n }\n\n // Handle blank nodes\n if (term.startsWith('_:')) {\n return allowBlankNode ? this.dataFactory.blankNode(term.substr(2) || 'b_identity') : null;\n }\n\n // Handle vocab IRIs\n if (vocab) {\n if (activeTag.vocab && term.indexOf(':') < 0) {\n return this.dataFactory.namedNode(activeTag.vocab + term);\n }\n }\n\n // Handle prefixed IRIs\n let iri: string = Util.expandPrefixedTerm(term, activeTag);\n // Resolve against baseIRI if in base-mode, or if the term was a prefixed relative IRI\n if (!vocab) {\n iri = resolve(iri, this.getBaseIriTerm(activeTag).value);\n } else if (term !== iri) {\n iri = resolve(iri, this.baseIRIDocument.value);\n }\n if (!Util.isValidIri(iri)) {\n return null;\n }\n return this.dataFactory.namedNode(iri);\n }\n\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rdfa-streaming-parser",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "A fast and lightweight streaming RDFa parser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rdfa",
|
|
@@ -24,14 +24,17 @@
|
|
|
24
24
|
"lib/**/*.d.ts",
|
|
25
25
|
"lib/**/*.js",
|
|
26
26
|
"lib/**/*.json",
|
|
27
|
+
"lib/**/*.js.map",
|
|
27
28
|
"index.d.ts",
|
|
29
|
+
"index.js.map",
|
|
28
30
|
"index.js"
|
|
29
31
|
],
|
|
30
32
|
"dependencies": {
|
|
31
33
|
"@rdfjs/types": "*",
|
|
32
|
-
"htmlparser2": "^
|
|
34
|
+
"htmlparser2": "^8.0.0",
|
|
33
35
|
"rdf-data-factory": "^1.1.0",
|
|
34
|
-
"relative-to-absolute-iri": "^1.0.2"
|
|
36
|
+
"relative-to-absolute-iri": "^1.0.2",
|
|
37
|
+
"readable-stream": "^4.0.0"
|
|
35
38
|
},
|
|
36
39
|
"pre-commit": [
|
|
37
40
|
"build",
|
|
@@ -39,28 +42,31 @@
|
|
|
39
42
|
"test"
|
|
40
43
|
],
|
|
41
44
|
"devDependencies": {
|
|
42
|
-
"@types/jest": "^
|
|
45
|
+
"@types/jest": "^28.0.0",
|
|
43
46
|
"@types/jest-each": "^24.3.0",
|
|
44
|
-
"@types/
|
|
45
|
-
"arrayify-stream": "^
|
|
47
|
+
"@types/readable-stream": "^2.3.14",
|
|
48
|
+
"arrayify-stream": "^2.0.0",
|
|
46
49
|
"coveralls": "^3.0.0",
|
|
47
|
-
"jest": "^
|
|
48
|
-
"jest-each": "^
|
|
50
|
+
"jest": "^28.0.0",
|
|
51
|
+
"jest-each": "^28.0.0",
|
|
49
52
|
"jest-rdf": "^1.7.0",
|
|
50
53
|
"manual-git-changelog": "^1.0.1",
|
|
51
54
|
"pre-commit": "^1.2.2",
|
|
52
55
|
"rdf-quad": "^1.5.0",
|
|
53
56
|
"rdf-test-suite": "^1.13.4",
|
|
54
57
|
"streamify-string": "^1.0.1",
|
|
55
|
-
"ts-jest": "^
|
|
58
|
+
"ts-jest": "^28.0.0",
|
|
59
|
+
"ts-loader": "^9.3.1",
|
|
56
60
|
"tslint": "^6.0.0",
|
|
57
61
|
"tslint-eslint-rules": "^5.3.1",
|
|
58
|
-
"typescript": "^4.0.0"
|
|
62
|
+
"typescript": "^4.0.0",
|
|
63
|
+
"webpack": "^5.73.0",
|
|
64
|
+
"webpack-cli": "^4.10.0"
|
|
59
65
|
},
|
|
60
66
|
"jest": {
|
|
61
67
|
"globals": {
|
|
62
68
|
"ts-jest": {
|
|
63
|
-
"
|
|
69
|
+
"tsconfig": "test/tsconfig.json"
|
|
64
70
|
}
|
|
65
71
|
},
|
|
66
72
|
"setupFilesAfterEnv": [
|
|
@@ -123,7 +129,5 @@
|
|
|
123
129
|
"spec-1-xml-earl": "rdf-test-suite spec/parser.js http://rdfa.info/test-suite/test-cases/rdfa1.0/xml/manifest.ttl -i '{ \"profile\": \"xml\" }' -c .rdf-test-suite-cache/ -o earl -p spec/earl-meta.json > spec/earl-1-rdfastreamingparser-xml.ttl",
|
|
124
130
|
"spec-clean": "rm -r .rdf-test-suite-cache/"
|
|
125
131
|
},
|
|
126
|
-
"
|
|
127
|
-
"@types/rdf-js": "^4.0.0"
|
|
128
|
-
}
|
|
132
|
+
"sideEffects": false
|
|
129
133
|
}
|