Search in sources :

Example 71 with Resource

use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.

the class Example6_Tests method example6_1.

/**
 * Example 6 1.
 */
@Test
@Order(1)
void example6_1() {
    try {
        Thing aPerson_Measurement = source.getThing(":Measurement_1");
        Resource bmi = aPerson_Measurement.getFact(":hasBMI");
        assertEquals("21.453287197231838", bmi.stringValue());
    } catch (Exception e) {
        assertEquals("", e.getMessage());
        e.printStackTrace();
    }
}
Also used : Resource(com.inova8.intelligentgraph.model.Resource) Thing(com.inova8.intelligentgraph.model.Thing) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) Test(org.junit.jupiter.api.Test)

Example 72 with Resource

use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.

the class Example6_Tests method example6_2.

/**
 * Example 6 2.
 */
@Test
@Order(2)
void example6_2() {
    try {
        Thing aPerson_Measurement = source.getThing(":Measurement_2");
        Resource bmi = aPerson_Measurement.getFact(":hasBMI");
        assertEquals("22.03856749311295", bmi.stringValue());
    } catch (Exception e) {
        assertEquals("", e.getMessage());
        e.printStackTrace();
    }
}
Also used : Resource(com.inova8.intelligentgraph.model.Resource) Thing(com.inova8.intelligentgraph.model.Thing) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) Test(org.junit.jupiter.api.Test)

Example 73 with Resource

use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.

the class Example6_Tests method example6_5.

/**
 * Example 6 5.
 */
@Test
@Order(5)
void example6_5() {
    try {
        Resource bmi = source.getThing(":aPerson").getFact(":Observation@:BMIObservation[:hasDate %1]/:hasBMI", literal(LocalDate.parse("2021-08-02")));
        assertEquals("22.03856749311295", bmi.stringValue());
    } catch (Exception e) {
        assertEquals("", e.getMessage());
        e.printStackTrace();
    }
}
Also used : Resource(com.inova8.intelligentgraph.model.Resource) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) Test(org.junit.jupiter.api.Test)

Example 74 with Resource

use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.

the class ExampleLanguageTest_Tests method example1_3.

/**
 * Example 1 3.
 */
@Test
@Order(3)
void example1_3() {
    try {
        Thing peter = source.getThing(":aPerson");
        Resource bmi = peter.getFact(":hasBMIpytest");
        assertEquals("21.453287197231838", bmi.stringValue());
    } catch (Exception e) {
        assertEquals("", e.getMessage());
        e.printStackTrace();
    }
}
Also used : Resource(com.inova8.intelligentgraph.model.Resource) Thing(com.inova8.intelligentgraph.model.Thing) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) Test(org.junit.jupiter.api.Test)

Example 75 with Resource

use of com.inova8.intelligentgraph.model.Resource in project com.inova8.intelligentgraph by peterjohnlawrence.

the class ExampleLanguageTest_Tests method example1_4.

/**
 * Example 1 4.
 */
@Test
@Order(4)
void example1_4() {
    try {
        Thing peter = source.getThing(":aPerson");
        Resource bmi = peter.getFact(":hasBMIpy");
        assertEquals("21.453287197231838", bmi.stringValue());
    } catch (Exception e) {
        assertEquals("", e.getMessage());
        e.printStackTrace();
    }
}
Also used : Resource(com.inova8.intelligentgraph.model.Resource) Thing(com.inova8.intelligentgraph.model.Thing) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) Test(org.junit.jupiter.api.Test)

Aggregations

Resource (com.inova8.intelligentgraph.model.Resource)140 Order (org.junit.jupiter.api.Order)135 Test (org.junit.jupiter.api.Test)135 TestMethodOrder (org.junit.jupiter.api.TestMethodOrder)135 Thing (com.inova8.intelligentgraph.model.Thing)113 ResourceResults (com.inova8.intelligentgraph.results.ResourceResults)26 IntelligentGraphRepository (com.inova8.intelligentgraph.intelligentGraphRepository.IntelligentGraphRepository)20 Graph (com.inova8.intelligentgraph.intelligentGraphRepository.Graph)19 QueryEvaluationException (org.eclipse.rdf4j.query.QueryEvaluationException)11 CustomQueryOptions (com.inova8.intelligentgraph.context.CustomQueryOptions)9 PathPatternException (com.inova8.pathql.processor.PathPatternException)8 RecognitionException (org.antlr.v4.runtime.RecognitionException)8 ArrayList (java.util.ArrayList)7 IRI (org.eclipse.rdf4j.model.IRI)7 RepositoryException (org.eclipse.rdf4j.repository.RepositoryException)7 Repository (org.eclipse.rdf4j.repository.Repository)6 RepositoryConnection (org.eclipse.rdf4j.repository.RepositoryConnection)6 NullValueReturnedException (com.inova8.intelligentgraph.exceptions.NullValueReturnedException)5 UnsupportedEncodingException (java.io.UnsupportedEncodingException)5 BindingSet (org.eclipse.rdf4j.query.BindingSet)5