use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Remote_PathQL_GetFactTests method test_20.
/**
* Test 20.
*/
@Test
@Order(20)
void test_20() {
try {
Thing $this = source.getThing(iri("http://inova8.com/calc2graph/id/BatteryLimit1"), null);
Resource result = $this.getFact(":Location@:appearsOn[eq [ rdfs:label 'Calc2Graph2']]#/:lat");
assertEquals("400", 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_30.
/**
* Test 30.
*/
@Test
@Order(30)
void test_30() {
try {
@SuppressWarnings("unused") Graph graph = source.addGraph("<http://inova8.com/calc2graph/testGraph>");
source.removeGraph("<http://inova8.com/calc2graph/testGraph1>");
Graph graph1 = source.openGraph("<http://inova8.com/calc2graph/testGraph1>");
Thing myCountry = graph1.getThing(":Country1");
String performanceCalculation = "2*3";
myCountry.addFact(":salesPerformance", performanceCalculation, SCRIPT.GROOVY);
ResourceResults results = myCountry.getFacts(":salesPerformance");
for (Resource result : results) {
result.getValue();
assertEquals("6", result.getValue().stringValue());
}
source.removeGraph("<http://inova8.com/calc2graph/testGraph>");
} catch (Exception e) {
fail();
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Remote_PathQL_MultiGraphTests method test_10.
/**
* Test 10.
*/
@Test
@Order(10)
void test_10() {
try {
// Graph graph = source.addGraph("<http://inova8.com/calc2graph/testGraph>");
// source.removeGraph("<http://inova8.com/calc2graph/testGraph1>");
Graph graph1 = source.openGraph("<http://inova8.com/calc2graph/testGraph1>");
Thing myCountry = graph1.getThing(":Country1");
String performanceCalculation = "2*3";
myCountry.addFact(":salesPerformance", performanceCalculation, SCRIPT.GROOVY);
ResourceResults results = myCountry.getFacts(":salesPerformance");
for (Resource result : results) {
assertEquals("6", result.getValue().stringValue());
}
// source.removeGraph("<http://inova8.com/calc2graph/testGraph1>");
source.closeGraph("<http://inova8.com/calc2graph/testGraph1>");
} catch (Exception e) {
fail();
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Remote_PathQL_GetFactTests method test_13.
/**
* Test 13.
*/
@Test
@Order(13)
void test_13() {
try {
Thing $this = source.getThing(iri("http://inova8.com/calc2graph/id/BatteryLimit1"), null);
Resource result = $this.getFact(":Location@:appearsOn[eq id:Calc2Graph1]#").getFact(":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_15.
/**
* Test 15.
*/
@Test
@Order(15)
void test_15() {
try {
Thing $this = source.getThing(iri("http://inova8.com/calc2graph/id/BatteryLimit1"), null);
Resource result = $this.getFact("<http://inova8.com/calc2graph/def/long>");
assertEquals("501", result.stringValue());
} catch (Exception e) {
fail();
e.printStackTrace();
}
}
Aggregations