rdf4j-postgis  Version 0.1.0.0
CollectionAttributeFunction Class Referenceabstract
Inheritance diagram for CollectionAttributeFunction:
Collaboration diagram for CollectionAttributeFunction:

Public Member Functions

Value evaluate (ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException
 
abstract boolean attribute (Geometry geom)
 

Member Function Documentation

◆ attribute()

abstract boolean attribute ( Geometry  geom)
abstract

◆ evaluate()

Value evaluate ( ValueFactory  valueFactory,
Value...  args 
) throws ValueExprEvaluationException
17  {
18  if (args.length != 2) {
19  throw new ValueExprEvaluationException(getURI() + " requires exactly 2 arguments, got " + args.length);
20  }
21 
22  LiteralType l=LiteralRegistry.getLiteral(((Literal)args[0]).getDatatype().toString());
23  System.out.println(l);
24  if(l instanceof VectorLiteral) {
25  Geometry geom=((VectorLiteral)l).read(args[0].stringValue());
26  boolean result = attribute(geom);
27  return valueFactory.createLiteral(result);
28  }
29  throw new ValueExprEvaluationException("Argument given is not a geometry literal");
30 
31  }

References CollectionAttributeFunction.attribute(), and LiteralRegistry.getLiteral().