Search in sources :

Example 61 with Resource

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

the class Remote_PathQL_GetFactTests method test_23.

/**
 * Test 23.
 */
@Test
@Order(23)
void test_23() {
    try {
        Thing $this = source.getThing(iri("http://inova8.com/calc2graph/id/BatteryLimit1"), null);
        Resource result = $this.getFact(":Location@:appearsOn#[:location.Map  id:Calc2Graph2 ]");
        assertEquals("http://inova8.com/calc2graph/id/Location_BL1_2", result.stringValue());
    } catch (Exception e) {
        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 62 with Resource

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

the class Remote_PathQL_GetFactTests method test_7.

/**
 * Test 7.
 */
@Test
@Order(7)
void test_7() {
    try {
        Thing $this = source.getThing(iri("http://inova8.com/calc2graph/id/Unit1"), null);
        Resource result = $this.getFact("<http://inova8.com/calc2graph/def/massThroughput>");
        assertEquals("-0.06740710663143545", result.stringValue());
    } catch (Exception e) {
        fail();
        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 63 with Resource

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

the class Remote_PathQL_GetFactTests method test_11.

/**
 * Test 11.
 */
@Test
@Order(11)
void test_11() {
    try {
        Thing $this = source.getThing(iri("http://inova8.com/calc2graph/id/BatteryLimit1"), null);
        Resource result = $this.getFact(":lat");
        assertEquals("400", result.stringValue());
    } catch (Exception e) {
        fail();
        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 64 with Resource

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

the class Remote_PathQL_GetFactTests method test_21.

/**
 * Test 21.
 */
@Test
@Order(21)
void test_21() {
    try {
        Thing $this = source.getThing(iri("http://inova8.com/calc2graph/id/BatteryLimit1"), null);
        Resource result = $this.getFact(":Location@:appearsOn#[:location.Map  id:Calc2Graph1 ]/:long");
        assertEquals("501", result.stringValue());
    } catch (Exception e) {
        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 65 with Resource

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

the class Example2_Tests method example2_4.

/**
 * Example 2 4.
 */
@Test
@Order(4)
void example2_4() {
    try {
        Thing person = source.getThing(":Person");
        Resource averagebmi = person.getFact(":averageBMI");
        assertEquals("21.523052847377123", averagebmi.stringValue());
    } catch (Exception e) {
        assertEquals("", e.getCause().getMessage());
    }
}
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