use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Remote_PathQL_GetFactTests method test_14.
/**
* Test 14.
*/
@Test
@Order(14)
void test_14() {
try {
Thing $this = source.getThing(iri("http://inova8.com/calc2graph/id/BatteryLimit1"), null);
Resource result = $this.getFact(":Location@:appearsOn[eq id:Calc2Graph2]#");
if (result != null)
assertEquals("http://inova8.com/calc2graph/id/Location_BL1_2", result.stringValue());
} catch (Exception e) {
fail();
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Remote_PathQL_GetFactTests method test_3.
/**
* Test 3.
*/
@Test
@Order(3)
void test_3() {
try {
Thing $this = Thing.create(source, iri("http://inova8.com/calc2graph/id/Unit1"), null);
Double fact = 0.0;
for (Resource batterylimit : $this.getFacts(":hasProductBatteryLimit")) {
@SuppressWarnings("unused") Resource factValue = batterylimit.getFact(":massFlow");
fact += batterylimit.getFact(":massFlow").doubleValue();
}
ResourceResults batterylimits = $this.getFacts(":hasProductBatteryLimit");
Resource batterylimit;
while (batterylimits.hasNext()) {
batterylimit = batterylimits.next();
fact -= batterylimit.getFact(":massFlow").doubleValue();
}
;
assertEquals(0.0, fact);
} catch (Exception e) {
fail();
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Remote_PathQL_GetFactTests method test_12.
/**
* Test 12.
*/
@Test
@Order(12)
void test_12() {
try {
Thing $this = source.getThing(iri("http://inova8.com/calc2graph/id/BatteryLimit1"), null);
Resource result = $this.getFact(":Location@:appearsOn[eq id:Calc2Graph1]#/:lat");
assertEquals("400", result.stringValue());
} catch (Exception e) {
fail();
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Remote_PathQL_GetFactTests method test_22.
/**
* Test 22.
*/
@Test
@Order(22)
void test_22() {
try {
Thing $this = source.getThing(iri("http://inova8.com/calc2graph/id/BatteryLimit1"), null);
Resource result = $this.getFact(":Location@:appearsOn#[:location.Map id:Calc2Graph2 ]/:long");
assertEquals("502", result.stringValue());
} catch (Exception e) {
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Remote_PathQL_GetFactTests method test_8.
/**
* Test 8.
*/
@Test
@Order(8)
void test_8() {
try {
Thing $this = source.getThing(iri("http://inova8.com/calc2graph/id/BatteryLimit2"), null);
Resource result = $this.getFact("^:hasProductBatteryLimit").getFact(":massThroughput");
assertEquals("-0.06740710663143545", result.stringValue());
} catch (Exception e) {
fail();
e.printStackTrace();
}
}
Aggregations