Search in sources :

Example 36 with PathResults

use of com.inova8.intelligentgraph.results.PathResults in project com.inova8.intelligentgraph by peterjohnlawrence.

the class Local_Kennedys_GetPath_Tests method test_2.

/**
 * Test 2.
 */
@Test
@Order(2)
void test_2() {
    try {
        Thing _this = source.getThing(":ArnoldSchwarzenegger");
        PathResults paths = _this.getPaths("(:spouse|:parent|:child){0,5}/:almaMater[eq :Harvard]");
        for (Path path : paths) {
            assertEquals("Path=[[http://topbraid.org/examples/kennedys#ArnoldSchwarzenegger,http://topbraid.org/examples/kennedys#spouse,http://topbraid.org/examples/kennedys#MariaShriver,DIRECT]\r\n" + "[http://topbraid.org/examples/kennedys#MariaShriver,http://topbraid.org/examples/kennedys#parent,http://topbraid.org/examples/kennedys#EuniceKennedy,DIRECT]\r\n" + "[http://topbraid.org/examples/kennedys#EuniceKennedy,http://topbraid.org/examples/kennedys#parent,http://topbraid.org/examples/kennedys#JosephKennedy,DIRECT]\r\n" + "[http://topbraid.org/examples/kennedys#JosephKennedy,http://topbraid.org/examples/kennedys#almaMater,http://topbraid.org/examples/kennedys#Harvard,DIRECT]\r\n" + "]\r\n" + "", path.toString());
            break;
        }
    } catch (Exception e) {
        assertEquals("", e.getMessage());
        e.printStackTrace();
    }
}
Also used : Path(com.inova8.intelligentgraph.path.Path) PathResults(com.inova8.intelligentgraph.results.PathResults) 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 37 with PathResults

use of com.inova8.intelligentgraph.results.PathResults in project com.inova8.intelligentgraph by peterjohnlawrence.

the class Local_BoundPath_Tests method test_1.

/**
 * Test 1.
 */
@Test
@Order(1)
void test_1() {
    try {
        PathResults paths = source.getPaths("[ eq <http://inova8.com/calc2graph/id/Equipment_1>]/:connectedTo/:connectedTo/:connectedTo");
        assertEquals("Path=[[http://inova8.com/calc2graph/id/Equipment_1,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_2,DIRECT]\r\n" + "[http://inova8.com/calc2graph/id/Equipment_2,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_3,DIRECT]\r\n" + "[http://inova8.com/calc2graph/id/Equipment_3,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_4,DIRECT]\r\n" + "]\r\n" + "Path=[[http://inova8.com/calc2graph/id/Equipment_1,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_2_1,DIRECT]\r\n" + "[http://inova8.com/calc2graph/id/Equipment_2_1,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_2_2,DIRECT]\r\n" + "[http://inova8.com/calc2graph/id/Equipment_2_2,http://inova8.com/calc2graph/def/connectedTo,http://inova8.com/calc2graph/id/Equipment_2_3,DIRECT]\r\n" + "]\r\n" + "", paths.toString());
    } catch (Exception e) {
        assertEquals("", e.getCause().getMessage());
        e.printStackTrace();
    }
}
Also used : PathResults(com.inova8.intelligentgraph.results.PathResults) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) Test(org.junit.jupiter.api.Test)

Aggregations

PathResults (com.inova8.intelligentgraph.results.PathResults)37 Order (org.junit.jupiter.api.Order)33 Test (org.junit.jupiter.api.Test)33 TestMethodOrder (org.junit.jupiter.api.TestMethodOrder)33 Thing (com.inova8.intelligentgraph.model.Thing)29 Path (com.inova8.intelligentgraph.path.Path)9 Resource (com.inova8.intelligentgraph.model.Resource)4 ResourceResults (com.inova8.intelligentgraph.results.ResourceResults)3 ArrayList (java.util.ArrayList)3 Graph (com.inova8.intelligentgraph.intelligentGraphRepository.Graph)2 IntelligentGraphRepository (com.inova8.intelligentgraph.intelligentGraphRepository.IntelligentGraphRepository)2 NullPath (com.inova8.intelligentgraph.path.NullPath)2 IRI (org.eclipse.rdf4j.model.IRI)2 Statement (org.eclipse.rdf4j.model.Statement)2 QueryEvaluationException (org.eclipse.rdf4j.query.QueryEvaluationException)2 SimpleDataset (org.eclipse.rdf4j.query.impl.SimpleDataset)2 Repository (org.eclipse.rdf4j.repository.Repository)2 RepositoryConnection (org.eclipse.rdf4j.repository.RepositoryConnection)2 RepositoryException (org.eclipse.rdf4j.repository.RepositoryException)2 Edge (com.inova8.intelligentgraph.path.Edge)1