use of com.inova8.intelligentgraph.model.Predicate in project com.inova8.intelligentgraph by peterjohnlawrence.
the class PathPatternSPARQLTests method test_11.
/**
* Test 11.
*/
@Test
@Order(11)
void test_11() {
try {
PathElement element = PathParser.parsePathPattern(repositoryContext, ":Location@:appearsOn[eq 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/Calc2Graph2>\r\n" + "BIND(<http://id/Calc2Graph2> as <http://id/Calc2Graph2>)\r\n" + "", element.toSPARQL());
} catch (Exception e) {
assertEquals("<http://default/Location>@<http://default/appearsOn>[eq <http://id/Calc2Graph2> ;]#", "");
}
}
use of com.inova8.intelligentgraph.model.Predicate 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());
}
Aggregations