use of com.inova8.intelligentgraph.model.Thing in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_GetFact_Tests method test_34.
/**
* Test 34.
*/
@Test
@Order(34)
void test_34() {
try {
source = IntelligentGraphRepository.create(workingRep);
Thing _this = source.getThing(iri("http://inova8.com/calc2graph/id/BatteryLimit3"), null);
Resource result = _this.getFact("<http://inova8.com/calc2graph/def/massYield>");
assertEquals("0.26315789803903855", result.stringValue());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.model.Thing in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_GetFact_Tests method test_35.
/**
* Test 35.
*/
@Test
@Order(35)
void test_35() {
try {
source = IntelligentGraphRepository.create(workingRep);
source.removeGraph("<http://inova8.com/calc2graph/contextGraph>");
Graph graph = source.addGraph("<http://inova8.com/calc2graph/contextGraph>");
Thing myCountry = graph.getThing(":Country1");
myCountry.addFact(":time", "_customQueryOptions.get(\"time\") ;", SCRIPT.GROOVY);
CustomQueryOptions customQueryOptions = new CustomQueryOptions();
customQueryOptions.add("time", 42);
customQueryOptions.add("name", "Peter");
Thing myCountry1 = graph.getThing(":Country1");
Resource result = myCountry1.getFact("<http://inova8.com/calc2graph/def/time>", customQueryOptions);
assertEquals("42", result.stringValue());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.model.Thing in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_GetFact_Tests 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("37.99999952316284", result.stringValue());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.model.Thing in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_GetFact_Tests method test_10.
/**
* Test 10.
*/
@Test
@Order(10)
void test_10() {
try {
Thing _this = source.getThing(iri("http://inova8.com/calc2graph/id/BatteryLimit2"), null);
Float result = _this.getFact("^:hasProductBatteryLimit/:massThroughput").floatValue();
assertEquals("38.0", result.toString());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.model.Thing in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_GetFact_Tests method test_23.
/**
* Test 23.
*/
@Test
@Order(23)
void test_23() {
try {
Thing _this = source.getThing(iri("http://inova8.com/calc2graph/id/BatteryLimit1"), null);
Resource result = _this.getFact(":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();
}
}
Aggregations