Package org.apache.marmotta.kiwi.persistence

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


                            result.setId(connection.getNodeId());
                            batchLiteralLookup.put(key, result);

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

                    return result;
View Full Code Here


            KiWiUriResource result = connection.loadUriResource(uri);

            if(result == null) {
                result = new KiWiUriResource(uri);

                connection.storeNode(result);

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

            KiWiAnonResource result = connection.loadAnonResource(nodeID);

            if(result == null) {
                result = new KiWiAnonResource(nodeID);

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

                }

            }

            if(result.getId() < 0) {
                connection.storeNode(result);
            }

            return result;

View Full Code Here

            // is still volatile
            KiWiUriResource result = connection.loadUriResource(uri);

            if(result == null) {
                result = new KiWiUriResource(uri);
                connection.storeNode(result);
            }

            return result;
        } catch (SQLException e) {
            log.error("database error, could not load URI resource",e);
View Full Code Here

            // is still volatile
            KiWiAnonResource result = connection.loadAnonResource(nodeID);

            if(result == null) {
                result = new KiWiAnonResource(nodeID);
                connection.storeNode(result);
            }

            return result;
        } catch (SQLException e) {
            log.error("database error, could not load anonymous resource",e);
View Full Code Here

                    result = new KiWiStringLiteral(value.toString(), locale, rtype);
                }
            }

            if(result.getId() == null) {
                connection.storeNode(result);
            }

            return result;

        } catch (SQLException e) {
View Full Code Here

            KiWiUriResource   stype   = new KiWiUriResource(Namespaces.NS_XSD+"string");
            connection.storeNode(stype);

            // 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,stype);
            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

    @Test
    public void testStoreStringLiteralLanguage() throws SQLException {
        KiWiConnection connection = persistence.getConnection();
        try {
            KiWiUriResource   stype   = new KiWiUriResource(getRDFLangStringType());
            connection.storeNode(stype);

            // 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), Locale.ENGLISH, stype);
            connection.storeNode(literal);
View Full Code Here

            KiWiUriResource   stype   = new KiWiUriResource(getRDFLangStringType());
            connection.storeNode(stype);

            // 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), Locale.ENGLISH, stype);
            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

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.