use of com.inova8.intelligentgraph.results.ResourceResults in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Example4_Tests method example4_7.
@Test
@Order(7)
void example4_7() {
try {
ResourceResults classes = source.getFacts("[ a owl:Class; eq :Person]/^a[:hasLocation :Maidstone]/:hasHeight");
assertEquals("[ {s=http://inova8.com/intelligentgraph/example4/Another2, p=http://inova8.com/intelligentgraph/example4/hasHeight, o=\"1.7\"^^<http://www.w3.org/2001/XMLSchema#decimal>}; {s=http://inova8.com/intelligentgraph/example4/Another3, p=http://inova8.com/intelligentgraph/example4/hasHeight, o=\"2\"^^<http://www.w3.org/2001/XMLSchema#integer>}; {s=http://inova8.com/intelligentgraph/example4/Another4, p=http://inova8.com/intelligentgraph/example4/hasHeight, o=\"1.8\"^^<http://www.w3.org/2001/XMLSchema#decimal>}; {s=http://inova8.com/intelligentgraph/example4/Another5, p=http://inova8.com/intelligentgraph/example4/hasHeight, o=\"1.5\"^^<http://www.w3.org/2001/XMLSchema#decimal>}; {s=http://inova8.com/intelligentgraph/example4/Another6, p=http://inova8.com/intelligentgraph/example4/hasHeight, o=\"1.5\"^^<http://www.w3.org/2001/XMLSchema#decimal>}; {s=http://inova8.com/intelligentgraph/example4/Another7, p=http://inova8.com/intelligentgraph/example4/hasHeight, o=\"1.7\"^^<http://www.w3.org/2001/XMLSchema#decimal>}; {s=http://inova8.com/intelligentgraph/example4/Another8, p=http://inova8.com/intelligentgraph/example4/hasHeight, o=\"1.6\"^^<http://www.w3.org/2001/XMLSchema#decimal>}; {s=http://inova8.com/intelligentgraph/example4/Another9, p=http://inova8.com/intelligentgraph/example4/hasHeight, o=\"1.7\"^^<http://www.w3.org/2001/XMLSchema#decimal>};]", classes.toString());
} catch (Exception e) {
assertEquals("", e.getCause().getMessage());
}
}
use of com.inova8.intelligentgraph.results.ResourceResults in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Example4_Tests method example4_10.
@Test
@Order(10)
void example4_10() {
try {
ResourceResults facts = source.getFacts("[ eq :Another1]/:hasLocation/*");
assertEquals("[ {s=http://inova8.com/intelligentgraph/example4/Tideswell, p=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, o=http://inova8.com/intelligentgraph/example4/Location}; {s=http://inova8.com/intelligentgraph/example4/Tideswell, p=http://www.w3.org/2000/01/rdf-schema#label, o=\"Tideswell\"}; {s=http://inova8.com/intelligentgraph/example4/Tideswell, p=http://inova8.com/intelligentgraph/example4/averageBMI, o=\"21.7109303439298\"^^<http://www.w3.org/2001/XMLSchema#double>}; {s=http://inova8.com/intelligentgraph/example4/Tideswell, p=http://inova8.com/intelligentgraph/example4/total, o=\"7\"^^<http://www.w3.org/2001/XMLSchema#int>};]", facts.toString());
} catch (Exception e) {
assertEquals("", e.getCause().getMessage());
}
}
use of com.inova8.intelligentgraph.results.ResourceResults in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Example4_Tests method example4_6.
@Test
@Order(6)
void example4_6() {
try {
ResourceResults classes = source.getFacts("[ a owl:Class]/rdfs:label");
assertEquals("[ {s=http://inova8.com/intelligentgraph/example4/Person, p=http://www.w3.org/2000/01/rdf-schema#label, o=\"Person\"}; {s=http://inova8.com/intelligentgraph/example4/Gender, p=http://www.w3.org/2000/01/rdf-schema#label, o=\"Gender\"}; {s=http://inova8.com/intelligentgraph/example4/Gender_Location, p=http://www.w3.org/2000/01/rdf-schema#label, o=\"Gender Location\"}; {s=http://inova8.com/intelligentgraph/example4/Location, p=http://www.w3.org/2000/01/rdf-schema#label, o=\"Location\"};]", classes.toString());
} catch (Exception e) {
assertEquals("", e.getCause().getMessage());
}
}
use of com.inova8.intelligentgraph.results.ResourceResults in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Example5_Tests method example5_6.
/**
* Example 5 6.
*/
@Test
@Order(6)
void example5_6() {
try {
Thing aPerson = source.getThing(":aPerson");
ResourceResults bmis = aPerson.getFacts("^:measurementOf[:hasDate [lt %1]]/:hasBMI", literal(LocalDate.parse("2021-08-03")));
assertEquals("[ {s=http://inova8.com/intelligentgraph/example5/aPerson_Measurement_1, p=http://inova8.com/intelligentgraph/example5/hasBMI, o=\"21.453287197231838\"^^<http://www.w3.org/2001/XMLSchema#double>}; {s=http://inova8.com/intelligentgraph/example5/aPerson_Measurement_2, p=http://inova8.com/intelligentgraph/example5/hasBMI, o=\"22.03856749311295\"^^<http://www.w3.org/2001/XMLSchema#double>};]", bmis.toString());
} catch (Exception e) {
fail();
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.results.ResourceResults in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Example6_Tests method example6_3.
/**
* Example 6 3.
*/
@Test
@Order(3)
void example6_3() {
try {
Thing aPerson = source.getThing(":aPerson");
ResourceResults bmis = aPerson.getFacts(":Observation@:BMIObservation/:hasBMI");
assertEquals("[ {s=http://inova8.com/intelligentgraph/example6/Measurement_1, p=http://inova8.com/intelligentgraph/example6/hasBMI, o=\"21.453287197231838\"^^<http://www.w3.org/2001/XMLSchema#double>}; {s=http://inova8.com/intelligentgraph/example6/Measurement_2, p=http://inova8.com/intelligentgraph/example6/hasBMI, o=\"22.03856749311295\"^^<http://www.w3.org/2001/XMLSchema#double>}; {s=http://inova8.com/intelligentgraph/example6/Measurement_3, p=http://inova8.com/intelligentgraph/example6/hasBMI, o=\"22.49134948096886\"^^<http://www.w3.org/2001/XMLSchema#double>}; {s=http://inova8.com/intelligentgraph/example6/Measurement_4, p=http://inova8.com/intelligentgraph/example6/hasBMI, o=\"19.723183391003463\"^^<http://www.w3.org/2001/XMLSchema#double>}; {s=http://inova8.com/intelligentgraph/example6/Measurement_5, p=http://inova8.com/intelligentgraph/example6/hasBMI, o=\"19.918367346938776\"^^<http://www.w3.org/2001/XMLSchema#double>}; {s=http://inova8.com/intelligentgraph/example6/Measurement_6, p=http://inova8.com/intelligentgraph/example6/hasBMI, o=\"20.571428571428573\"^^<http://www.w3.org/2001/XMLSchema#double>};]", bmis.toString());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
Aggregations