@@ -0,0 +1,1685 @@
+package org.semagrow.geospatial.algebra.strdf;%0A%0Aimport org.eclipse.rdf4j.model.Literal;%0Aimport org.eclipse.rdf4j.model.Value;%0Aimport org.eclipse.rdf4j.model.ValueFactory;%0Aimport org.eclipse.rdf4j.model.impl.SimpleValueFactory;%0Aimport org.eclipse.rdf4j.model.vocabulary.GEO;%0Aimport org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;%0Aimport org.eclipse.rdf4j.query.algebra.evaluation.function.Function;%0Aimport org.locationtech.spatial4j.shape.Shape;%0Aimport org.semagrow.geospatial.commons.IllegalGeometryException;%0Aimport org.semagrow.geospatial.commons.SimpleShapeFactory;%0Aimport org.semagrow.geospatial.vocabulary.STRDF;%0A%0Apublic class StIsEmpty implements Function %7B%0A    @Override%0A    public String getURI() %7B%0A        return STRDF.isEmpty.toString();%0A    %7D%0A%0A    @Override%0A    public Value evaluate(ValueFactory valueFactory, Value... values) throws ValueExprEvaluationException %7B%0A        if (values.length != 1) %7B%0A            throw new ValueExprEvaluationException(%22Wrong number of arguments%22);%0A        %7D%0A        if (!(values%5B0%5D instanceof Literal && ((Literal) values%5B0%5D).getDatatype().equals(GEO.WKT_LITERAL))) %7B%0A            throw new ValueExprEvaluationException(%22Illegal argument format%22);%0A        %7D%0A%0A        String wktString = values%5B0%5D.stringValue();%0A        Shape shape = null;%0A        try %7B%0A            shape = SimpleShapeFactory.getInstance().createShape(wktString);%0A        %7D catch (IllegalGeometryException e) %7B%0A            throw new ValueExprEvaluationException(%22Illegal WKT format%22, e);%0A        %7D%0A        boolean isEmpty = shape.isEmpty();%0A        Value value = SimpleValueFactory.getInstance().createLiteral(isEmpty);%0A        return  value;%0A    %7D%0A%7D%0A

geospatial.algebra.strdf isEmpty