com.hp.hpl.jena.sparql.expr.nodevalue
Class XSDFuncOp

java.lang.Object
  extended by com.hp.hpl.jena.sparql.expr.nodevalue.XSDFuncOp

public class XSDFuncOp
extends Object

Implementation of XQuery/XPath functions and operators. http://www.w3.org/TR/xpath-functions/


Field Summary
static String defaultTimezone
           
static boolean strictDateTimeFO
          Under strict F&O, dateTimes and dates with no timezone have one magically applied.
 
Method Summary
static NodeValue abs(NodeValue nv)
           
static NodeValue add(NodeValue nv1, NodeValue nv2)
           
static boolean booleanEffectiveValue(NodeValue nv)
           
static NodeValue booleanEffectiveValueAsNodeValue(NodeValue nv)
           
static NodeValue ceiling(NodeValue v)
           
static com.hp.hpl.jena.sparql.expr.nodevalue.NumericType classifyNumeric(String fName, NodeValue nv)
           
static com.hp.hpl.jena.sparql.expr.nodevalue.NumericType classifyNumeric(String fName, NodeValue nv1, NodeValue nv2)
           
static int compareBoolean(NodeValue nv1, NodeValue nv2)
           
static int compareDateTime(NodeValue nv1, NodeValue nv2)
           
static int compareDuration(NodeValue nv1, NodeValue nv2)
           
static int compareGDay(NodeValue nv1, NodeValue nv2)
           
static int compareGMonth(NodeValue nv1, NodeValue nv2)
           
static int compareGMonthDay(NodeValue nv1, NodeValue nv2)
           
static int compareGYear(NodeValue nv1, NodeValue nv2)
           
static int compareGYearMonth(NodeValue nv1, NodeValue nv2)
           
static int compareNumeric(NodeValue nv1, NodeValue nv2)
           
static int compareString(NodeValue nv1, NodeValue nv2)
           
static NodeValue dateTimeCast(NodeValue nv, com.hp.hpl.jena.datatypes.RDFDatatype rdfDatatype)
          Cast a NodeValue to a date/time type (xsd dateTime, date, time, g*) according to F&O 17.1.5 Casting to date and time types Throws an exception on incorrect case.
static NodeValue dateTimeCast(NodeValue nv, String typeURI)
          Cast a NodeValue to a date/time type (xsd dateTime, date, time, g*) according to F&O 17.1.5 Casting to date and time types Throws an exception on incorrect case.
static NodeValue dateTimeCast(NodeValue nv, com.hp.hpl.jena.datatypes.xsd.XSDDatatype xsd)
          Cast a NodeValue to a date/time type (xsd dateTime, date, time, g*) according to F&O 17.1.5 Casting to date and time types Throws an exception on incorrect case.
static boolean dateTimeCastCompatible(NodeValue nv, com.hp.hpl.jena.datatypes.xsd.XSDDatatype xsd)
           
static NodeValue divide(NodeValue nv1, NodeValue nv2)
           
static NodeValue dtGetDay(NodeValue nv)
           
static NodeValue dtGetHours(NodeValue nv)
           
static NodeValue dtGetMinutes(NodeValue nv)
           
static NodeValue dtGetMonth(NodeValue nv)
           
static NodeValue dtGetSeconds(NodeValue nv)
           
static NodeValue dtGetTimezone(NodeValue nv)
           
static NodeValue dtGetTZ(NodeValue nv)
           
static NodeValue dtGetYear(NodeValue nv)
           
static NodeValue floor(NodeValue v)
           
static NodeValue fnConcat(List<NodeValue> args)
           
static boolean isDecimalType(com.hp.hpl.jena.datatypes.xsd.XSDDatatype xsdDatatype)
           
static boolean isIntegerType(com.hp.hpl.jena.datatypes.xsd.XSDDatatype xsdDatatype)
           
static boolean isNumericType(com.hp.hpl.jena.datatypes.xsd.XSDDatatype xsdDatatype)
           
static NodeValue javaSubstring(NodeValue v1, NodeValue v2)
           
static NodeValue javaSubstring(NodeValue nvString, NodeValue nvStart, NodeValue nvFinish)
           
static NodeValue max(NodeValue nv1, NodeValue nv2)
           
static NodeValue min(NodeValue nv1, NodeValue nv2)
           
static NodeValue multiply(NodeValue nv1, NodeValue nv2)
           
static NodeValue not(NodeValue nv)
           
static NodeValue round(NodeValue v)
           
static NodeValue sqrt(NodeValue v)
           
static NodeValue strAfter(NodeValue string, NodeValue match)
           
static NodeValue strBefore(NodeValue string, NodeValue match)
           
static NodeValue strConcat(List<NodeValue> args)
           
static NodeValue strContains(NodeValue string, NodeValue match)
           
static NodeValue strEndsWith(NodeValue string, NodeValue match)
           
static NodeValue strlen(NodeValue nvString)
           
static NodeValue strLowerCase(NodeValue string)
           
static NodeValue strReplace(NodeValue nvStr, NodeValue nvPattern, NodeValue nvReplacement)
           
static NodeValue strReplace(NodeValue nvStr, NodeValue nvPattern, NodeValue nvReplacement, NodeValue nvFlags)
           
static NodeValue strReplace(NodeValue nvStr, Pattern pattern, NodeValue nvReplacement)
           
static NodeValue strStartsWith(NodeValue string, NodeValue match)
           
static NodeValue strUpperCase(NodeValue string)
           
static NodeValue substring(NodeValue v1, NodeValue v2)
           
static NodeValue substring(NodeValue nvString, NodeValue nvStart, NodeValue nvLength)
           
static NodeValue subtract(NodeValue nv1, NodeValue nv2)
           
static NodeValue unaryMinus(NodeValue nv)
           
static NodeValue unaryPlus(NodeValue nv)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

strictDateTimeFO

public static boolean strictDateTimeFO
Under strict F&O, dateTimes and dates with no timezone have one magically applied. This default tiemzoine is implementation dependent and can lead to different answers to queries depending on the timezone. Normally, ARQ uses XMLSchema dateTime comparions, which an yield "indeterminate", which in turn is an evaluation error. F&O insists on true/false so can lead to false positves and negatives.


defaultTimezone

public static final String defaultTimezone
See Also:
Constant Field Values
Method Detail

add

public static NodeValue add(NodeValue nv1,
                            NodeValue nv2)

subtract

public static NodeValue subtract(NodeValue nv1,
                                 NodeValue nv2)

multiply

public static NodeValue multiply(NodeValue nv1,
                                 NodeValue nv2)

divide

public static NodeValue divide(NodeValue nv1,
                               NodeValue nv2)

max

public static NodeValue max(NodeValue nv1,
                            NodeValue nv2)

min

public static NodeValue min(NodeValue nv1,
                            NodeValue nv2)

not

public static NodeValue not(NodeValue nv)

booleanEffectiveValueAsNodeValue

public static NodeValue booleanEffectiveValueAsNodeValue(NodeValue nv)

booleanEffectiveValue

public static boolean booleanEffectiveValue(NodeValue nv)

unaryMinus

public static NodeValue unaryMinus(NodeValue nv)

unaryPlus

public static NodeValue unaryPlus(NodeValue nv)

abs

public static NodeValue abs(NodeValue nv)

ceiling

public static NodeValue ceiling(NodeValue v)

floor

public static NodeValue floor(NodeValue v)

round

public static NodeValue round(NodeValue v)

sqrt

public static NodeValue sqrt(NodeValue v)

javaSubstring

public static NodeValue javaSubstring(NodeValue v1,
                                      NodeValue v2)

javaSubstring

public static NodeValue javaSubstring(NodeValue nvString,
                                      NodeValue nvStart,
                                      NodeValue nvFinish)

strlen

public static NodeValue strlen(NodeValue nvString)

strReplace

public static NodeValue strReplace(NodeValue nvStr,
                                   NodeValue nvPattern,
                                   NodeValue nvReplacement,
                                   NodeValue nvFlags)

strReplace

public static NodeValue strReplace(NodeValue nvStr,
                                   Pattern pattern,
                                   NodeValue nvReplacement)

strReplace

public static NodeValue strReplace(NodeValue nvStr,
                                   NodeValue nvPattern,
                                   NodeValue nvReplacement)

substring

public static NodeValue substring(NodeValue v1,
                                  NodeValue v2)

substring

public static NodeValue substring(NodeValue nvString,
                                  NodeValue nvStart,
                                  NodeValue nvLength)

strContains

public static NodeValue strContains(NodeValue string,
                                    NodeValue match)

strStartsWith

public static NodeValue strStartsWith(NodeValue string,
                                      NodeValue match)

strEndsWith

public static NodeValue strEndsWith(NodeValue string,
                                    NodeValue match)

strBefore

public static NodeValue strBefore(NodeValue string,
                                  NodeValue match)

strAfter

public static NodeValue strAfter(NodeValue string,
                                 NodeValue match)

strLowerCase

public static NodeValue strLowerCase(NodeValue string)

strUpperCase

public static NodeValue strUpperCase(NodeValue string)

fnConcat

public static NodeValue fnConcat(List<NodeValue> args)

strConcat

public static NodeValue strConcat(List<NodeValue> args)

classifyNumeric

public static com.hp.hpl.jena.sparql.expr.nodevalue.NumericType classifyNumeric(String fName,
                                                                                NodeValue nv1,
                                                                                NodeValue nv2)

classifyNumeric

public static com.hp.hpl.jena.sparql.expr.nodevalue.NumericType classifyNumeric(String fName,
                                                                                NodeValue nv)

isNumericType

public static boolean isNumericType(com.hp.hpl.jena.datatypes.xsd.XSDDatatype xsdDatatype)

isDecimalType

public static boolean isDecimalType(com.hp.hpl.jena.datatypes.xsd.XSDDatatype xsdDatatype)

isIntegerType

public static boolean isIntegerType(com.hp.hpl.jena.datatypes.xsd.XSDDatatype xsdDatatype)

compareNumeric

public static int compareNumeric(NodeValue nv1,
                                 NodeValue nv2)

compareString

public static int compareString(NodeValue nv1,
                                NodeValue nv2)

compareDateTime

public static int compareDateTime(NodeValue nv1,
                                  NodeValue nv2)

compareDuration

public static int compareDuration(NodeValue nv1,
                                  NodeValue nv2)

compareGYear

public static int compareGYear(NodeValue nv1,
                               NodeValue nv2)

compareGYearMonth

public static int compareGYearMonth(NodeValue nv1,
                                    NodeValue nv2)

compareGMonth

public static int compareGMonth(NodeValue nv1,
                                NodeValue nv2)

compareGMonthDay

public static int compareGMonthDay(NodeValue nv1,
                                   NodeValue nv2)

compareGDay

public static int compareGDay(NodeValue nv1,
                              NodeValue nv2)

compareBoolean

public static int compareBoolean(NodeValue nv1,
                                 NodeValue nv2)

dateTimeCastCompatible

public static boolean dateTimeCastCompatible(NodeValue nv,
                                             com.hp.hpl.jena.datatypes.xsd.XSDDatatype xsd)

dateTimeCast

public static NodeValue dateTimeCast(NodeValue nv,
                                     String typeURI)
Cast a NodeValue to a date/time type (xsd dateTime, date, time, g*) according to F&O 17.1.5 Casting to date and time types Throws an exception on incorrect case.

Throws:
ExprEvalTypeException

dateTimeCast

public static NodeValue dateTimeCast(NodeValue nv,
                                     com.hp.hpl.jena.datatypes.RDFDatatype rdfDatatype)
Cast a NodeValue to a date/time type (xsd dateTime, date, time, g*) according to F&O 17.1.5 Casting to date and time types Throws an exception on incorrect case.

Throws:
ExprEvalTypeException

dateTimeCast

public static NodeValue dateTimeCast(NodeValue nv,
                                     com.hp.hpl.jena.datatypes.xsd.XSDDatatype xsd)
Cast a NodeValue to a date/time type (xsd dateTime, date, time, g*) according to F&O 17.1.5 Casting to date and time types Throws an exception on incorrect case.

Throws:
ExprEvalTypeException

dtGetYear

public static NodeValue dtGetYear(NodeValue nv)

dtGetMonth

public static NodeValue dtGetMonth(NodeValue nv)

dtGetDay

public static NodeValue dtGetDay(NodeValue nv)

dtGetHours

public static NodeValue dtGetHours(NodeValue nv)

dtGetMinutes

public static NodeValue dtGetMinutes(NodeValue nv)

dtGetSeconds

public static NodeValue dtGetSeconds(NodeValue nv)

dtGetTZ

public static NodeValue dtGetTZ(NodeValue nv)

dtGetTimezone

public static NodeValue dtGetTimezone(NodeValue nv)


Licenced under the Apache License, Version 2.0