use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_BoundFact_Tests 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 : source.getFacts("[eq id:Unit1]/:hasProductBatteryLimit")) {
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) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_BoundFact_Tests method test_27.
/**
* Test 27.
*/
@Test
@Order(27)
void test_27() {
try {
Resource result = source.getFact("[eq <http://inova8.com/calc2graph/id/Unit3>]/:massFlowBalance");
assertEquals("-13.220000296831131", result.stringValue());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_BoundFact_Tests method test_2_1.
/**
* Test 2 1.
*/
@Test
@Order(21)
void test_2_1() {
try {
Resource result = source.getFact("[eq id:Unit1]/:hasFeedBatteryLimit/:volumeFlow");
assertEquals("59", result.stringValue());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_BoundFact_Tests method test_23.
/**
* Test 23.
*/
@Test
@Order(23)
void test_23() {
try {
Resource result = source.getFact("[eq <http://inova8.com/calc2graph/id/BatteryLimit1>]/:Location@:appearsOn#[:location.Map id:Calc2Graph2 ]");
assertEquals("http://inova8.com/calc2graph/id/Location_BL1_2", result.stringValue());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_BoundFact_Tests method test_13.
/**
* Test 13.
*/
@Test
@Order(13)
void test_13() {
try {
Resource result = source.getFact("[eq <http://inova8.com/calc2graph/id/BatteryLimit1>]/:Location@:appearsOn[eq id:Calc2Graph1]#").getFact(":lat");
assertEquals("400", result.stringValue());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
Aggregations