Beispiel #1
0
        /// <summary>
        /// Validates Id attribute based on following syntax rules,
        /// <br/>
        /// attribute(URI == rdf:ID, string-value == rdf-id)
        /// </summary>
        /// <param name="outputGraph">Graph to add the generated triples.</param>
        internal override void Match(Graph outputGraph)
        {
            if (innerAttribute.Uri != IDUri)
            {
                throw new RdfXmlParserException(Constants.ErrorMessageIds.MsgIdAttributeUriNotMatch, innerAttribute.LineInfo);
            }

            try
            {
                ProductionRdfId rdfId = new ProductionRdfId(innerAttribute.StringValue);
                rdfId.Match(outputGraph);
            }
            catch (RdfXmlParserException ex)
            {
                throw new RdfXmlParserException(ex.InnerException, ex.ErrorMessageId, innerAttribute.LineInfo);
            }

            //Constraint:: constraint-id applies to the values of rdf:ID attributes
            //Each application of production idAttr matches an attribute. The pair formed by
            //the ·string-value· accessor of the matched attribute and the ·base-uri·
            //accessor of the matched attribute is unique within a single RDF/XML document.
            if (IsIdAlreadyDefined(outputGraph))
            {
                throw new RdfXmlParserException(Constants.ErrorMessageIds.MsgIdAttributeIdDefinedMoreThanOnce, innerAttribute.LineInfo);
            }
        }
        /// <summary>
        /// Validates nodeID attribute based on following syntax rules,
        /// <br/>
        /// attribute(URI == rdf:nodeID, string-value == rdf-id)
        /// </summary>
        /// <param name="outputGraph">Graph to add the generated triples.</param>
        internal override void Match(Graph outputGraph)
        {
            if (innerAttribute.Uri != NodeIDUri)
            {
                throw new RdfXmlParserException(Constants.ErrorMessageIds.MsgNodeIdAttributeUriNotMatch, innerAttribute.LineInfo);
            }

            try
            {
                ProductionRdfId rdfId = new ProductionRdfId(innerAttribute.StringValue);
                rdfId.Match(outputGraph);
            }
            catch (RdfXmlParserException ex)
            {
                throw new RdfXmlParserException(ex.InnerException, ex.ErrorMessageId, innerAttribute.LineInfo);
            }
        }