use of com.inova8.intelligentgraph.results.PathResults in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_GetPath_Tests method test_3.
/**
* Test 3.
*/
@Test
@Order(3)
void test_3() {
try {
Thing _this = source.getThing(iri("http://inova8.com/calc2graph/id/Continuant_1"), null);
PathResults paths = _this.getPaths(":Connection@:connectedTo/:Connection@:connectedTo/:Connection@:connectedTo#");
assertEquals("Path=[[http://inova8.com/calc2graph/id/Continuant_1,<http://inova8.com/calc2graph/id/Connection_1_2>:<http://inova8.com/calc2graph/def/Connection>@http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Continuant_2,DIRECT,false]\r\n" + "[http://inova8.com/calc2graph/id/Continuant_2,<http://inova8.com/calc2graph/id/Connection_2_3>:<http://inova8.com/calc2graph/def/Connection>@http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Continuant_3,DIRECT,false]\r\n" + "[http://inova8.com/calc2graph/id/Continuant_3,<http://inova8.com/calc2graph/id/Connection_3_4>:<http://inova8.com/calc2graph/def/Connection>@http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Connection_3_4,DIRECT,true]\r\n" + "]\r\n" + "", paths.toString());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.results.PathResults in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_GetPath_Tests method test_7.
/**
* Test 7.
*/
@Test
@Order(7)
void test_7() {
try {
Thing _this = source.getThing(iri("http://inova8.com/calc2graph/id/Equipment_1"), null);
ResourceResults results = _this.getFacts(":connectedTo{1,3}");
ArrayList<String> resultsArrayList = new ArrayList<String>();
for (Resource result : results) {
resultsArrayList.add(result.stringValue());
}
assertEquals("[http://inova8.com/calc2graph/id/Equipment_2, http://inova8.com/calc2graph/id/Equipment_2_1, http://inova8.com/calc2graph/id/Equipment_3, http://inova8.com/calc2graph/id/Equipment_2_2, http://inova8.com/calc2graph/id/Equipment_4, http://inova8.com/calc2graph/id/Equipment_2_3]", resultsArrayList.toString());
PathResults paths = _this.getPaths(":connectedTo{1,3}");
ArrayList<String> pathArrayList = new ArrayList<String>();
for (Path path : paths) {
pathArrayList.add(path.toString());
}
assertEquals("[Path=[[http://inova8.com/calc2graph/id/Equipment_1,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_2,DIRECT]\r\n" + "]\r\n" + ", Path=[[http://inova8.com/calc2graph/id/Equipment_1,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_2_1,DIRECT]\r\n" + "]\r\n" + ", Path=[[http://inova8.com/calc2graph/id/Equipment_1,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_2,DIRECT]\r\n" + "[http://inova8.com/calc2graph/id/Equipment_2,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_3,DIRECT]\r\n" + "]\r\n" + ", Path=[[http://inova8.com/calc2graph/id/Equipment_1,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_2_1,DIRECT]\r\n" + "[http://inova8.com/calc2graph/id/Equipment_2_1,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_2_2,DIRECT]\r\n" + "]\r\n" + ", Path=[[http://inova8.com/calc2graph/id/Equipment_1,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_2,DIRECT]\r\n" + "[http://inova8.com/calc2graph/id/Equipment_2,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_3,DIRECT]\r\n" + "[http://inova8.com/calc2graph/id/Equipment_3,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_4,DIRECT]\r\n" + "]\r\n" + ", Path=[[http://inova8.com/calc2graph/id/Equipment_1,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_2_1,DIRECT]\r\n" + "[http://inova8.com/calc2graph/id/Equipment_2_1,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_2_2,DIRECT]\r\n" + "[http://inova8.com/calc2graph/id/Equipment_2_2,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_2_3,DIRECT]\r\n" + "]\r\n" + "]", pathArrayList.toString());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.results.PathResults in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_Kennedys_GetPath_Tests method test_1.
/**
* Test 1.
*/
@Test
@Order(1)
void test_1() {
try {
Thing _this = source.getThing(":ArnoldSchwarzenegger");
PathResults paths = _this.getPaths(":spouse/:parent/:parent/:almaMater");
assertEquals("Path=[[http://topbraid.org/examples/kennedys#ArnoldSchwarzenegger,http://topbraid.org/examples/kennedys#spouse,http://topbraid.org/examples/kennedys#MariaShriver,DIRECT]\r\n" + "[http://topbraid.org/examples/kennedys#MariaShriver,http://topbraid.org/examples/kennedys#parent,http://topbraid.org/examples/kennedys#EuniceKennedy,DIRECT]\r\n" + "[http://topbraid.org/examples/kennedys#EuniceKennedy,http://topbraid.org/examples/kennedys#parent,http://topbraid.org/examples/kennedys#JosephKennedy,DIRECT]\r\n" + "[http://topbraid.org/examples/kennedys#JosephKennedy,http://topbraid.org/examples/kennedys#almaMater,http://topbraid.org/examples/kennedys#Harvard,DIRECT]\r\n" + "]\r\n" + "Path=[[http://topbraid.org/examples/kennedys#ArnoldSchwarzenegger,http://topbraid.org/examples/kennedys#spouse,http://topbraid.org/examples/kennedys#MariaShriver,DIRECT]\r\n" + "[http://topbraid.org/examples/kennedys#MariaShriver,http://topbraid.org/examples/kennedys#parent,http://topbraid.org/examples/kennedys#EuniceKennedy,DIRECT]\r\n" + "[http://topbraid.org/examples/kennedys#EuniceKennedy,http://topbraid.org/examples/kennedys#parent,http://topbraid.org/examples/kennedys#RoseFitzgerald,DIRECT]\r\n" + "[http://topbraid.org/examples/kennedys#RoseFitzgerald,http://topbraid.org/examples/kennedys#almaMater,http://topbraid.org/examples/kennedys#SacredHeartConvent,DIRECT]\r\n" + "]\r\n" + "", paths.toString());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.results.PathResults in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_TFL_GetPath_Tests method test_1.
/**
* Test 1.
*/
@Test
@Order(1)
void test_1() {
try {
// Thing _this =source.getThing(iri("http://in4mium.com/londontube/id/","Mornington_Crescent"), null);
Thing _this = source.getThing("londontube:Mornington_Crescent");
PathResults paths = _this.getPaths(":connectsTo");
assertEquals("Path=[[http://in4mium.com/londontube/id/Mornington_Crescent,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Euston,DIRECT]\r\n" + "]\r\n" + "Path=[[http://in4mium.com/londontube/id/Mornington_Crescent,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Camden_Town,DIRECT]\r\n" + "]\r\n" + "", paths.toString());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.results.PathResults in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_TFL_GetPath_Tests method test_3.
/**
* Test 3.
*/
@Test
@Order(3)
void test_3() {
try {
Thing _this = source.getThing("londontube:Mornington_Crescent");
PathResults paths = _this.getPaths(":connectsTo{1,2}");
assertEquals("Path=[[http://in4mium.com/londontube/id/Mornington_Crescent,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Euston,DIRECT]\r\n" + "]\r\n" + "Path=[[http://in4mium.com/londontube/id/Mornington_Crescent,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Camden_Town,DIRECT]\r\n" + "]\r\n" + "Path=[[http://in4mium.com/londontube/id/Mornington_Crescent,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Euston,DIRECT]\r\n" + "[http://in4mium.com/londontube/id/Euston,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Kings_Cross_St._Pancras,DIRECT]\r\n" + "]\r\n" + "Path=[[http://in4mium.com/londontube/id/Mornington_Crescent,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Euston,DIRECT]\r\n" + "[http://in4mium.com/londontube/id/Euston,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/South_Hampstead,DIRECT]\r\n" + "]\r\n" + "Path=[[http://in4mium.com/londontube/id/Mornington_Crescent,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Euston,DIRECT]\r\n" + "[http://in4mium.com/londontube/id/Euston,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Camden_Town,DIRECT]\r\n" + "]\r\n" + "Path=[[http://in4mium.com/londontube/id/Mornington_Crescent,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Euston,DIRECT]\r\n" + "[http://in4mium.com/londontube/id/Euston,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Mornington_Crescent,DIRECT]\r\n" + "]\r\n" + "Path=[[http://in4mium.com/londontube/id/Mornington_Crescent,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Euston,DIRECT]\r\n" + "[http://in4mium.com/londontube/id/Euston,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Wembley_Central,DIRECT]\r\n" + "]\r\n" + "Path=[[http://in4mium.com/londontube/id/Mornington_Crescent,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Euston,DIRECT]\r\n" + "[http://in4mium.com/londontube/id/Euston,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Warren_Street,DIRECT]\r\n" + "]\r\n" + "Path=[[http://in4mium.com/londontube/id/Mornington_Crescent,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Camden_Town,DIRECT]\r\n" + "[http://in4mium.com/londontube/id/Camden_Town,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Euston,DIRECT]\r\n" + "]\r\n" + "Path=[[http://in4mium.com/londontube/id/Mornington_Crescent,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Camden_Town,DIRECT]\r\n" + "[http://in4mium.com/londontube/id/Camden_Town,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Mornington_Crescent,DIRECT]\r\n" + "]\r\n" + "Path=[[http://in4mium.com/londontube/id/Mornington_Crescent,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Camden_Town,DIRECT]\r\n" + "[http://in4mium.com/londontube/id/Camden_Town,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Chalk_Farm,DIRECT]\r\n" + "]\r\n" + "Path=[[http://in4mium.com/londontube/id/Mornington_Crescent,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Camden_Town,DIRECT]\r\n" + "[http://in4mium.com/londontube/id/Camden_Town,http://in4mium.com/londontube/ref/connectsTo,http://in4mium.com/londontube/id/Kentish_Town,DIRECT]\r\n" + "]\r\n" + "", paths.toString());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
Aggregations