Beispiel #1
0
        //internal static SparqlExpression EqualsExpression(SparqlExpression l, SparqlExpression r)
        //{
        //  return new SparqlEqualsExpression(l, r, TODO);
        //}

        //public static SparqlExpression NotEquals(SparqlExpression l, SparqlExpression r)
        //{
        // return new SparqlNotEqualsExpression(l, r);
        //}



        public static SparqlExpression Smaller(SparqlExpression l, SparqlExpression r)
        {
            var sparqlBinaryExpression = new SparqlBinaryExpression <OV_bool>(l, r, (o, o1) => o < o1, b => new OV_bool(b));//((IComparable) o).CompareTo((IComparable)o1) == -1

            //   sparqlBinaryExpression.SetExprType(ObjectVariantEnum.Bool);
            return(sparqlBinaryExpression);
        }
Beispiel #2
0
        public static SparqlExpression GreatherOrEquals(SparqlExpression l, SparqlExpression r)
        {
            var sparqlBinaryExpression = new SparqlBinaryExpression <OV_bool>(l, r, (o, o1) => o >= o1, b => new OV_bool(b));//((IComparable)o).CompareTo(o1) != -1

            //   sparqlBinaryExpression.SetExprType(ObjectVariantEnum.Bool);
            return(sparqlBinaryExpression);
        }
Beispiel #3
0
        public static SparqlExpression operator -(SparqlExpression l, SparqlExpression r)
        {
            // l.SetExprType(ExpressionTypeEnum.numeric);
            var sparqlBinaryExpression = new SparqlBinaryExpression(l, r, (o, o1) => o - o1, "mines");

            sparqlBinaryExpression.Create();
            return(sparqlBinaryExpression);
        }
Beispiel #4
0
        internal static SparqlExpression SmallerOrEquals(SparqlExpression l, SparqlExpression r)
        {
            var sparqlBinaryExpression = new SparqlBinaryExpression <OV_bool>(
                l,
                r,
                (o, o1) => o <= o1,
                b => new OV_bool(b),
                "smallerEqual"); // ((IComparable)o).CompareTo(o1) != 1

            // sparqlBinaryExpression.SetExprType(ObjectVariantEnum.Bool);
            return(sparqlBinaryExpression);
        }
Beispiel #5
0
        public static SparqlExpression Greather(SparqlExpression l, SparqlExpression r)
        {
            //Func<object, object, object> @operator;
            //if (l.RealType == ObjectVariantEnum.Int || r.RealType == ObjectVariantEnum.Int)
            //    @operator = (o, o1) => (int)o > (int)o1;
            //else
            //    if (l.RealType == ObjectVariantEnum.Date|| r.RealType == ObjectVariantEnum.Date)
            //    @operator = (o, o1) => (DateTimeOffset)o > (DateTimeOffset)o1;
            //else                                                          throw new NotImplementedException();
            var sparqlBinaryExpression = new SparqlBinaryExpression <OV_bool>(l, r, (o, o1) => o > o1, b => new OV_bool(b));// ((IComparable)o).CompareTo(o1) == 1

            //     sparqlBinaryExpression.SetExprType(ObjectVariantEnum.Bool);
            return(sparqlBinaryExpression);
        }