onTagProperty(tag, activeTag, parentTag) {
        const tagExpanded = RdfXmlParser.expandPrefixedTerm(tag.name, activeTag.ns, this);
        activeTag.childrenParseType = ParseType.RESOURCE;
        activeTag.subject = parentTag.subject; // Inherit parent subject
        if (tagExpanded.uri === RdfXmlParser.RDF && tagExpanded.local === 'li') {
            // Convert rdf:li to rdf:_x
            if (!parentTag.listItemCounter) {
                parentTag.listItemCounter = 1;
            }
            activeTag.predicate = this.uriToNamedNode(tagExpanded.uri + '_' + parentTag.listItemCounter++);
        }
        else {
            activeTag.predicate = this.uriToNamedNode(tagExpanded.uri + tagExpanded.local);
        }
        // Check forbidden property element names
        if (tagExpanded.uri === RdfXmlParser.RDF
            && RdfXmlParser.FORBIDDEN_PROPERTY_ELEMENTS.indexOf(tagExpanded.local) >= 0) {
            throw this.newParseError(`Illegal property element name: ${tagExpanded.local}`);
        }
        activeTag.predicateSubPredicates = [];
        activeTag.predicateSubObjects = [];
        let parseType = false;
        let attributedProperty = false;
        // Collect all attributes as triples
        // Assign subject value only after all attributes have been processed, because baseIRI may change the final val
        let activeSubSubjectValue = null;
        let subSubjectValueBlank = true;
        const predicates = [];
        const objects = [];
        for (const propertyAttributeKey in tag.attributes) {
            const propertyAttributeValue = tag.attributes[propertyAttributeKey];
            const propertyAttributeKeyExpanded = RdfXmlParser
                .expandPrefixedTerm(propertyAttributeKey, activeTag.ns, this);
            if (propertyAttributeKeyExpanded.uri === RdfXmlParser.RDF) {
                switch (propertyAttributeKeyExpanded.local) {
                    case 'resource':
                        if (activeSubSubjectValue) {
                            throw this.newParseError(`Found both rdf:resource (${propertyAttributeValue}) and rdf:nodeID (${activeSubSubjectValue}).`);
                        }
                        if (parseType) {
                            throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${propertyAttributeValue})`);
                        }
                        activeTag.hadChildren = true;
                        activeSubSubjectValue = propertyAttributeValue;
                        subSubjectValueBlank = false;
                        continue;
                    case 'datatype':
                        if (attributedProperty) {
                            throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${propertyAttributeValue}).`);
                        }
                        if (parseType) {
                            throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${propertyAttributeValue})`);
                        }
                        activeTag.datatype = this.valueToUri(propertyAttributeValue, activeTag);
                        continue;
                    case 'nodeID':
                        if (attributedProperty) {
                            throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${propertyAttributeValue}).`);
                        }
                        if (activeTag.hadChildren) {
                            throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${propertyAttributeValue}).`);
                        }
                        if (parseType) {
                            throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${propertyAttributeValue})`);
                        }
                        this.validateNcname(propertyAttributeValue);
                        activeTag.hadChildren = true;
                        activeSubSubjectValue = propertyAttributeValue;
                        subSubjectValueBlank = true;
                        continue;
                    case 'bagID':
                        throw this.newParseError(`rdf:bagID is not supported.`);
                    case 'parseType':
                        // Validation
                        if (attributedProperty) {
                            throw this.newParseError(`rdf:parseType is not allowed when non-rdf:* property attributes are present`);
                        }
                        if (activeTag.datatype) {
                            throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${activeTag.datatype.value})`);
                        }
                        if (activeSubSubjectValue) {
                            throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${activeSubSubjectValue})`);
                        }
                        if (propertyAttributeValue === 'Resource') {
                            parseType = true;
                            activeTag.childrenParseType = ParseType.PROPERTY;
                            // Turn this property element into a node element
                            const nestedBNode = this.dataFactory.blankNode();
                            this.emitTriple(activeTag.subject, activeTag.predicate, nestedBNode, activeTag.reifiedStatementId);
                            activeTag.subject = nestedBNode;
                            activeTag.predicate = null;
                        }
                        else if (propertyAttributeValue === 'Collection') {
                            parseType = true;
                            // Interpret children as being part of an rdf:List
                            activeTag.hadChildren = true;
                            activeTag.childrenCollectionSubject = activeTag.subject;
                            activeTag.childrenCollectionPredicate = activeTag.predicate;
                            subSubjectValueBlank = false;
                        }
                        else if (propertyAttributeValue === 'Literal') {
                            parseType = true;
                            // Interpret children as being part of a literal string
                            activeTag.childrenTagsToString = true;
                            activeTag.childrenStringTags = [];
                        }
                        continue;
                    case 'ID':
                        this.validateNcname(propertyAttributeValue);
                        activeTag.reifiedStatementId = this.valueToUri('#' + propertyAttributeValue, activeTag);
                        this.claimNodeId(activeTag.reifiedStatementId);
                        continue;
                }
            }
            else if (propertyAttributeKeyExpanded.uri === RdfXmlParser.XML
                && propertyAttributeKeyExpanded.local === 'lang') {
                activeTag.language = propertyAttributeValue === ''
                    ? null : propertyAttributeValue.toLowerCase();
                continue;
            }
            // Interpret attributes at this point as properties via implicit blank nodes on the property,
            // but we ignore attributes that have no prefix or known expanded URI
            if (propertyAttributeKeyExpanded.prefix !== 'xml' && propertyAttributeKeyExpanded.prefix !== 'xmlns'
                && propertyAttributeKeyExpanded.uri) {
                if (parseType || activeTag.datatype) {
                    throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${propertyAttributeValue}`);
                }
                activeTag.hadChildren = true;
                attributedProperty = true;
                predicates.push(this.uriToNamedNode(propertyAttributeKeyExpanded.uri + propertyAttributeKeyExpanded.local));
                objects.push(this.dataFactory.literal(propertyAttributeValue, activeTag.datatype || activeTag.language));
            }
        }
        // Create the subject value _after_ all attributes have been processed
        if (activeSubSubjectValue !== null) {
            const subjectParent = activeTag.subject;
            activeTag.subject = subSubjectValueBlank
                ? this.dataFactory.blankNode(activeSubSubjectValue) : this.valueToUri(activeSubSubjectValue, activeTag);
            this.emitTriple(subjectParent, activeTag.predicate, activeTag.subject, activeTag.reifiedStatementId);
            // Emit our buffered triples
            for (let i = 0; i < predicates.length; i++) {
                this.emitTriple(activeTag.subject, predicates[i], objects[i], null);
            }
            activeTag.predicateEmitted = true;
        }
        else if (subSubjectValueBlank) {
            // The current property element has no defined subject
            // Let's buffer the properties until the child node defines a subject,
            // or if the tag closes.
            activeTag.predicateSubPredicates = predicates;
            activeTag.predicateSubObjects = objects;
            activeTag.predicateEmitted = false;
        }
    }
/**
     * Handle the given property element in property-mode.
     * @param {QualifiedTag} tag A SAX tag.
     * @param {IActiveTag} activeTag The currently active tag.
     * @param {IActiveTag} parentTag The parent tag or null.
     */
Handle the given property element in property-mode.
@param {QualifiedTag} tag A SAX tag.
@param {IActiveTag} activeTag The currently active tag.
@param {IActiveTag} parentTag The parent tag or null.
Handle the given property element in property - mode . @param { QualifiedTag } tag A SAX tag . @param { IActiveTag } activeTag The currently active tag . @param { IActiveTag } parentTag The parent tag or null .
onTagProperty(tag, activeTag, parentTag) {
        const tagExpanded = RdfXmlParser.expandPrefixedTerm(tag.name, activeTag.ns, this);
        activeTag.childrenParseType = ParseType.RESOURCE;
        activeTag.subject = parentTag.subject; 
        if (tagExpanded.uri === RdfXmlParser.RDF && tagExpanded.local === 'li') {
            if (!parentTag.listItemCounter) {
                parentTag.listItemCounter = 1;
            }
            activeTag.predicate = this.uriToNamedNode(tagExpanded.uri + '_' + parentTag.listItemCounter++);
        }
        else {
            activeTag.predicate = this.uriToNamedNode(tagExpanded.uri + tagExpanded.local);
        }
        if (tagExpanded.uri === RdfXmlParser.RDF
            && RdfXmlParser.FORBIDDEN_PROPERTY_ELEMENTS.indexOf(tagExpanded.local) >= 0) {
            throw this.newParseError(`Illegal property element name: ${tagExpanded.local}`);
        }
        activeTag.predicateSubPredicates = [];
        activeTag.predicateSubObjects = [];
        let parseType = false;
        let attributedProperty = false;
        let activeSubSubjectValue = null;
        let subSubjectValueBlank = true;
        const predicates = [];
        const objects = [];
        for (const propertyAttributeKey in tag.attributes) {
            const propertyAttributeValue = tag.attributes[propertyAttributeKey];
            const propertyAttributeKeyExpanded = RdfXmlParser
                .expandPrefixedTerm(propertyAttributeKey, activeTag.ns, this);
            if (propertyAttributeKeyExpanded.uri === RdfXmlParser.RDF) {
                switch (propertyAttributeKeyExpanded.local) {
                    case 'resource':
                        if (activeSubSubjectValue) {
                            throw this.newParseError(`Found both rdf:resource (${propertyAttributeValue}) and rdf:nodeID (${activeSubSubjectValue}).`);
                        }
                        if (parseType) {
                            throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${propertyAttributeValue})`);
                        }
                        activeTag.hadChildren = true;
                        activeSubSubjectValue = propertyAttributeValue;
                        subSubjectValueBlank = false;
                        continue;
                    case 'datatype':
                        if (attributedProperty) {
                            throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${propertyAttributeValue}).`);
                        }
                        if (parseType) {
                            throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${propertyAttributeValue})`);
                        }
                        activeTag.datatype = this.valueToUri(propertyAttributeValue, activeTag);
                        continue;
                    case 'nodeID':
                        if (attributedProperty) {
                            throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${propertyAttributeValue}).`);
                        }
                        if (activeTag.hadChildren) {
                            throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${propertyAttributeValue}).`);
                        }
                        if (parseType) {
                            throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${propertyAttributeValue})`);
                        }
                        this.validateNcname(propertyAttributeValue);
                        activeTag.hadChildren = true;
                        activeSubSubjectValue = propertyAttributeValue;
                        subSubjectValueBlank = true;
                        continue;
                    case 'bagID':
                        throw this.newParseError(`rdf:bagID is not supported.`);
                    case 'parseType':
                        if (attributedProperty) {
                            throw this.newParseError(`rdf:parseType is not allowed when non-rdf:* property attributes are present`);
                        }
                        if (activeTag.datatype) {
                            throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${activeTag.datatype.value})`);
                        }
                        if (activeSubSubjectValue) {
                            throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${activeSubSubjectValue})`);
                        }
                        if (propertyAttributeValue === 'Resource') {
                            parseType = true;
                            activeTag.childrenParseType = ParseType.PROPERTY;
                            const nestedBNode = this.dataFactory.blankNode();
                            this.emitTriple(activeTag.subject, activeTag.predicate, nestedBNode, activeTag.reifiedStatementId);
                            activeTag.subject = nestedBNode;
                            activeTag.predicate = null;
                        }
                        else if (propertyAttributeValue === 'Collection') {
                            parseType = true;
                            activeTag.hadChildren = true;
                            activeTag.childrenCollectionSubject = activeTag.subject;
                            activeTag.childrenCollectionPredicate = activeTag.predicate;
                            subSubjectValueBlank = false;
                        }
                        else if (propertyAttributeValue === 'Literal') {
                            parseType = true;
                            activeTag.childrenTagsToString = true;
                            activeTag.childrenStringTags = [];
                        }
                        continue;
                    case 'ID':
                        this.validateNcname(propertyAttributeValue);
                        activeTag.reifiedStatementId = this.valueToUri('#' + propertyAttributeValue, activeTag);
                        this.claimNodeId(activeTag.reifiedStatementId);
                        continue;
                }
            }
            else if (propertyAttributeKeyExpanded.uri === RdfXmlParser.XML
                && propertyAttributeKeyExpanded.local === 'lang') {
                activeTag.language = propertyAttributeValue === ''
                    ? null : propertyAttributeValue.toLowerCase();
                continue;
            }
            if (propertyAttributeKeyExpanded.prefix !== 'xml' && propertyAttributeKeyExpanded.prefix !== 'xmlns'
                && propertyAttributeKeyExpanded.uri) {
                if (parseType || activeTag.datatype) {
                    throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${propertyAttributeValue}`);
                }
                activeTag.hadChildren = true;
                attributedProperty = true;
                predicates.push(this.uriToNamedNode(propertyAttributeKeyExpanded.uri + propertyAttributeKeyExpanded.local));
                objects.push(this.dataFactory.literal(propertyAttributeValue, activeTag.datatype || activeTag.language));
            }
        }
        if (activeSubSubjectValue !== null) {
            const subjectParent = activeTag.subject;
            activeTag.subject = subSubjectValueBlank
                ? this.dataFactory.blankNode(activeSubSubjectValue) : this.valueToUri(activeSubSubjectValue, activeTag);
            this.emitTriple(subjectParent, activeTag.predicate, activeTag.subject, activeTag.reifiedStatementId);
            for (let i = 0; i < predicates.length; i++) {
                this.emitTriple(activeTag.subject, predicates[i], objects[i], null);
            }
            activeTag.predicateEmitted = true;
        }
        else if (subSubjectValueBlank) {
            activeTag.predicateSubPredicates = predicates;
            activeTag.predicateSubObjects = objects;
            activeTag.predicateEmitted = false;
        }
    }
onTagProperty ( tag , activeTag , parentTag ) { const tagExpanded = RdfXmlParser . expandPrefixedTerm ( tag . name , activeTag . ns , this ) ; activeTag . childrenParseType = ParseType . RESOURCE ; activeTag . subject = parentTag . subject ; if ( tagExpanded . uri === RdfXmlParser . RDF && tagExpanded . local === 'li' ) { if ( ! parentTag . listItemCounter ) { parentTag . listItemCounter = 1 ; } activeTag . predicate = this . uriToNamedNode ( tagExpanded . uri + '_' + parentTag . listItemCounter ++ ) ; } else { activeTag . predicate = this . uriToNamedNode ( tagExpanded . uri + tagExpanded . local ) ; } if ( tagExpanded . uri === RdfXmlParser . RDF && RdfXmlParser . FORBIDDEN_PROPERTY_ELEMENTS . indexOf ( tagExpanded . local ) >= 0 ) { throw this . newParseError ( ` ${ tagExpanded . local } ` ) ; } activeTag . predicateSubPredicates = [ ] ; activeTag . predicateSubObjects = [ ] ; let parseType = false ; let attributedProperty = false ; let activeSubSubjectValue = null ; let subSubjectValueBlank = true ; const predicates = [ ] ; const objects = [ ] ; for ( const propertyAttributeKey in tag . attributes ) { const propertyAttributeValue = tag . attributes [ propertyAttributeKey ] ; const propertyAttributeKeyExpanded = RdfXmlParser . expandPrefixedTerm ( propertyAttributeKey , activeTag . ns , this ) ; if ( propertyAttributeKeyExpanded . uri === RdfXmlParser . RDF ) { switch ( propertyAttributeKeyExpanded . local ) { case 'resource' : if ( activeSubSubjectValue ) { throw this . newParseError ( ` ${ propertyAttributeValue } ${ activeSubSubjectValue } ` ) ; } if ( parseType ) { throw this . newParseError ( ` ${ propertyAttributeValue } ` ) ; } activeTag . hadChildren = true ; activeSubSubjectValue = propertyAttributeValue ; subSubjectValueBlank = false ; continue ; case 'datatype' : if ( attributedProperty ) { throw this . newParseError ( ` ${ propertyAttributeValue } ` ) ; } if ( parseType ) { throw this . newParseError ( ` ${ propertyAttributeValue } ` ) ; } activeTag . datatype = this . valueToUri ( propertyAttributeValue , activeTag ) ; continue ; case 'nodeID' : if ( attributedProperty ) { throw this . newParseError ( ` ${ propertyAttributeValue } ` ) ; } if ( activeTag . hadChildren ) { throw this . newParseError ( ` ${ propertyAttributeValue } ` ) ; } if ( parseType ) { throw this . newParseError ( ` ${ propertyAttributeValue } ` ) ; } this . validateNcname ( propertyAttributeValue ) ; activeTag . hadChildren = true ; activeSubSubjectValue = propertyAttributeValue ; subSubjectValueBlank = true ; continue ; case 'bagID' : throw this . newParseError ( ` ` ) ; case 'parseType' : if ( attributedProperty ) { throw this . newParseError ( ` ` ) ; } if ( activeTag . datatype ) { throw this . newParseError ( ` ${ activeTag . datatype . value } ` ) ; } if ( activeSubSubjectValue ) { throw this . newParseError ( ` ${ activeSubSubjectValue } ` ) ; } if ( propertyAttributeValue === 'Resource' ) { parseType = true ; activeTag . childrenParseType = ParseType . PROPERTY ; const nestedBNode = this . dataFactory . blankNode ( ) ; this . emitTriple ( activeTag . subject , activeTag . predicate , nestedBNode , activeTag . reifiedStatementId ) ; activeTag . subject = nestedBNode ; activeTag . predicate = null ; } else if ( propertyAttributeValue === 'Collection' ) { parseType = true ; activeTag . hadChildren = true ; activeTag . childrenCollectionSubject = activeTag . subject ; activeTag . childrenCollectionPredicate = activeTag . predicate ; subSubjectValueBlank = false ; } else if ( propertyAttributeValue === 'Literal' ) { parseType = true ; activeTag . childrenTagsToString = true ; activeTag . childrenStringTags = [ ] ; } continue ; case 'ID' : this . validateNcname ( propertyAttributeValue ) ; activeTag . reifiedStatementId = this . valueToUri ( '#' + propertyAttributeValue , activeTag ) ; this . claimNodeId ( activeTag . reifiedStatementId ) ; continue ; } } else if ( propertyAttributeKeyExpanded . uri === RdfXmlParser . XML && propertyAttributeKeyExpanded . local === 'lang' ) { activeTag . language = propertyAttributeValue === '' ? null : propertyAttributeValue . toLowerCase ( ) ; continue ; } if ( propertyAttributeKeyExpanded . prefix !== 'xml' && propertyAttributeKeyExpanded . prefix !== 'xmlns' && propertyAttributeKeyExpanded . uri ) { if ( parseType || activeTag . datatype ) { throw this . newParseError ( ` ${ propertyAttributeValue } ` ) ; } activeTag . hadChildren = true ; attributedProperty = true ; predicates . push ( this . uriToNamedNode ( propertyAttributeKeyExpanded . uri + propertyAttributeKeyExpanded . local ) ) ; objects . push ( this . dataFactory . literal ( propertyAttributeValue , activeTag . datatype || activeTag . language ) ) ; } } if ( activeSubSubjectValue !== null ) { const subjectParent = activeTag . subject ; activeTag . subject = subSubjectValueBlank ? this . dataFactory . blankNode ( activeSubSubjectValue ) : this . valueToUri ( activeSubSubjectValue , activeTag ) ; this . emitTriple ( subjectParent , activeTag . predicate , activeTag . subject , activeTag . reifiedStatementId ) ; for ( let i = 0 ; i < predicates . length ; i ++ ) { this . emitTriple ( activeTag . subject , predicates [ i ] , objects [ i ] , null ) ; } activeTag . predicateEmitted = true ; } else if ( subSubjectValueBlank ) { activeTag . predicateSubPredicates = predicates ; activeTag . predicateSubObjects = objects ; activeTag . predicateEmitted = false ; } }
Handle the given property element in property-mode.
Handle the given property element in property - mode .
// Inherit parent subject // Convert rdf:li to rdf:_x // Check forbidden property element names // Collect all attributes as triples // Assign subject value only after all attributes have been processed, because baseIRI may change the final val // Validation // Turn this property element into a node element // Interpret children as being part of an rdf:List // Interpret children as being part of a literal string // Interpret attributes at this point as properties via implicit blank nodes on the property, // but we ignore attributes that have no prefix or known expanded URI // Create the subject value _after_ all attributes have been processed // Emit our buffered triples // The current property element has no defined subject // Let's buffer the properties until the child node defines a subject, // or if the tag closes.