Package org.apache.marmotta.kiwi.persistence

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



            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, false);

            // 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, false);
                connection.storeNode(subject, false);
                connection.storeNode(pred_1, false);
                connection.storeNode(pred_2, false);
                connection.storeNode(object_1, false);
                connection.storeNode(object_2, false);
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, false);
                connection.storeNode(subject, false);
                connection.storeNode(pred_1, false);
                connection.storeNode(pred_2, false);
                connection.storeNode(object_1, false);
                connection.storeNode(object_2, false);
                connection.storeNode(context, false);
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, false);
                connection.storeNode(subject, false);
                connection.storeNode(pred_1, false);
                connection.storeNode(pred_2, false);
                connection.storeNode(object_1, false);
                connection.storeNode(object_2, false);
                connection.storeNode(context, false);
View Full Code Here

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

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

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

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

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

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

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

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

                KiWiTriple triple1 = new KiWiTriple(subject,pred_1,object_1,context);
                KiWiTriple triple2 = new KiWiTriple(subject,pred_2,object_2,context);

                connection.storeTriple(triple1);
View Full Code Here

                            batchUriLookup.put(uri, result);

                            nodeBatch.add(result);

                        } else {
                            connection.storeNode(result, false);
                        }

                    }
                    if(result.getId() == null) {
                        log.error("node ID is null!");
View Full Code Here

                        if(batchCommit) {
                            result.setId(connection.getNodeId());
                            nodeBatch.add(result);
                            batchBNodeLookup.put(nodeID,result);
                        } else {
                            connection.storeNode(result, false);
                        }
                    }
                    if(result.getId() == null) {
                        log.error("node ID is null!");
                    }
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.