Package org.apache.marmotta.kiwi.persistence

Examples of org.apache.marmotta.kiwi.persistence.KiWiConnection.storeNode()


        try {
            KiWiUriResource uri = new KiWiUriResource("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));

            // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiStringLiteral literal = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(8), null, uri);
            connection.storeNode(literal);

            // check if it then has a database ID
            Assert.assertNotNull(literal.getId());

            KiWiNode testLiteral1 = connection.loadNodeById(literal.getId());
View Full Code Here


            Random rnd = new Random();
            long value = rnd.nextLong();

                    // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiIntLiteral literal = new KiWiIntLiteral(value, uri);
            connection.storeNode(literal);

            // check if it then has a database ID
            Assert.assertNotNull(literal.getId());

            KiWiNode testLiteral1 = connection.loadNodeById(literal.getId());
View Full Code Here

            Random rnd = new Random();
            double value = rnd.nextDouble();

            // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiDoubleLiteral literal = new KiWiDoubleLiteral(value, uri);
            connection.storeNode(literal);

            // check if it then has a database ID
            Assert.assertNotNull(literal.getId());

            KiWiNode testLiteral1 = connection.loadNodeById(literal.getId());
View Full Code Here

            Random rnd = new Random();
            boolean value = rnd.nextBoolean();
            // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiBooleanLiteral literal = new KiWiBooleanLiteral(value, uri);
            connection.storeNode(literal);

            // check if it then has a database ID
            Assert.assertNotNull(literal.getId());

            KiWiNode testLiteral1 = connection.loadNodeById(literal.getId());
View Full Code Here


            Date value = new Date();
            // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiDateLiteral literal = new KiWiDateLiteral(value, uri);
            connection.storeNode(literal);

            // check if it then has a database ID
            Assert.assertNotNull(literal.getId());

            KiWiNode testLiteral1 = connection.loadNodeById(literal.getId());
View Full Code Here

                KiWiUriResource pred_2   = new KiWiUriResource("http://localhost/predicate/P2");
                KiWiUriResource object_1 = new KiWiUriResource("http://localhost/resource/"+RandomStringUtils.randomAlphanumeric(8));
                KiWiStringLiteral object_2 = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(32),null,stype);
                KiWiUriResource context  = new KiWiUriResource("http://localhost/context/"+RandomStringUtils.randomAlphanumeric(8));

                connection.storeNode(stype);
                connection.storeNode(subject);
                connection.storeNode(pred_1);
                connection.storeNode(pred_2);
                connection.storeNode(object_1);
                connection.storeNode(object_2);
View Full Code Here

                KiWiUriResource object_1 = new KiWiUriResource("http://localhost/resource/"+RandomStringUtils.randomAlphanumeric(8));
                KiWiStringLiteral object_2 = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(32),null,stype);
                KiWiUriResource context  = new KiWiUriResource("http://localhost/context/"+RandomStringUtils.randomAlphanumeric(8));

                connection.storeNode(stype);
                connection.storeNode(subject);
                connection.storeNode(pred_1);
                connection.storeNode(pred_2);
                connection.storeNode(object_1);
                connection.storeNode(object_2);
                connection.storeNode(context);
View Full Code Here

                KiWiStringLiteral object_2 = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(32),null,stype);
                KiWiUriResource context  = new KiWiUriResource("http://localhost/context/"+RandomStringUtils.randomAlphanumeric(8));

                connection.storeNode(stype);
                connection.storeNode(subject);
                connection.storeNode(pred_1);
                connection.storeNode(pred_2);
                connection.storeNode(object_1);
                connection.storeNode(object_2);
                connection.storeNode(context);
View Full Code Here

                KiWiUriResource context  = new KiWiUriResource("http://localhost/context/"+RandomStringUtils.randomAlphanumeric(8));

                connection.storeNode(stype);
                connection.storeNode(subject);
                connection.storeNode(pred_1);
                connection.storeNode(pred_2);
                connection.storeNode(object_1);
                connection.storeNode(object_2);
                connection.storeNode(context);

                KiWiTriple triple1 = new KiWiTriple(subject,pred_1,object_1,context);
View Full Code Here

                connection.storeNode(stype);
                connection.storeNode(subject);
                connection.storeNode(pred_1);
                connection.storeNode(pred_2);
                connection.storeNode(object_1);
                connection.storeNode(object_2);
                connection.storeNode(context);

                KiWiTriple triple1 = new KiWiTriple(subject,pred_1,object_1,context);
                KiWiTriple triple2 = new KiWiTriple(subject,pred_2,object_2,context);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.