use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Example7_Tests method example7_6.
/**
* Example 7 6.
*/
@Test
@Order(6)
void example7_6() {
try {
Thing aPerson = source.getThing(":aPerson");
Resource femaleParent = aPerson.getFact(":hasFamilialRelativeBMI");
assertEquals(1.006889937409004, femaleParent.doubleValue());
} catch (Exception e) {
assertEquals("", e.getCause().getMessage());
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Example7_Tests method example7_1.
/**
* Example 7 1.
*/
@Test
@Order(1)
void example7_1() {
try {
Thing aPerson = source.getThing(":aPerson");
Resource femaleParent = aPerson.getFact(":hasParent{0,4}/:hasParent[:hasGender :Female]");
assertEquals("http://inova8.com/intelligentgraph/example7/Another3", femaleParent.stringValue());
} catch (Exception e) {
assertEquals("", e.getCause().getMessage());
}
}
use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.
the class ExampleLanguageTest_Tests method example1_2.
/**
* Example 1 2.
*/
@Test
@Order(2)
void example1_2() {
try {
Thing peter = source.getThing(":aPerson");
Resource bmi = peter.getFact(":hasBMIjs");
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 ExampleLanguageTest_Tests method example1_1.
/**
* Example 1 1.
*/
@Test
@Order(1)
void example1_1() {
try {
Thing peter = source.getThing(":aPerson");
Resource bmi = peter.getFact(":hasBMIgroovy");
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 ExampleLanguageTest_Tests method example1_5.
/**
* Example 1 5.
*/
@Test
@Order(5)
void example1_5() {
try {
Thing peter = source.getThing(":aPerson");
CustomQueryOptions customQueryOptions = new CustomQueryOptions();
// customQueryOptions.add("aOption", LocalDate.of(2018,2,13));
// customQueryOptions.add("aOption", LocalDateTime.of(2018,2,13,6,30));
// customQueryOptions.add("aOption", LocalTime.of(6,30));
customQueryOptions.add("aOption", LocalDateTime.parse("2018-02-14T06:30"));
Resource bmi = peter.getFact(":hasCustomQueryOptionTest", customQueryOptions);
assertEquals("\"2018-02-14T06:30:00.0\"^^<http://www.w3.org/2001/XMLSchema#dateTime>", bmi.stringValue());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
Aggregations