use of com.inova8.intelligentgraph.model.Resource 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.Resource 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.Resource 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();
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Local_GetFact_Tests method test_19.
/**
* Test 19.
*/
@Test
@Order(19)
void test_19() {
try {
Thing _this = source.getThing(iri("http://inova8.com/calc2graph/id/BatteryLimit1"), null);
Resource result = _this.getFact(":Location@:appearsOn[ rdfs:label '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_GetFact_Tests method test_17.
/**
* Test 17.
*/
@Test
@Order(17)
void test_17() {
try {
Thing _this = source.getThing(iri("http://inova8.com/calc2graph/id/Calc2Graph1"), null);
Resource result = _this.getFact("^:Location@:appearsOn[eq id:BatteryLimit2]");
assertEquals("http://inova8.com/calc2graph/id/BatteryLimit2", result.stringValue());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
Aggregations