use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Example2_Tests method example2_3.
/**
* Example 2 3.
*/
@Test
@Order(3)
void example2_3() {
try {
Thing personType = source.getThing(":Person");
ResourceResults persons = personType.getFacts("^rdf:type/:hasBMI");
ArrayList<String> personValues = new ArrayList<String>();
;
for (Resource person : persons) {
personValues.add(person.getValue().stringValue());
}
assertEquals("[19.94459833795014, 16.897506925207757, 27.11111111111111, 23.148148148148145, 22.49134948096886, 14.75, 14.506172839506172, 31.11111111111111, 24.88888888888889, 21.79930795847751, 25.781249999999996, 15.91695501730104, 21.453287197231838]", personValues.toString());
} catch (Exception e) {
assertEquals("", e.getCause().getMessage());
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Example2_Tests method example2_1.
/**
* Example 2 1.
*/
@Test
@Order(1)
void example2_1() {
try {
Thing aPerson = source.getThing(":aPerson");
Resource bmi = aPerson.getFact(":hasBMI");
assertEquals("21.453287197231838", bmi.stringValue());
Thing another1 = source.getThing(":Another1");
Resource another1bmi = another1.getFact(":hasBMI");
assertEquals("19.94459833795014", another1bmi.stringValue());
} catch (Exception e) {
assertEquals("", e.getCause().getMessage());
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Example2_Tests method example2_5.
/**
* Example 2 5.
*/
@Test
@Order(5)
void example2_5() {
try {
Thing person = source.getThing(":aPerson");
Resource relativeBMI = person.getFact(":hasRelativeBMI");
assertEquals("0.9967585615925397", relativeBMI.stringValue());
} catch (Exception e) {
assertEquals("", e.getCause().getMessage());
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Example5_Tests method example5_1.
/**
* Example 5 1.
*/
@Test
@Order(1)
void example5_1() {
try {
Thing aPerson_Measurement = source.getThing(":aPerson_Measurement_1");
Resource bmi = aPerson_Measurement.getFact(":hasBMI");
assertEquals("21.453287197231838", bmi.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 Example5_Tests method example5_4.
/**
* Example 5 4.
*/
@Test
@Order(4)
void example5_4() {
try {
Resource bmi = source.getThing(":aPerson").getFact("^:measurementOf[:hasOrdinal %1]/:hasBMI", literal(2));
assertEquals("22.03856749311295", bmi.stringValue());
} catch (Exception e) {
fail();
e.printStackTrace();
}
}
Aggregations