internal override string ToString(List <RDFNamespace> prefixes)
        {
            string leftValue  = RDFQueryPrinter.PrintPatternMember(this.LeftMember, prefixes);
            string rightValue = RDFQueryPrinter.PrintPatternMember(this.RightMember, prefixes);

            switch (this.ComparisonFlavor)
            {
            case RDFQueryEnums.RDFComparisonFlavors.LessThan:
                return(string.Concat("FILTER ( ", leftValue, " < ", rightValue, " )"));

            case RDFQueryEnums.RDFComparisonFlavors.LessOrEqualThan:
                return(string.Concat("FILTER ( ", leftValue, " <= ", rightValue, " )"));

            case RDFQueryEnums.RDFComparisonFlavors.EqualTo:
                return(string.Concat("FILTER ( ", leftValue, " = ", rightValue, " )"));

            case RDFQueryEnums.RDFComparisonFlavors.NotEqualTo:
                return(string.Concat("FILTER ( ", leftValue, " != ", rightValue, " )"));

            case RDFQueryEnums.RDFComparisonFlavors.GreaterOrEqualThan:
                return(string.Concat("FILTER ( ", leftValue, " >= ", rightValue, " )"));

            case RDFQueryEnums.RDFComparisonFlavors.GreaterThan:
                return(string.Concat("FILTER ( ", leftValue, " > ", rightValue, " )"));

            default:
                throw new RDFQueryException("Cannot get string representation of unknown '" + this.ComparisonFlavor + "' RDFComparisonFilter.");
            }
        }
Exemple #2
0
 internal override string ToString(List <RDFNamespace> prefixes)
 => string.Concat(
     "FILTER ( ",
     RDFQueryPrinter.PrintPatternMember(this.TermToSearch, prefixes),
     " IN (",
     string.Join(", ", this.InTerms.Select(t => RDFQueryPrinter.PrintPatternMember(t, prefixes))),
     ") )");
 internal override String ToString(List <RDFNamespace> prefixes)
 {
     return("FILTER ( SAMETERM(" + this.Variable + ", " + RDFQueryPrinter.PrintPatternMember(this.RDFTerm, prefixes) + ") )");
 }
Exemple #4
0
 internal override String ToString(List <RDFNamespace> prefixes)
 {
     return("FILTER ( DATATYPE(" + this.Variable + ") = " + RDFQueryPrinter.PrintPatternMember(RDFQueryUtilities.ParseRDFPatternMember(RDFModelUtilities.GetDatatypeFromEnum(this.Datatype)), prefixes) + " )");
 }
 internal override string ToString(List <RDFNamespace> prefixes)
 => string.Concat("FILTER ( SAMETERM(", this.Variable, ", ", RDFQueryPrinter.PrintPatternMember(this.RDFTerm, prefixes), ") )");
Exemple #6
0
 internal override String ToString(List <RDFNamespace> prefixes)
 {
     return($"FILTER ( {RDFQueryPrinter.PrintPatternMember(this.TermToSearch, prefixes)} IN ({String.Join(", ", this.InTerms.Select(t => RDFQueryPrinter.PrintPatternMember(t, prefixes)))}) )");
 }
 internal override string ToString(List <RDFNamespace> prefixes)
 => string.Concat(
     "FILTER ( DATATYPE(", this.Variable, ") = ",
     RDFQueryPrinter.PrintPatternMember(RDFQueryUtilities.ParseRDFPatternMember(RDFModelUtilities.GetDatatypeFromEnum(this.Datatype)), prefixes), " )");