Search in sources :

Example 71 with NodeValue

use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.

the class SpatialDimensionPFTest method testApplyPredicate_2_Dimension.

/**
 * Test of applyPredicate method, of class SpatialDimensionPF.
 */
@Test
public void testApplyPredicate_2_Dimension() {
    GeometryWrapper geometryWrapper = GeometryWrapper.extract("<http://www.opengis.net/def/crs/EPSG/0/27700> POINT(90 60)", WKTDatatype.URI);
    SpatialDimensionPF instance = new SpatialDimensionPF();
    NodeValue expResult = NodeValue.makeNodeInteger(2);
    NodeValue result = instance.applyPredicate(geometryWrapper);
    assertEquals(expResult, result);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) Test(org.junit.Test)

Example 72 with NodeValue

use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.

the class SpatialDimensionPFTest method testApplyPredicate_3_Dimension.

/**
 * Test of applyPredicate method, of class SpatialDimensionPF.
 */
@Test
public void testApplyPredicate_3_Dimension() {
    GeometryWrapper geometryWrapper = GeometryWrapper.extract("<http://www.opengis.net/def/crs/EPSG/0/27700> POINT Z (90 60 30)", WKTDatatype.URI);
    SpatialDimensionPF instance = new SpatialDimensionPF();
    NodeValue expResult = NodeValue.makeNodeInteger(3);
    NodeValue result = instance.applyPredicate(geometryWrapper);
    assertEquals(expResult, result);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) Test(org.junit.Test)

Example 73 with NodeValue

use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.

the class SpatialDimensionPFTest method testApplyPredicate_3M_Dimension.

/**
 * Test of applyPredicate method, of class SpatialDimensionPF.
 */
@Test
public void testApplyPredicate_3M_Dimension() {
    GeometryWrapper geometryWrapper = GeometryWrapper.extract("<http://www.opengis.net/def/crs/EPSG/0/27700> POINT ZM (90 60 30 10)", WKTDatatype.URI);
    SpatialDimensionPF instance = new SpatialDimensionPF();
    NodeValue expResult = NodeValue.makeNodeInteger(3);
    NodeValue result = instance.applyPredicate(geometryWrapper);
    assertEquals(expResult, result);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) Test(org.junit.Test)

Example 74 with NodeValue

use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.

the class SpatialDimensionPFTest method testApplyPredicate_2M_Dimension.

/**
 * Test of applyPredicate method, of class SpatialDimensionPF.
 */
@Test
public void testApplyPredicate_2M_Dimension() {
    GeometryWrapper geometryWrapper = GeometryWrapper.extract("<http://www.opengis.net/def/crs/EPSG/0/27700> POINT M (90 60 30)", WKTDatatype.URI);
    SpatialDimensionPF instance = new SpatialDimensionPF();
    NodeValue expResult = NodeValue.makeNodeInteger(2);
    NodeValue result = instance.applyPredicate(geometryWrapper);
    assertEquals(expResult, result);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) Test(org.junit.Test)

Example 75 with NodeValue

use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.

the class IsValidPFTest method testApplyPredicate_false.

/**
 * Test of applyPredicate method, of class IsValidPF.
 */
@Test
public void testApplyPredicate_false() {
    GeometryWrapper geometryWrapper = GeometryWrapper.extract("<http://www.opengis.net/def/crs/EPSG/0/27700> LINESTRING(0 0, 0 0, 0 0)", WKTDatatype.URI);
    IsValidPF instance = new IsValidPF();
    NodeValue expResult = NodeValue.makeNodeBoolean(false);
    NodeValue result = instance.applyPredicate(geometryWrapper);
    assertEquals(expResult, result);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) Test(org.junit.Test)

Aggregations

NodeValue (org.apache.jena.sparql.expr.NodeValue)255 Test (org.junit.Test)197 BaseTest (org.apache.jena.atlas.junit.BaseTest)42 Node (org.apache.jena.graph.Node)31 ExprEvalException (org.apache.jena.sparql.expr.ExprEvalException)26 GeometryWrapper (org.apache.jena.geosparql.implementation.GeometryWrapper)24 Expr (org.apache.jena.sparql.expr.Expr)12 NodeValueNode (org.apache.jena.sparql.expr.nodevalue.NodeValueNode)10 ARQInternalErrorException (org.apache.jena.sparql.ARQInternalErrorException)7 DatatypeFormatException (org.apache.jena.datatypes.DatatypeFormatException)6 ArrayList (java.util.ArrayList)5 SearchEnvelope (org.apache.jena.geosparql.spatial.SearchEnvelope)5 LibTestExpr (org.apache.jena.sparql.expr.LibTestExpr)5 Duration (javax.xml.datatype.Duration)4 SpatialArguments (org.apache.jena.geosparql.spatial.property_functions.SpatialArguments)4 BigDecimal (java.math.BigDecimal)3 AssemblerException (org.apache.jena.assembler.exceptions.AssemblerException)3 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)3 Var (org.apache.jena.sparql.core.Var)3 ValueSpaceClassification (org.apache.jena.sparql.expr.ValueSpaceClassification)3