Class FunctionArguments
- java.lang.Object
-
- org.eclipse.rdf4j.query.algebra.evaluation.function.geosparql.FunctionArguments
-
class FunctionArguments extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description private
FunctionArguments()
Empty constructor
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
convertFromDegrees(double degs, IRI units)
Convert degrees to another unitstatic double
convertToDegrees(double v, IRI units)
Convert a value to degreesstatic double
getDouble(Function func, Value v)
Get the double valuestatic Literal
getLiteral(Function func, Value v, IRI expectedDatatype)
Get the literal of a specific data typestatic org.locationtech.spatial4j.shape.Point
getPoint(Function func, Value v, org.locationtech.spatial4j.context.SpatialContext geoContext)
Get the geo pointstatic org.locationtech.spatial4j.shape.Shape
getShape(Function func, Value v, org.locationtech.spatial4j.context.SpatialContext context)
Get the geo shapestatic java.lang.String
getString(Function func, Value v)
Get the string valuestatic IRI
getUnits(Function func, Value v)
Get the UoM IRI of the unit
-
-
-
Method Detail
-
getDouble
public static double getDouble(Function func, Value v) throws ValueExprEvaluationException
Get the double value- Parameters:
func
- functionv
- value- Returns:
- double
- Throws:
ValueExprEvaluationException
-
getString
public static java.lang.String getString(Function func, Value v) throws ValueExprEvaluationException
Get the string value- Parameters:
func
- functionv
- value- Returns:
- string
- Throws:
ValueExprEvaluationException
-
getShape
public static org.locationtech.spatial4j.shape.Shape getShape(Function func, Value v, org.locationtech.spatial4j.context.SpatialContext context) throws ValueExprEvaluationException
Get the geo shape- Parameters:
func
- functionv
- valuecontext
-- Returns:
- shape
- Throws:
ValueExprEvaluationException
-
getPoint
public static org.locationtech.spatial4j.shape.Point getPoint(Function func, Value v, org.locationtech.spatial4j.context.SpatialContext geoContext) throws ValueExprEvaluationException
Get the geo point- Parameters:
func
- functionv
- valuegeoContext
-- Returns:
- point
- Throws:
ValueExprEvaluationException
-
getLiteral
public static Literal getLiteral(Function func, Value v, IRI expectedDatatype) throws ValueExprEvaluationException
Get the literal of a specific data type- Parameters:
func
- functionv
- valueexpectedDatatype
-- Returns:
- literal
- Throws:
ValueExprEvaluationException
-
getUnits
public static IRI getUnits(Function func, Value v) throws ValueExprEvaluationException
Get the UoM IRI of the unit- Parameters:
func
- functionv
- value- Returns:
- UoM IRI
- Throws:
ValueExprEvaluationException
-
convertFromDegrees
public static double convertFromDegrees(double degs, IRI units) throws ValueExprEvaluationException
Convert degrees to another unit- Parameters:
degs
- degreesunits
- UoM IRI of the unit to convert to- Returns:
- converted value as a double
- Throws:
ValueExprEvaluationException
-
convertToDegrees
public static double convertToDegrees(double v, IRI units) throws ValueExprEvaluationException
Convert a value to degrees- Parameters:
v
- valueunits
- UoM IRI of the unit- Returns:
- degrees as a double
- Throws:
ValueExprEvaluationException
-
-