use of com.inova8.intelligentgraph.model.Predicate in project com.inova8.intelligentgraph by peterjohnlawrence.
the class PathPatternQueryExpressionTests method test_28.
/**
* Test 28.
*/
@Test
@Order(28)
void test_28() {
try {
PathElement element = PathParser.parsePathPattern(repositoryContext, "(:Attribute@:density |:density)");
// Query.assertEqualsWOSpaces
assertEquals("Union\r\n" + " Join\r\n" + " Join\r\n" + " Union\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=subject1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#subject)\r\n" + " Variable (name=n0)\r\n" + " StatementPattern\r\n" + " Variable (name=n0)\r\n" + " Variable (name=isSubjectOf1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#subject)\r\n" + " Variable (name=r1)\r\n" + " Union\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=property1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate)\r\n" + " Variable (name=p_n0_n1_alt_L, value=http://default/density)\r\n" + " StatementPattern\r\n" + " Variable (name=p_n0_n1_alt_L, value=http://default/density)\r\n" + " Variable (name=isPropertyOf1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate)\r\n" + " Variable (name=r1)\r\n" + " Union\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=object1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#object)\r\n" + " Variable (name=n1)\r\n" + " StatementPattern\r\n" + " Variable (name=n1)\r\n" + " Variable (name=isObjectOf1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#object)\r\n" + " Variable (name=r1)\r\n" + " StatementPattern\r\n" + " Variable (name=n0)\r\n" + " Variable (name=p_n0_n1_alt_LR, value=http://default/density)\r\n" + " Variable (name=n1)\r\n" + "", element.pathPatternQuery().toString());
} catch (Exception e) {
assertEquals("", e.getMessage());
}
}
use of com.inova8.intelligentgraph.model.Predicate in project com.inova8.intelligentgraph by peterjohnlawrence.
the class PathPatternQueryExpressionTests method test_12.
/**
* Test 12.
*/
@Test
@Order(12)
void test_12() {
try {
PathElement element = PathParser.parsePathPattern(repositoryContext, ":Location@:appearsOn[eq id:Calc2Graph1]#");
assertEquals("Join\r\n" + " Join\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=subject1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#subject)\r\n" + " Variable (name=n0)\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=property1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate)\r\n" + " Variable (name=p_n0_n1, value=http://default/appearsOn)\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=object1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#object)\r\n" + " Variable (name=n1, value=http://id/Calc2Graph1)\r\n" + "", element.pathPatternQuery().toString());
} catch (Exception e) {
assertEquals("", e.getMessage());
}
}
use of com.inova8.intelligentgraph.model.Predicate in project com.inova8.intelligentgraph by peterjohnlawrence.
the class PathPatternQueryExpressionTests method test_5.
/**
* Test 5.
*/
@Test
@Order(5)
void test_5() {
CharStream input = CharStreams.fromString(":Location@:appearsOn[ rdfs:label \"eastman3d\" ]#/:lat");
PathElement element = prepareElement(input);
// Query.assertEqualsWOSpaces
assertEquals("Join\r\n" + " Join\r\n" + " Join\r\n" + " Join\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=subject1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#subject)\r\n" + " Variable (name=n0)\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=property1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate)\r\n" + " Variable (name=p_n0_n1, value=http://default/appearsOn)\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=object1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#object)\r\n" + " Variable (name=n1)\r\n" + " StatementPattern\r\n" + " Variable (name=n1)\r\n" + " Variable (name=p_n1_n1_1, value=http://rdfs/label)\r\n" + " Variable (name=n1_1, value=\"eastman3d\")\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=p_r1_n2, value=http://default/lat)\r\n" + " Variable (name=n2)\r\n" + "", element.pathPatternQuery().toString());
}
use of com.inova8.intelligentgraph.model.Predicate in project com.inova8.intelligentgraph by peterjohnlawrence.
the class PathPatternQueryExpressionTests method test_10.
/**
* Test 10.
*/
@Test
@Order(10)
void test_10() {
CharStream input = CharStreams.fromString(":Location@:appearsOn[eq [ rdfs:label 'Calc2Graph1']]#/:lat");
PathElement element = prepareElement(input);
// Query.assertEqualsWOSpaces
assertEquals("Join\r\n" + " Join\r\n" + " Join\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=subject1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#subject)\r\n" + " Variable (name=n0)\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=property1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate)\r\n" + " Variable (name=p_n0_n1, value=http://default/appearsOn)\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=object1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#object)\r\n" + " Variable (name=n1)\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=p_r1_n2, value=http://default/lat)\r\n" + " Variable (name=n2)\r\n" + "", element.pathPatternQuery().toString());
}
use of com.inova8.intelligentgraph.model.Predicate in project com.inova8.intelligentgraph by peterjohnlawrence.
the class MultiPathPatternQueryExpressionTests method test_4.
/**
* Test 4.
*/
@Test
@Order(4)
void test_4() {
try {
PathElement element = PathParser.parsePathPattern(repositoryContext, ":Attribute@:density{1, 42}");
PathTupleExpr pathTupleExpr = element.pathPatternQuery(1, null);
// Query.assertEqualsWOSpaces
assertEquals("Join\r\n" + " Join\r\n" + " Join\r\n" + " Union\r\n" + " StatementPattern\r\n" + " Variable (name=r1_i1)\r\n" + " Variable (name=subject1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#subject)\r\n" + " Variable (name=n0)\r\n" + " StatementPattern\r\n" + " Variable (name=n0)\r\n" + " Variable (name=isSubjectOf1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#subject)\r\n" + " Variable (name=r1_i1)\r\n" + " Union\r\n" + " StatementPattern\r\n" + " Variable (name=r1_i1)\r\n" + " Variable (name=property1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate)\r\n" + " Variable (name=p_n0_n1, value=http://default/density)\r\n" + " StatementPattern\r\n" + " Variable (name=p_n0_n1, value=http://default/density)\r\n" + " Variable (name=isPropertyOf1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate)\r\n" + " Variable (name=r1_i1)\r\n" + " Union\r\n" + " StatementPattern\r\n" + " Variable (name=r1_i1)\r\n" + " Variable (name=object1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#object)\r\n" + " Variable (name=n1_i1)\r\n" + " StatementPattern\r\n" + " Variable (name=n1_i1)\r\n" + " Variable (name=isObjectOf1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#object)\r\n" + " Variable (name=r1_i1)\r\n" + " Join\r\n" + " Join\r\n" + " Union\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=subject1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#subject)\r\n" + " Variable (name=n1_i1)\r\n" + " StatementPattern\r\n" + " Variable (name=n1_i1)\r\n" + " Variable (name=isSubjectOf1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#subject)\r\n" + " Variable (name=r1)\r\n" + " Union\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=property1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate)\r\n" + " Variable (name=p_n0_n1, value=http://default/density)\r\n" + " StatementPattern\r\n" + " Variable (name=p_n0_n1, value=http://default/density)\r\n" + " Variable (name=isPropertyOf1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate)\r\n" + " Variable (name=r1)\r\n" + " Union\r\n" + " StatementPattern\r\n" + " Variable (name=r1)\r\n" + " Variable (name=object1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#object)\r\n" + " Variable (name=n1)\r\n" + " StatementPattern\r\n" + " Variable (name=n1)\r\n" + " Variable (name=isObjectOf1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#object)\r\n" + " Variable (name=r1)\r\n" + "", pathTupleExpr.toString());
assertEquals("[n0,r1_i1:<http://default/Attribute>@http://default/density,n1_i1,DIRECT,false]\r\n" + "[n1_i1,r1:<http://default/Attribute>@http://default/density,n1,DIRECT,false]\r\n" + "", pathTupleExpr.pathToString());
} catch (Exception e) {
assertEquals("", e.getMessage());
}
}
Aggregations