use of com.inova8.pathql.context.RepositoryContext in project com.inova8.intelligentgraph by peterjohnlawrence.
the class PathPatternSPARQLTests method test_13.
// @Test
// @Order(12)
// void test_12() {
// try {
//
// PathProcessor2 pathProcessor = new PathProcessor2();
// PathElement element = PathProcessor2.parsePathPattern(repositoryContext, ":Location@:appearsOn][eq id:Calc2Graph2]#");
// }catch(Exception e){
// assertEquals ("[line 1:20 in \":Location@:appearsOn][eq id:Calc2Graph2]#\": mismatched input ']' expecting {<EOF>, '|', '/', '{', '[', '#'}]"
// ,e.getMessage() );
// }
/**
* Test 13.
*/
// }
@Test
@Order(13)
void test_13() {
try {
PathElement element = PathParser.parsePathPattern(repositoryContext, ":Location@:appearsOn[eq id:Calc2Graph1, id:Calc2Graph2]#");
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> <http://id/Calc2Graph1>\r\n" + "BIND(<http://id/Calc2Graph1> as <http://id/Calc2Graph1>)\r\n" + "?r1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://id/Calc2Graph2>\r\n" + "BIND(<http://id/Calc2Graph1> as <http://id/Calc2Graph2>)\r\n" + "", element.toSPARQL());
} catch (Exception e) {
assertEquals("", e.getMessage());
}
}
use of com.inova8.pathql.context.RepositoryContext in project com.inova8.intelligentgraph by peterjohnlawrence.
the class PathPatternSPARQLTests method test_34.
/**
* Test 34.
*/
@Test
@Order(34)
void test_34() {
try {
PathElement element = PathParser.parsePathPattern(repositoryContext, ":hasProductBatteryLimit");
assertEquals("?n0 <http://default/hasProductBatteryLimit> ?n1 .\r\n" + "", element.toSPARQL());
} catch (Exception e) {
assertEquals("", e.getMessage());
}
}
use of com.inova8.pathql.context.RepositoryContext in project com.inova8.intelligentgraph by peterjohnlawrence.
the class PathPatternSPARQLTests method test_23.
/**
* Test 23.
*/
@Test
@Order(23)
void test_23() {
try {
PathElement element = PathParser.parsePathPattern(repositoryContext, "^:hasProductBatteryLimit/(:massFlow |:volumeFlow)");
assertEquals("?n1 <http://default/hasProductBatteryLimit> ?n0 .\r\n" + "{{?n1 <http://default/massFlow> ?n2 .\r\n" + "}UNION{\r\n" + "?n1 <http://default/volumeFlow> ?n2 .\r\n" + "}}", element.toSPARQL());
} catch (Exception e) {
assertEquals("", e.getMessage());
}
}
use of com.inova8.pathql.context.RepositoryContext in project com.inova8.intelligentgraph by peterjohnlawrence.
the class PathPatternSPARQLTests method test_20.
/**
* Test 20.
*/
@Test
@Order(20)
void test_20() {
try {
PathElement element = PathParser.parsePathPattern(repositoryContext, "(^:hasProductBatteryLimit/*){1, 2}/:massThroughput");
assertEquals("#{1\r\n" + "?n1 <http://default/hasProductBatteryLimit> ?n0 .\r\n" + "?n1 ?p1_2 ?n2 .\r\n" + "#,2}\r\n" + "?n2 <http://default/massThroughput> ?n3 .\r\n" + "", element.toSPARQL());
} catch (Exception e) {
assertEquals("", e.getMessage());
}
}
use of com.inova8.pathql.context.RepositoryContext in project com.inova8.intelligentgraph by peterjohnlawrence.
the class PathPatternSPARQLTests method test_17.
/**
* Test 17.
*/
@Test
@Order(17)
void test_17() {
try {
PathElement element = PathParser.parsePathPattern(repositoryContext, "(^:hasProductBatteryLimit/:massThroughput){1, 2}/:massThroughput");
assertEquals("#{1\r\n" + "?n1 <http://default/hasProductBatteryLimit> ?n0 .\r\n" + "?n1 <http://default/massThroughput> ?n2 .\r\n" + "#,2}\r\n" + "?n2 <http://default/massThroughput> ?n3 .\r\n" + "", element.toSPARQL());
} catch (Exception e) {
assertEquals("", e.getMessage());
}
}
Aggregations