Search in sources :

Example 36 with PathPatternException

use of com.inova8.pathql.processor.PathPatternException in project com.inova8.intelligentgraph by peterjohnlawrence.

the class PathPatternSPARQLTests method test_6.

/**
 * Test 6.
 *
 * @throws RecognitionException the recognition exception
 * @throws PathPatternException the path pattern exception
 */
@Test
@Order(6)
void test_6() throws RecognitionException, PathPatternException {
    PathElement element = PathParser.parsePathPattern(repositoryContext, ":Location@:appearsOn[ eq [ rdfs:label \"Calc2Graph1\"] ]#/^:lat/:long/^:left/:right");
    assertEquals("?r1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?n0\r\n" + "?r1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://default/appearsOn>\r\n" + "?r1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?n1\r\n" + "?n1 <http://rdfs/label> 'Calc2Graph1' .\r\n" + "?n2 <http://default/lat> ?r1 .\r\n" + "?n2 <http://default/long> ?n3 .\r\n" + "?n4 <http://default/left> ?n3 .\r\n" + "?n4 <http://default/right> ?n5 .\r\n" + "", element.toSPARQL());
}
Also used : PathElement(com.inova8.pathql.element.PathElement) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) Test(org.junit.jupiter.api.Test)

Example 37 with PathPatternException

use of com.inova8.pathql.processor.PathPatternException in project com.inova8.intelligentgraph by peterjohnlawrence.

the class PathPatternSPARQLTests method test_7.

/**
 * Test 7.
 *
 * @throws RecognitionException the recognition exception
 * @throws PathPatternException the path pattern exception
 */
@Test
@Order(7)
void test_7() throws RecognitionException, PathPatternException {
    PathElement element = PathParser.parsePathPattern(repositoryContext, ":volumeFlow [ gt \"35\" ; rdfs:label \"Calc2Graph1\" ; eq [ rdfs:label \"Calc2Graph2\"] , :Calc2Graph3 ,\"Calc2Graph4\" ]");
    assertEquals("?n0 <http://default/volumeFlow> <http://default/Calc2Graph3> .\r\n" + "FILTER(<http://default/Calc2Graph3> gt '35')\r\n" + "<http://default/Calc2Graph3> <http://rdfs/label> 'Calc2Graph1' .\r\n" + "<http://default/Calc2Graph3> <http://rdfs/label> 'Calc2Graph2' .\r\n" + "?n0 <http://default/volumeFlow> 'Calc2Graph4' .\r\n" + "FILTER('Calc2Graph4' gt '35')\r\n" + "'Calc2Graph4' <http://rdfs/label> 'Calc2Graph1' .\r\n" + "'Calc2Graph4' <http://rdfs/label> 'Calc2Graph2' .\r\n" + "", element.toSPARQL());
}
Also used : PathElement(com.inova8.pathql.element.PathElement) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) Test(org.junit.jupiter.api.Test)

Aggregations

PathElement (com.inova8.pathql.element.PathElement)25 Order (org.junit.jupiter.api.Order)17 Test (org.junit.jupiter.api.Test)17 TestMethodOrder (org.junit.jupiter.api.TestMethodOrder)17 Thing (com.inova8.intelligentgraph.model.Thing)15 Graph (com.inova8.intelligentgraph.intelligentGraphRepository.Graph)9 IntelligentGraphRepository (com.inova8.intelligentgraph.intelligentGraphRepository.IntelligentGraphRepository)6 PathBinding (com.inova8.intelligentgraph.path.PathBinding)5 PredicateElement (com.inova8.pathql.element.PredicateElement)4 PathPatternLexer (com.inova8.pathql.pathPattern.PathPatternLexer)3 PathPatternParser (com.inova8.pathql.pathPattern.PathPatternParser)3 PathPatternVisitor (com.inova8.pathql.processor.PathPatternVisitor)3 CharStream (org.antlr.v4.runtime.CharStream)3 CommonTokenStream (org.antlr.v4.runtime.CommonTokenStream)3 IRI (org.eclipse.rdf4j.model.IRI)3 ReificationType (com.inova8.pathql.context.ReificationType)2 PathPatternException (com.inova8.pathql.processor.PathPatternException)2 IriRefValueElement (com.inova8.pathql.element.IriRefValueElement)1 IriRefContext (com.inova8.pathql.pathPattern.PathPatternParser.IriRefContext)1 PathEltOrInverseContext (com.inova8.pathql.pathPattern.PathPatternParser.PathEltOrInverseContext)1