use of com.inova8.intelligentgraph.results.ResourceResults in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Example4_Tests method example4_9.
@Test
@Order(9)
void example4_9() {
try {
ResourceResults facts = source.getFacts("[ a owl:Class; eq :Gender]/^a/*");
assertEquals("[ {s=http://inova8.com/intelligentgraph/example4/Male, p=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, o=http://inova8.com/intelligentgraph/example4/Gender}; {s=http://inova8.com/intelligentgraph/example4/Male, p=http://www.w3.org/2000/01/rdf-schema#label, o=\"Male\"}; {s=http://inova8.com/intelligentgraph/example4/Male, p=http://inova8.com/intelligentgraph/example4/averageBMI, o=\"22.31095112223672\"^^<http://www.w3.org/2001/XMLSchema#double>}; {s=http://inova8.com/intelligentgraph/example4/Male, p=http://inova8.com/intelligentgraph/example4/total, o=\"9\"^^<http://www.w3.org/2001/XMLSchema#int>}; {s=http://inova8.com/intelligentgraph/example4/Female, p=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, o=http://inova8.com/intelligentgraph/example4/Gender}; {s=http://inova8.com/intelligentgraph/example4/Female, p=http://www.w3.org/2000/01/rdf-schema#label, o=\"Female\"}; {s=http://inova8.com/intelligentgraph/example4/Female, p=http://inova8.com/intelligentgraph/example4/averageBMI, o=\"20.603838193374262\"^^<http://www.w3.org/2001/XMLSchema#double>}; {s=http://inova8.com/intelligentgraph/example4/Female, p=http://inova8.com/intelligentgraph/example4/total, o=\"8\"^^<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_1.
/**
* Example 4 1.
*/
@Test
@Order(1)
void example4_1() {
try {
Thing person = source.getThing(":Person");
ResourceResults persons = person.getFacts("^rdf:type[:hasLocation :Tideswell ; :hasGender :Male ]");
// ResourceResults persons = person.getFacts("^rdf:type[:hasLocation :Tideswell ]");
ArrayList<String> personValues = new ArrayList<String>();
for (Resource person1 : persons) {
personValues.add(person1.getValue().stringValue());
}
assertEquals("[http://inova8.com/intelligentgraph/example4/Another1, http://inova8.com/intelligentgraph/example4/Another11, http://inova8.com/intelligentgraph/example4/aPerson]", personValues.toString());
} catch (Exception e) {
assertEquals("", e.getMessage());
e.printStackTrace();
}
}
use of com.inova8.intelligentgraph.results.ResourceResults in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Example4_Tests method example4_11.
@Test
@Order(11)
void example4_11() {
try {
ResourceResults facts = source.getFacts("[ a owl:Class; eq :Person]/^a[:hasLocation :Tideswell ; :hasGender :Male ;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_8.
@Test
@Order(8)
void example4_8() {
try {
ResourceResults facts = source.getFacts("[ a owl:Class; eq :Person]/^a[:hasLocation :Maidstone ; :hasGender :Male]/(:hasHeight | :hasWeight | :hasLocation)");
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/Another2, p=http://inova8.com/intelligentgraph/example4/hasWeight, o=\"65\"^^<http://www.w3.org/2001/XMLSchema#integer>}; {s=http://inova8.com/intelligentgraph/example4/Another2, p=http://inova8.com/intelligentgraph/example4/hasLocation, o=http://inova8.com/intelligentgraph/example4/Maidstone}; {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/Another4, p=http://inova8.com/intelligentgraph/example4/hasWeight, o=\"47\"^^<http://www.w3.org/2001/XMLSchema#integer>}; {s=http://inova8.com/intelligentgraph/example4/Another4, p=http://inova8.com/intelligentgraph/example4/hasLocation, o=http://inova8.com/intelligentgraph/example4/Maidstone}; {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/Another6, p=http://inova8.com/intelligentgraph/example4/hasWeight, o=\"56\"^^<http://www.w3.org/2001/XMLSchema#integer>}; {s=http://inova8.com/intelligentgraph/example4/Another6, p=http://inova8.com/intelligentgraph/example4/hasLocation, o=http://inova8.com/intelligentgraph/example4/Maidstone}; {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/Another8, p=http://inova8.com/intelligentgraph/example4/hasWeight, o=\"66\"^^<http://www.w3.org/2001/XMLSchema#integer>}; {s=http://inova8.com/intelligentgraph/example4/Another8, p=http://inova8.com/intelligentgraph/example4/hasLocation, o=http://inova8.com/intelligentgraph/example4/Maidstone};]", 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 Example5_Tests method example5_3.
/**
* Example 5 3.
*/
@Test
@Order(3)
void example5_3() {
try {
Thing aPerson = source.getThing(":aPerson");
ResourceResults bmis = aPerson.getFacts("^:measurementOf/:hasBMI");
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>}; {s=http://inova8.com/intelligentgraph/example5/aPerson_Measurement_3, p=http://inova8.com/intelligentgraph/example5/hasBMI, o=\"22.49134948096886\"^^<http://www.w3.org/2001/XMLSchema#double>}; {s=http://inova8.com/intelligentgraph/example5/aPerson_Measurement_4, p=http://inova8.com/intelligentgraph/example5/hasBMI, o=\"19.723183391003463\"^^<http://www.w3.org/2001/XMLSchema#double>}; {s=http://inova8.com/intelligentgraph/example5/aPerson_Measurement_5, p=http://inova8.com/intelligentgraph/example5/hasBMI, o=\"19.918367346938776\"^^<http://www.w3.org/2001/XMLSchema#double>}; {s=http://inova8.com/intelligentgraph/example5/aPerson_Measurement_6, p=http://inova8.com/intelligentgraph/example5/hasBMI, o=\"20.571428571428573\"^^<http://www.w3.org/2001/XMLSchema#double>};]", bmis.toString());
} catch (Exception e) {
fail();
e.printStackTrace();
}
}
Aggregations