예제 #1
0
        private ISparqlPath TryParsePathAlternative(SparqlQueryParserContext context, Queue<IToken> tokens)
        {
            ISparqlPath path = this.TryParsePathSequence(context, tokens);
            IToken next;
            while (tokens.Count > 0)
            {
                next = tokens.Dequeue();
                if (next.TokenType == Token.BITWISEOR)
                {
                    path = new AlternativePath(path, this.TryParsePathSequence(context, tokens));
                }
                else
                {
                    throw new RdfParseException("Unexpected Token '" + next.GetType().ToString() + "' encountered, expected a valid path sequence/alternative token", next);
                }
            }

            return path;
        }
 public void SparqlPropertyPathTransformationAlternative()
 {
     AlternativePath path = new AlternativePath(new Property(this._factory.CreateUriNode(new Uri(NamespaceMapper.RDFS + "label"))), new Property(this._factory.CreateUriNode(new Uri(NamespaceMapper.RDFS + "comment"))));
     this.RunTest(path, new String[] { "BGP", "Union" });
 }