Search in sources :

Example 16 with PathResults

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

the class Local_TFL_GetPath_Tests method test_5.

/**
 * Test 5.
 */
@Test
@Order(5)
void test_5() {
    try {
        Thing _this = source.getThing("londontube:Mornington_Crescent");
        PathResults paths = _this.getPaths(":online{1,3}/:hasStationOnLine[eq londontube:Oakleigh_Park]");
        assertEquals("", paths.toString());
    } catch (Exception e) {
        assertEquals("", e.getMessage());
        e.printStackTrace();
    }
}
Also used : 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 17 with PathResults

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

the class Local_TutorialTests method test_7.

/**
 * Test 7.
 */
@SuppressWarnings("resource")
@Test
@Order(7)
void test_7() {
    try {
        Repository workingRep = Query.createNativeLuceneIntelligentGraphRepository("src/test/resources/datadir/Local_TutorialTests7/");
        RepositoryConnection conn = workingRep.getConnection();
        conn.setNamespace("", "http://inova8.com/intelligentgraph/example7/");
        conn.setNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
        conn.setNamespace("rdfs", "http://www.w3.org/2000/01/rdf-schema#");
        IntelligentGraphRepository source = IntelligentGraphRepository.create(workingRep);
        source.removeGraph("<http://inova8.com/intelligentgraph/example7>");
        Graph graph = source.addGraph("<http://inova8.com/intelligentgraph/example7>");
        Thing aPerson = graph.getThing(":aPerson");
        Thing Another1 = graph.getThing(":Another1");
        Thing Another2 = graph.getThing(":Another2");
        Thing Another3 = graph.getThing(":Another3");
        Thing Another4 = graph.getThing(":Another4");
        Thing Another5 = graph.getThing(":Another5");
        Thing Another6 = graph.getThing(":Another6");
        Thing Another7 = graph.getThing(":Another7");
        Thing Another8 = graph.getThing(":Another8");
        Thing Another9 = graph.getThing(":Another9");
        Thing Another10 = graph.getThing(":Another10");
        Thing Another11 = graph.getThing(":Another11");
        Thing Another12 = graph.getThing(":Another12");
        Thing Location = graph.getThing(":Location");
        Thing Maidstone = graph.getThing(":Maidstone").addFact(RDF.TYPE, Location);
        Thing Tideswell = graph.getThing(":Tideswell").addFact(RDF.TYPE, Location);
        Thing Gender = graph.getThing(":Gender");
        Thing Male = graph.getThing(":Male").addFact(RDF.TYPE, Gender);
        Thing Female = graph.getThing(":Female").addFact(RDF.TYPE, Gender);
        Thing Person = graph.getThing(":Person");
        aPerson.addFact(RDF.TYPE, Person).addFact(":hasHeight", "1.7", XSD.DOUBLE).addFact(":hasWeight", "62", XSD.DOUBLE).addFact(":hasLocation", Tideswell).addFact(":hasGender", Male).addFact(":hasParent", Another1).addFact(":hasParent", Another3);
        Another1.addFact(RDF.TYPE, Person).addFact(":hasHeight", "1.9", XSD.DOUBLE).addFact(":hasWeight", "72", XSD.DOUBLE).addFact(":hasLocation", Tideswell).addFact(":hasGender", Male).addFact(":hasParent", Another2);
        Another2.addFact(RDF.TYPE, Person).addFact(":hasHeight", "1.7", XSD.DOUBLE).addFact(":hasWeight", "65", XSD.DOUBLE).addFact(":hasLocation", Maidstone).addFact(":hasGender", Male);
        Another3.addFact(RDF.TYPE, Person).addFact(":hasHeight", "2", XSD.DOUBLE).addFact(":hasWeight", "59", XSD.DOUBLE).addFact(":hasLocation", Maidstone).addFact(":hasGender", Female).addFact(":hasParent", Another4);
        Another4.addFact(RDF.TYPE, Person).addFact(":hasHeight", "1.8", XSD.DOUBLE).addFact(":hasWeight", "47", XSD.DOUBLE).addFact(":hasLocation", Maidstone).addFact(":hasGender", Male).addFact(":hasParent", Another5).addFact(":hasParent", Another6);
        Another5.addFact(RDF.TYPE, Person).addFact(":hasHeight", "1.5", XSD.DOUBLE).addFact(":hasWeight", "70", XSD.DOUBLE).addFact(":hasLocation", Maidstone).addFact(":hasGender", Female);
        Another6.addFact(RDF.TYPE, Person).addFact(":hasHeight", "1.5", XSD.DOUBLE).addFact(":hasWeight", "56", XSD.DOUBLE).addFact(":hasLocation", Maidstone).addFact(":hasGender", Male);
        Another7.addFact(RDF.TYPE, Person).addFact(":hasHeight", "1.7", XSD.DOUBLE).addFact(":hasWeight", "63", XSD.DOUBLE).addFact(":hasLocation", Maidstone).addFact(":hasGender", Female).addFact(":hasParent", Another5).addFact(":hasParent", Another8).addFact(":hasParent", Another9);
        Another8.addFact(RDF.TYPE, Person).addFact(":hasHeight", "1.6", XSD.DOUBLE).addFact(":hasWeight", "66", XSD.DOUBLE).addFact(":hasLocation", Maidstone).addFact(":hasGender", Male);
        Another9.addFact(RDF.TYPE, Person).addFact(":hasHeight", "1.7", XSD.DOUBLE).addFact(":hasWeight", "46", XSD.DOUBLE).addFact(":hasLocation", Maidstone).addFact(":hasGender", Female).addFact(":hasParent", Another10).addFact(":hasParent", Another11).addFact(":hasParent", Another12);
        Another10.addFact(RDF.TYPE, Person).addFact(":hasHeight", "1.9", XSD.DOUBLE).addFact(":hasWeight", "61", XSD.DOUBLE).addFact(":hasLocation", Tideswell).addFact(":hasGender", Female);
        Another11.addFact(RDF.TYPE, Person).addFact(":hasHeight", "1.5", XSD.DOUBLE).addFact(":hasWeight", "61", XSD.DOUBLE).addFact(":hasLocation", Tideswell).addFact(":hasGender", Male);
        Another11.addFact(RDF.TYPE, Person).addFact(":hasHeight", "1.8", XSD.DOUBLE).addFact(":hasWeight", "75", XSD.DOUBLE).addFact(":hasLocation", Tideswell).addFact(":hasGender", Female);
        assertEquals("http://inova8.com/intelligentgraph/example7/aPerson", aPerson.stringValue());
        assertEquals("http://inova8.com/intelligentgraph/example7/Another3", aPerson.getFact(":hasParent[:hasGender :Female]").stringValue());
        assertEquals("http://inova8.com/intelligentgraph/example7/Another3", aPerson.getFact(":hasParent[:hasLocation :Maidstone]").stringValue());
        assertEquals("http://inova8.com/intelligentgraph/example7/Another3", aPerson.getFact(":hasParent{0,4}/:hasParent[:hasGender :Female]").stringValue());
        assertEquals("[ {s=http://inova8.com/intelligentgraph/example7/aPerson, p=http://inova8.com/intelligentgraph/example7/hasParent, o=http://inova8.com/intelligentgraph/example7/Another3}; {s=http://inova8.com/intelligentgraph/example7/Another4, p=http://inova8.com/intelligentgraph/example7/hasParent, o=http://inova8.com/intelligentgraph/example7/Another5};]", aPerson.getFacts(":hasParent{0,4}/:hasParent[:hasGender :Female]").toString());
        assertEquals("[ {s=http://inova8.com/intelligentgraph/example7/aPerson, p=http://inova8.com/intelligentgraph/example7/hasParent, o=http://inova8.com/intelligentgraph/example7/Another3}; {s=http://inova8.com/intelligentgraph/example7/Another1, p=http://inova8.com/intelligentgraph/example7/hasParent, o=http://inova8.com/intelligentgraph/example7/Another2}; {s=http://inova8.com/intelligentgraph/example7/Another3, p=http://inova8.com/intelligentgraph/example7/hasParent, o=http://inova8.com/intelligentgraph/example7/Another4}; {s=http://inova8.com/intelligentgraph/example7/Another4, p=http://inova8.com/intelligentgraph/example7/hasParent, o=http://inova8.com/intelligentgraph/example7/Another5}; {s=http://inova8.com/intelligentgraph/example7/Another4, p=http://inova8.com/intelligentgraph/example7/hasParent, o=http://inova8.com/intelligentgraph/example7/Another6};]", aPerson.getFacts(":hasParent{0,4}/:hasParent[:hasLocation :Maidstone]").toString());
        PathResults paths = aPerson.getPaths(":hasParent{0,4}/:hasParent[:hasGender :Female]");
        assertEquals("Path=[[http://inova8.com/intelligentgraph/example7/aPerson,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another3,DIRECT]\r\n" + "]\r\n" + "Path=[[http://inova8.com/intelligentgraph/example7/aPerson,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another3,DIRECT]\r\n" + "[http://inova8.com/intelligentgraph/example7/Another3,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another4,DIRECT]\r\n" + "[http://inova8.com/intelligentgraph/example7/Another4,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another5,DIRECT]\r\n" + "]\r\n" + "", paths.toString());
        paths = aPerson.getPaths(":hasParent{0,4}/:hasParent[:hasLocation :Maidstone]");
        String pathString = "";
        for (Path path : paths) {
            pathString += "Path" + "\n";
            for (Edge edge : path) {
                pathString += edge.toString() + "\n";
            }
        }
        assertEquals("Path\n" + "[http://inova8.com/intelligentgraph/example7/aPerson,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another3,DIRECT]\n" + "Path\n" + "[http://inova8.com/intelligentgraph/example7/aPerson,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another1,DIRECT]\n" + "[http://inova8.com/intelligentgraph/example7/Another1,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another2,DIRECT]\n" + "Path\n" + "[http://inova8.com/intelligentgraph/example7/aPerson,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another3,DIRECT]\n" + "[http://inova8.com/intelligentgraph/example7/Another3,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another4,DIRECT]\n" + "Path\n" + "[http://inova8.com/intelligentgraph/example7/aPerson,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another3,DIRECT]\n" + "[http://inova8.com/intelligentgraph/example7/Another3,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another4,DIRECT]\n" + "[http://inova8.com/intelligentgraph/example7/Another4,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another5,DIRECT]\n" + "Path\n" + "[http://inova8.com/intelligentgraph/example7/aPerson,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another3,DIRECT]\n" + "[http://inova8.com/intelligentgraph/example7/Another3,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another4,DIRECT]\n" + "[http://inova8.com/intelligentgraph/example7/Another4,http://inova8.com/intelligentgraph/example7/hasParent,http://inova8.com/intelligentgraph/example7/Another6,DIRECT]\n" + "", pathString);
        @SuppressWarnings("unused") Thing BMI = graph.getThing(":BMI").addFact(SCRIPT.SCRIPTCODE, "height=_this.getFact(':hasHeight').doubleValue(); _this.getFact(':hasWeight').doubleValue()/(height*height)", SCRIPT.GROOVY);
        @SuppressWarnings("unused") Thing familialRelativeBMI = graph.getThing(":FamilialRelativeBMI").addFact(SCRIPT.SCRIPTCODE, "_this.getFact(':hasBMI').doubleValue()/_this.getFacts(':hasParent{0,4}/:hasBMI').average();", SCRIPT.GROOVY);
        for (Resource person : graph.getThing(":Person").getFacts("^rdf:type")) {
            ((Thing) person).addFact(":hasBMI", "<:BMI>", SCRIPT.GROOVY).addFact(":hasFamilialRelativeBMI", "<:FamilialRelativeBMI>", SCRIPT.GROOVY);
        }
        assertEquals(1.006889937409004, aPerson.getFact(":hasFamilialRelativeBMI").doubleValue());
    } catch (Exception e) {
        assertEquals("", e.getCause().getMessage());
    }
}
Also used : RepositoryConnection(org.eclipse.rdf4j.repository.RepositoryConnection) Path(com.inova8.intelligentgraph.path.Path) Repository(org.eclipse.rdf4j.repository.Repository) IntelligentGraphRepository(com.inova8.intelligentgraph.intelligentGraphRepository.IntelligentGraphRepository) IntelligentGraphRepository(com.inova8.intelligentgraph.intelligentGraphRepository.IntelligentGraphRepository) Graph(com.inova8.intelligentgraph.intelligentGraphRepository.Graph) Resource(com.inova8.intelligentgraph.model.Resource) PathResults(com.inova8.intelligentgraph.results.PathResults) Edge(com.inova8.intelligentgraph.path.Edge) 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 18 with PathResults

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

the class Local_PathTutorialTests method test_1.

/**
 * Test 1.
 */
@Test
@Order(1)
void test_1() {
    try {
        Repository workingRep = Query.createNativeLuceneIntelligentGraphRepository("src/test/resources/datadir/Local_PathTutorialTests1/");
        RepositoryConnection conn = workingRep.getConnection();
        conn.setNamespace("", "http://inova8.com/intelligentgraph/path1/");
        conn.setNamespace(XSD.PREFIX, XSD.NAMESPACE);
        conn.setNamespace(RDF.PREFIX, RDF.NAMESPACE);
        conn.setNamespace(RDFS.PREFIX, RDFS.NAMESPACE);
        conn.setNamespace(OWL.PREFIX, OWL.NAMESPACE);
        IntelligentGraphRepository source = IntelligentGraphRepository.create(workingRep);
        source.removeGraph("<http://inova8.com/intelligentgraph/path1>");
        Graph graph = source.addGraph("<http://inova8.com/intelligentgraph/path1>");
        Thing aPerson = graph.getThing(":aPerson");
        Thing Another1 = graph.getThing(":Another1");
        Thing Another2 = graph.getThing(":Another2");
        Thing Another3 = graph.getThing(":Another3");
        Thing Another4 = graph.getThing(":Another4");
        Thing Another5 = graph.getThing(":Another5");
        Thing Another6 = graph.getThing(":Another6");
        Thing Another7 = graph.getThing(":Another7");
        Thing Another8 = graph.getThing(":Another8");
        Thing Another9 = graph.getThing(":Another9");
        Thing Another10 = graph.getThing(":Another10");
        Thing Another11 = graph.getThing(":Another11");
        Thing Another12 = graph.getThing(":Another12");
        Thing Location = graph.getThing(":Location");
        Thing Maidstone = graph.getThing(":Maidstone").addFact(RDF.TYPE, Location);
        Thing Tideswell = graph.getThing(":Tideswell").addFact(RDF.TYPE, Location);
        Thing Gender = graph.getThing(":Gender");
        Thing Male = graph.getThing(":Male").addFact(RDF.TYPE, Gender);
        Thing Female = graph.getThing(":Female").addFact(RDF.TYPE, Gender);
        Thing Person = graph.getThing(":Person");
        aPerson.addFact(RDF.TYPE, Person).addFact(":hasLocation", Tideswell).addFact(":hasGender", Male).addFact(":hasParent", Another1).addFact(":hasParent", Another3);
        Another1.addFact(RDF.TYPE, Person).addFact(":hasLocation", Tideswell).addFact(":hasGender", Male).addFact(":hasParent", Another2);
        Another2.addFact(RDF.TYPE, Person).addFact(":hasLocation", Maidstone).addFact(":hasGender", Male);
        Another3.addFact(RDF.TYPE, Person).addFact(":hasLocation", Maidstone).addFact(":hasGender", Female).addFact(":hasParent", Another4);
        Another4.addFact(RDF.TYPE, Person).addFact(":hasLocation", Maidstone).addFact(":hasGender", Male).addFact(":hasParent", Another5).addFact(":hasParent", Another6);
        Another5.addFact(RDF.TYPE, Person).addFact(":hasLocation", Maidstone).addFact(":hasGender", Female);
        Another6.addFact(RDF.TYPE, Person).addFact(":hasLocation", Maidstone).addFact(":hasGender", Male);
        Another7.addFact(RDF.TYPE, Person).addFact(":hasLocation", Maidstone).addFact(":hasGender", Female).addFact(":hasParent", Another5).addFact(":hasParent", Another8).addFact(":hasParent", Another9);
        Another8.addFact(RDF.TYPE, Person).addFact(":hasLocation", Maidstone).addFact(":hasGender", Male);
        Another9.addFact(RDF.TYPE, Person).addFact(":hasLocation", Maidstone).addFact(":hasGender", Female).addFact(":hasParent", Another10).addFact(":hasParent", Another11).addFact(":hasParent", Another12);
        Another10.addFact(RDF.TYPE, Person).addFact(":hasLocation", Tideswell).addFact(":hasGender", Female);
        Another11.addFact(RDF.TYPE, Person).addFact(":hasLocation", Tideswell).addFact(":hasGender", Male);
        Another12.addFact(RDF.TYPE, Person).addFact(":hasLocation", Tideswell).addFact(":hasGender", Female);
        // assertEquals("http://inova8.com/intelligentgraph/path1/aPerson", aPerson.stringValue());
        // assertEquals("http://inova8.com/intelligentgraph/path1/Another3", aPerson.getFact(":hasParent[:hasGender :Female]").stringValue());
        // assertEquals("http://inova8.com/intelligentgraph/path1/Another3", aPerson.getFact(":hasParent[:hasLocation :Maidstone]").stringValue());
        assertEquals("http://inova8.com/intelligentgraph/path1/Another3", aPerson.getFact(":hasParent{0,4}/:hasParent[:hasGender :Female]").stringValue());
        assertEquals("[ {s=http://inova8.com/intelligentgraph/path1/aPerson, p=http://inova8.com/intelligentgraph/path1/hasParent, o=http://inova8.com/intelligentgraph/path1/Another3}; {s=http://inova8.com/intelligentgraph/path1/Another4, p=http://inova8.com/intelligentgraph/path1/hasParent, o=http://inova8.com/intelligentgraph/path1/Another5};]", aPerson.getFacts(":hasParent{0,4}/:hasParent[:hasGender :Female]").toString());
        // PathElement element = PathParser.parsePathPattern(aPerson, ":hasParent[:hasGender :Female]{1,4}");
        // assertEquals ("<http://inova8.com/intelligentgraph/path1/hasParent>[<http://inova8.com/intelligentgraph/path1/hasGender> <http://inova8.com/intelligentgraph/path1/Female> ]{1,4}" , element.toString());
        // assertEquals ("{0=1, 1=2, 2=3, 3=4}",element.getIterations().toString());
        // PathResults paths =  aPerson.getPaths(":hasParent[:hasGender :Female]{1,4}");
        // String pathString ="";
        // for (Path path : paths) {
        // pathString +=path.toString();
        // }
        // assertEquals("Path=[[http://inova8.com/intelligentgraph/path1/aPerson,http://inova8.com/intelligentgraph/path1/hasParent,http://inova8.com/intelligentgraph/path1/Another3,INVERSE]\r\n"
        // + "]\r\n"
        // + "", pathString);
        // assertEquals("Path=[[http://inova8.com/intelligentgraph/path1/aPerson,http://inova8.com/intelligentgraph/path1/hasParent,http://inova8.com/intelligentgraph/path1/Another3,INVERSE]\r\n"
        // + "]\r\n"
        // + "", paths.toString());
        // paths =  aPerson.getPaths(":hasParent{1,4}/:hasParent[:hasGender :Female]");
        // assertEquals("Path=[[http://inova8.com/intelligentgraph/path1/aPerson,http://inova8.com/intelligentgraph/path1/hasParent,http://inova8.com/intelligentgraph/path1/Another3,INVERSE]\r\n"
        // + "[http://inova8.com/intelligentgraph/path1/Another3,http://inova8.com/intelligentgraph/path1/hasParent,http://inova8.com/intelligentgraph/path1/Another4,INVERSE]\r\n"
        // + "[http://inova8.com/intelligentgraph/path1/Another4,http://inova8.com/intelligentgraph/path1/hasParent,http://inova8.com/intelligentgraph/path1/Another5,INVERSE]\r\n"
        // + "]\r\n"
        // + "", paths.toString());
        PathResults paths = aPerson.getPaths(":hasParent{0,4}/:hasParent[:hasGender :Female]");
        assertEquals("Path=[[http://inova8.com/intelligentgraph/path1/aPerson,http://inova8.com/intelligentgraph/path1/hasParent,http://inova8.com/intelligentgraph/path1/Another3,DIRECT]\r\n" + "]\r\n" + "Path=[[http://inova8.com/intelligentgraph/path1/aPerson,http://inova8.com/intelligentgraph/path1/hasParent,http://inova8.com/intelligentgraph/path1/Another3,DIRECT]\r\n" + "[http://inova8.com/intelligentgraph/path1/Another3,http://inova8.com/intelligentgraph/path1/hasParent,http://inova8.com/intelligentgraph/path1/Another4,DIRECT]\r\n" + "[http://inova8.com/intelligentgraph/path1/Another4,http://inova8.com/intelligentgraph/path1/hasParent,http://inova8.com/intelligentgraph/path1/Another5,DIRECT]\r\n" + "]\r\n" + "", paths.toString());
    } catch (Exception e) {
        assertEquals("", e.getCause().getMessage());
        fail();
    }
}
Also used : RepositoryConnection(org.eclipse.rdf4j.repository.RepositoryConnection) Repository(org.eclipse.rdf4j.repository.Repository) IntelligentGraphRepository(com.inova8.intelligentgraph.intelligentGraphRepository.IntelligentGraphRepository) IntelligentGraphRepository(com.inova8.intelligentgraph.intelligentGraphRepository.IntelligentGraphRepository) Graph(com.inova8.intelligentgraph.intelligentGraphRepository.Graph) 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 19 with PathResults

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

the class Local_MMS_GetPath_Tests method test_2.

/**
 * Test 2.
 */
@Test
@Order(2)
void test_2() {
    try {
        Thing _this = source.getThing("mms_ext:Sensitive_PII");
        PathResults paths = _this.getPaths("^mms_ext:dataElementSensitivity/(^mms_ext:isDerivedFrom){1,5}/mms:context[eq sakila:dataset.customer_list]");
        assertEquals("Path=[[http://in4mium.com/masterdatakg/schema/mms-ext#Sensitive_PII,http://in4mium.com/masterdatakg/schema/mms-ext#dataElementSensitivity,http://in4mium.com/masterdatakg/mms/id/sakila/column.customer.first_name,INVERSE]\r\n" + "[http://in4mium.com/masterdatakg/mms/id/sakila/column.customer.first_name,http://in4mium.com/masterdatakg/schema/mms-ext#isDerivedFrom,http://in4mium.com/masterdatakg/mms/id/sakila/column.customer_list.name,INVERSE]\r\n" + "[http://in4mium.com/masterdatakg/mms/id/sakila/column.customer_list.name,http://rdf.cdisc.org/mms#context,http://in4mium.com/masterdatakg/mms/id/sakila/dataset.customer_list,DIRECT]\r\n" + "]\r\n" + "Path=[[http://in4mium.com/masterdatakg/schema/mms-ext#Sensitive_PII,http://in4mium.com/masterdatakg/schema/mms-ext#dataElementSensitivity,http://in4mium.com/masterdatakg/mms/id/sakila/column.customer.last_name,INVERSE]\r\n" + "[http://in4mium.com/masterdatakg/mms/id/sakila/column.customer.last_name,http://in4mium.com/masterdatakg/schema/mms-ext#isDerivedFrom,http://in4mium.com/masterdatakg/mms/id/sakila/column.customer_list.name,INVERSE]\r\n" + "[http://in4mium.com/masterdatakg/mms/id/sakila/column.customer_list.name,http://rdf.cdisc.org/mms#context,http://in4mium.com/masterdatakg/mms/id/sakila/dataset.customer_list,DIRECT]\r\n" + "]\r\n" + "", paths.toString());
    } catch (Exception e) {
        assertEquals("", e.getMessage());
        e.printStackTrace();
    }
}
Also used : 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 20 with PathResults

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

the class Local_MMS_GetPath_Tests method test_1.

/**
 * Test 1.
 */
@Test
@Order(1)
void test_1() {
    try {
        Thing _this = source.getThing("sakila:column.customer_list.SID");
        PathResults paths = _this.getPaths("mms:context");
        assertEquals("Path=[[http://in4mium.com/masterdatakg/mms/id/sakila/column.customer_list.SID,http://rdf.cdisc.org/mms#context,http://in4mium.com/masterdatakg/mms/id/sakila/dataset.customer_list,DIRECT]\r\n" + "]\r\n" + "", paths.toString());
    } catch (Exception e) {
        assertEquals("", e.getMessage());
        e.printStackTrace();
    }
}
Also used : 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)

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