• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ISparqlExpression类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ISparqlExpression的典型用法代码示例。如果您正苦于以下问题:C# ISparqlExpression类的具体用法?C# ISparqlExpression怎么用?C# ISparqlExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ISparqlExpression类属于命名空间,在下文中一共展示了ISparqlExpression类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CartesianFunction

 /// <summary>
 /// Creates a new 2D Cartesian Function
 /// </summary>
 /// <param name="x1">Expression for X Coordinate of 1st point</param>
 /// <param name="y1">Expression for Y Coordinate of 1st point</param>
 /// <param name="x2">Expression for X Coordinate of 2nd point</param>
 /// <param name="y2">Expression for Y Coordinate of 2nd point</param>
 public CartesianFunction(ISparqlExpression x1, ISparqlExpression y1, ISparqlExpression x2, ISparqlExpression y2)
 {
     this._x1 = x1;
     this._y1 = y1;
     this._x2 = x2;
     this._y2 = y2;
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:14,代码来源:CartesianFunctions.cs


示例2: LeftJoin

 /// <summary>
 /// Left Joins the Multiset to another Multiset
 /// </summary>
 /// <param name="other">Other Multiset</param>
 /// <param name="expr">Expression which the Join is predicated on</param>
 /// <returns>The other Multiset</returns>
 public override BaseMultiset LeftJoin(BaseMultiset other, ISparqlExpression expr)
 {
     //If Other is Null/Empty then the Join still results in Identity
     if (other is NullMultiset) return this;
     if (other.IsEmpty) return this;
     return other;
 }
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:13,代码来源:IdentityMultiset.cs


示例3: BaseBinaryStringFunction

 /// <summary>
 /// Creates a new XPath Binary String function
 /// </summary>
 /// <param name="stringExpr">Expression</param>
 /// <param name="argExpr">Argument</param>
 /// <param name="allowNullArgument">Whether the argument may be null</param>
 /// <param name="argumentTypeValidator">Type validator for the argument</param>
 public BaseBinaryStringFunction(ISparqlExpression stringExpr, ISparqlExpression argExpr, bool allowNullArgument, Func<Uri, bool> argumentTypeValidator)
 {
     this._expr = stringExpr;
     this._arg = argExpr;
     this._allowNullArgument = allowNullArgument;
     if (this._arg == null && !this._allowNullArgument) throw new RdfParseException("Cannot create a XPath String Function which takes a String and a single argument since the expression for the argument is null");
     this._argumentTypeValidator = argumentTypeValidator;
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:15,代码来源:BaseBinaryStringFunction.cs


示例4: LeviathanCartesianFunction

 /// <summary>
 /// Creates a new 3D Cartesian Function
 /// </summary>
 /// <param name="x1">Expression for X Coordinate of 1st point</param>
 /// <param name="y1">Expression for Y Coordinate of 1st point</param>
 /// <param name="z1">Expression for Z Coordiante of 1st point</param>
 /// <param name="x2">Expression for X Coordinate of 2nd point</param>
 /// <param name="y2">Expression for Y Coordinate of 2nd point</param>
 /// <param name="z2">Expression for Z Coordinate of 2nd point</param>
 public LeviathanCartesianFunction(ISparqlExpression x1, ISparqlExpression y1, ISparqlExpression z1, ISparqlExpression x2, ISparqlExpression y2, ISparqlExpression z2)
 {
     this._x1 = x1;
     this._y1 = y1;
     this._z1 = z1;
     this._x2 = x2;
     this._y2 = y2;
     this._z2 = z2;
     this._3d = true;
 }
开发者ID:almostEric,项目名称:DotNetRDF-4.0,代码行数:19,代码来源:LeviathanCartesianFunctions.cs


示例5: Extend

        /// <summary>
        /// Creates a new Extend operator
        /// </summary>
        /// <param name="pattern">Pattern</param>
        /// <param name="expr">Expression</param>
        /// <param name="var">Variable to bind to</param>
        public Extend(ISparqlAlgebra pattern, ISparqlExpression expr, String var)
        {
            this._inner = pattern;
            this._expr = expr;
            this._var = var;

            if (this._inner.Variables.Contains(this._var))
            {
                throw new RdfQueryException("Cannot create an Extend() operator which extends the results of the inner algebra with a variable that is already used in the inner algebra");
            }
        }
开发者ID:jmahmud,项目名称:RDFer,代码行数:17,代码来源:Extend.cs


示例6: Transform

 /// <summary>
 /// Transforms an expression into a form where primary expressions may be substituted
 /// </summary>
 /// <param name="expr">Expression</param>
 /// <returns></returns>
 public ISparqlExpression Transform(ISparqlExpression expr)
 {
     if (expr.Type == SparqlExpressionType.Primary)
     {
         return this.SubstitutePrimaryExpression(expr);
     }
     else
     {
         return expr.Transform(this);
     }
 }
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:16,代码来源:IExpressionTransformer.cs


示例7: TryCreateExpression

        public bool TryCreateExpression(Uri u, List<ISparqlExpression> args, Dictionary<string, ISparqlExpression> scalarArguments, out ISparqlExpression expr)
        {
            //TODO: Add support for FullTextMatchFunction and FullTextSearchFunction

            //switch (u.ToString())
            //{

            //}

            expr = null;
            return false;
        }
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:12,代码来源:FullTextFunctionFactory.cs


示例8: MaxAggregate

 /// <summary>
 /// Creates a new MAX Aggregate
 /// </summary>
 /// <param name="distinct">Distinct Modifier</param>
 /// <param name="expr">Expression</param>
 public MaxAggregate(ISparqlExpression distinct, ISparqlExpression expr)
     : base(expr)
 {
     if (distinct is DistinctModifier)
     {
         this._distinct = true;
     }
     else
     {
         throw new RdfQueryException("The first argument to the MaxAggregate constructor must be of type DistinctModifierExpression");
     }
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:17,代码来源:MaxAggregate.cs


示例9: ReplaceFunction

        /// <summary>
        /// Creates a new SPARQL Replace function
        /// </summary>
        /// <param name="text">Text Expression</param>
        /// <param name="find">Search Expression</param>
        /// <param name="replace">Replace Expression</param>
        /// <param name="options">Options Expression</param>
        public ReplaceFunction(ISparqlExpression text, ISparqlExpression find, ISparqlExpression replace, ISparqlExpression options)
        {
            this._textExpr = text;

            //Get the Pattern
            if (find is ConstantTerm)
            {
                //If the Pattern is a Node Expression Term then it is a fixed Pattern
                IValuedNode n = find.Evaluate(null, 0);
                if (n.NodeType == NodeType.Literal)
                {
                    //Try to parse as a Regular Expression
                    try
                    {
                        string p = n.AsString();
                        Regex temp = new Regex(p);

                        //It's a Valid Pattern
                        this._fixedPattern = true;
                        this._find = p;
                    }
                    catch
                    {
                        //No catch actions
                    }
                }
            }
            this._findExpr = find;

            //Get the Replace
            if (replace is ConstantTerm)
            {
                //If the Replace is a Node Expresison Term then it is a fixed Pattern
                IValuedNode n = replace.Evaluate(null, 0);
                if (n.NodeType == NodeType.Literal)
                {
                    this._replace = n.AsString();
                    this._fixedReplace = true;
                }
            }
            this._replaceExpr = replace;

            //Get the Options
            if (options != null)
            {
                if (options is ConstantTerm)
                {
                    this.ConfigureOptions(options.Evaluate(null, 0), false);
                }
                this._optionExpr = options;
            }
        }
开发者ID:jmahmud,项目名称:RDFer,代码行数:59,代码来源:ReplaceFunction.cs


示例10: SecantFunction

 /// <summary>
 /// Creates a new Leviathan Secant Function
 /// </summary>
 /// <param name="expr">Expression</param>
 /// <param name="inverse">Whether this should be the inverse function</param>
 public SecantFunction(ISparqlExpression expr, bool inverse)
     : base(expr)
 {
     this._inverse = inverse;
     if (this._inverse)
     {
         this._func = _arcsecant;
     }
     else
     {
         this._func = _secant;
     }
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:18,代码来源:SecantFunction.cs


示例11: TangentFunction

 /// <summary>
 /// Creates a new Leviathan Tangent Function
 /// </summary>
 /// <param name="expr">Expression</param>
 /// <param name="inverse">Whether this should be the inverse function</param>
 public TangentFunction(ISparqlExpression expr, bool inverse)
     : base(expr)
 {
     this._inverse = inverse;
     if (this._inverse)
     {
         this._func = Math.Atan;
     }
     else
     {
         this._func = Math.Tan;
     }
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:18,代码来源:TangentFunction.cs


示例12: CotangentFunction

 /// <summary>
 /// Creates a new Leviathan Cotangent Function
 /// </summary>
 /// <param name="expr">Expression</param>
 /// <param name="inverse">Whether this should be the inverse function</param>
 public CotangentFunction(ISparqlExpression expr, bool inverse)
     : base(expr)
 {
     this._inverse = inverse;
     if (this._inverse)
     {
         this._func = _arccotangent;
     }
     else
     {
         this._func = _cotangent;
     }
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:18,代码来源:CotangentFunction.cs


示例13: SineFunction

 /// <summary>
 /// Creates a new Leviathan Sine Function
 /// </summary>
 /// <param name="expr">Expression</param>
 /// <param name="inverse">Whether this should be the inverse function</param>
 public SineFunction(ISparqlExpression expr, bool inverse)
     : base(expr)
 {
     this._inverse = inverse;
     if (this._inverse)
     {
         this._func = Math.Asin;
     }
     else
     {
         this._func = Math.Sin;
     }
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:18,代码来源:SineFunction.cs


示例14: RegexFunction

        /// <summary>
        /// Creates a new Regex() function expression
        /// </summary>
        /// <param name="text">Text to apply the Regular Expression to</param>
        /// <param name="pattern">Regular Expression Pattern</param>
        /// <param name="options">Regular Expression Options</param>
        public RegexFunction(ISparqlExpression text, ISparqlExpression pattern, ISparqlExpression options)
        {
            this._textExpr = text;
            this._patternExpr = pattern;

            //Get the Pattern
            if (pattern is ConstantTerm)
            {
                //If the Pattern is a Node Expression Term then it is a fixed Pattern
                INode n = pattern.Evaluate(null, 0);
                if (n.NodeType == NodeType.Literal)
                {
                    //Try to parse as a Regular Expression
                    try
                    {
                        string p = ((ILiteralNode)n).Value;
                        Regex temp = new Regex(p);

                        //It's a Valid Pattern
                        this._fixedPattern = true;
                        //this._useInStr = p.ToCharArray().All(c => Char.IsLetterOrDigit(c) || Char.IsWhiteSpace(c));
                        this._pattern = p;
                    }
                    catch
                    {
                        //No catch actions
                    }
                }
            }

            //Get the Options
            if (options != null)
            {
                this._optionExpr = options;
                if (options is ConstantTerm)
                {
                    this.ConfigureOptions(options.Evaluate(null, 0), false);
                    this._fixedOptions = true;
                    if (this._fixedPattern) this._regex = new Regex(this._pattern, this._options);
                }
            }
            else
            {
                if (this._fixedPattern) this._regex = new Regex(this._pattern);
            }
        }
开发者ID:jmahmud,项目名称:RDFer,代码行数:52,代码来源:RegexFunction.cs


示例15: TryCreateExpression

        public bool TryCreateExpression(Uri u, List<ISparqlExpression> args, Dictionary<string, ISparqlExpression> scalarArguments, out ISparqlExpression expr)
        {
            // If any scalar arguments are present, it can't be a BrightstarDB function
            if (scalarArguments.Count > 0)
            {
                expr = null;
                return false;
            }

            var func = u.ToString();
            if (func.StartsWith(BrightstarFunctionsNamespace))
            {
                func = func.Substring(BrightstarFunctionsNamespace.Length);
                ISparqlExpression brightstarFunc = null;
                switch (func)
                {
                    case BitAnd:
                        if (args.Count == 2)
                        {
                            brightstarFunc = new BitAndFunc(args[0], args[1]);
                        } 
                        else
                        {
                            throw new RdfParseException("Incorrect number of arguments for the BrightstarDB bit_and() function.");
                        }
                        break;
                    case BitOr:
                        if (args.Count == 2)
                        {
                            brightstarFunc = new BitOrFunc(args[0], args[1]);
                        }
                        else
                        {
                            throw new RdfParseException("Incorrect number of arguments for the BrightstarDB bit_and() function.");
                        }
                        break;
                }
                if (brightstarFunc != null)
                {
                    expr = brightstarFunc;
                    return true;
                }
            }
            expr = null;
            return false;
        }
开发者ID:GTuritto,项目名称:BrightstarDB,代码行数:46,代码来源:BrightstarFunctionFactory.cs


示例16: StringJoinFunction

 /// <summary>
 /// Creates a new ARQ String Join function
 /// </summary>
 /// <param name="sepExpr">Separator Expression</param>
 /// <param name="expressions">Expressions to concatentate</param>
 public StringJoinFunction(ISparqlExpression sepExpr, IEnumerable<ISparqlExpression> expressions)
 {
     if (sepExpr is ConstantTerm)
     {
         IValuedNode temp = sepExpr.Evaluate(null, 0);
         if (temp.NodeType == NodeType.Literal)
         {
             this._separator = temp.AsString();
             this._fixedSeparator = true;
         }
         else
         {
             this._sep = sepExpr;
         }
     }
     else
     {
         this._sep = sepExpr;
     }
     this._exprs.AddRange(expressions);
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:26,代码来源:StringJoinFunction.cs


示例17: AllAggregate

 /// <summary>
 /// Creates a new All Aggregate
 /// </summary>
 /// <param name="expr">Expression</param>
 /// <param name="distinct">Whether a DISTINCT modifier applies</param>
 public AllAggregate(ISparqlExpression expr, bool distinct)
     : base(expr, distinct)
 {
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:9,代码来源:AllAggregate.cs


示例18: MultiplicationExpression

 /// <summary>
 /// Creates a new Multiplication Expression
 /// </summary>
 /// <param name="leftExpr">Left Hand Expression</param>
 /// <param name="rightExpr">Right Hand Expression</param>
 public MultiplicationExpression(ISparqlExpression leftExpr, ISparqlExpression rightExpr)
     : base(leftExpr, rightExpr)
 {
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:9,代码来源:MultiplicationExpression.cs


示例19: TryCreateExpression

        /// <summary>
        /// Tries to create an XPath Function expression if the function Uri correseponds to a supported XPath Function
        /// </summary>
        /// <param name="u">Function Uri</param>
        /// <param name="args">Function Arguments</param>
        /// <param name="scalarArgs">Scalar Arguments</param>
        /// <param name="expr">Generated Expression</param>
        /// <returns>Whether an expression was successfully generated</returns>
        public bool TryCreateExpression(Uri u, List<ISparqlExpression> args, Dictionary<String,ISparqlExpression> scalarArgs, out ISparqlExpression expr)
        {
            //If any Scalar Arguments are present then can't possibly be an XPath Function
            if (scalarArgs.Count > 0)
            {
                expr = null;
                return false;
            }

            String func = u.ToString();
            if (func.StartsWith(XPathFunctionFactory.XPathFunctionsNamespace))
            {
                func = func.Substring(XPathFunctionFactory.XPathFunctionsNamespace.Length);
                ISparqlExpression xpathFunc = null;

                switch (func)
                {
                    case XPathFunctionFactory.Absolute:
                        if (args.Count == 1)
                        {
                            xpathFunc = new XPathAbsoluteFunction(args.First());
                        }
                        else
                        {
                            throw new RdfParseException("Incorrect number of arguments for the XPath abs() function");
                        }
                        break;
                    case XPathFunctionFactory.AdjustDateTimeToTimezone:
                        throw new NotSupportedException("XPath adjust-dateTime-to-timezone() function is not supported");
                    case XPathFunctionFactory.Boolean:
                        if (args.Count == 1)
                        {
                            xpathFunc = new XPathBooleanFunction(args.First());
                        }
                        else
                        {
                            throw new RdfParseException("Incorrect number of arguments for the XPath boolean() function");
                        }
                        throw new NotSupportedException("XPath boolean() function is not supported");
                    case XPathFunctionFactory.Ceiling:
                        if (args.Count == 1)
                        {
                            xpathFunc = new XPathCeilingFunction(args.First());
                        }
                        else
                        {
                            throw new RdfParseException("Incorrect number of arguments for the XPath ceiling() function");
                        }
                        break;
                    case XPathFunctionFactory.Compare:
                        if (args.Count == 2)
                        {
                            xpathFunc = new XPathCompareFunction(args.First(), args.Last());
                        }
                        else
                        {
                            throw new RdfParseException("Incorrect number of arguments for the XPath compare() function");
                        }
                        break;
                    case XPathFunctionFactory.Concat:
                        if (args.Count == 2)
                        {
                            xpathFunc = new XPathConcatFunction(args.First(), args.Last());
                        }
                        else if (args.Count > 2)
                        {
                            xpathFunc = new XPathConcatFunction(args);
                        }
                        else
                        {
                            throw new RdfParseException("Incorrect number of arguments for the XPath concat() function");
                        }
                        break;
                    case XPathFunctionFactory.Contains:
                        if (args.Count == 2)
                        {
                            xpathFunc = new XPathContainsFunction(args.First(), args.Last());
                        }
                        else
                        {
                            throw new RdfParseException("Incorrect number of arguments for the XPath contains() function");
                        }
                        break;
                    case XPathFunctionFactory.DayFromDateTime:
                        if (args.Count == 1)
                        {
                            xpathFunc = new XPathDayFromDateTimeFunction(args.First());
                        }
                        else
                        {
                            throw new RdfParseException("Incorrect number of arguments for the XPath day-from-dateTime() function");
                        }
//.........这里部分代码省略.........
开发者ID:almostEric,项目名称:DotNetRDF-4.0,代码行数:101,代码来源:XPathFunctionFactory.cs


示例20: SubstringAfterFunction

 /// <summary>
 /// Creates a new XPath Substring After function
 /// </summary>
 /// <param name="stringExpr">Expression</param>
 /// <param name="findExpr">Search Expression</param>
 public SubstringAfterFunction(ISparqlExpression stringExpr, ISparqlExpression findExpr)
     : base(stringExpr, findExpr, false, XPathFunctionFactory.AcceptStringArguments)
 {
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:9,代码来源:SubstringAfterFunction.cs



注:本文中的ISparqlExpression类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ISpatialReference类代码示例发布时间:2022-05-24
下一篇:
C# ISpanInterpolator类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap