Package org.openrdf.repository

Examples of org.openrdf.repository.RepositoryConnection.commit()


    RepositoryConnection con = repository.getConnection();
    con.setAutoCommit(false);

    // clear the input store
    con.clear();
    con.commit();

    // Upload input data
    InputStream stream = getClass().getResourceAsStream(inputData);
    try {
      con.add(stream, inputData, RDFFormat.NTRIPLES);
View Full Code Here


    // Upload input data
    InputStream stream = getClass().getResourceAsStream(inputData);
    try {
      con.add(stream, inputData, RDFFormat.NTRIPLES);
      con.commit();

      entailedStatements = Iterations.addAll(con.getStatements(null, null, null, true),
          new HashSet<Statement>());
    }
    finally {
View Full Code Here

    con.setAutoCommit(false);

    stream = getClass().getResourceAsStream(outputData);
    try {
      con.add(stream, outputData, RDFFormat.NTRIPLES);
      con.commit();

      expectedStatements = Iterations.addAll(con.getStatements(null, null, null, false),
          new HashSet<Statement>());
    }
    finally {
View Full Code Here

      String baseURI = url;
      RepositoryConnection conn = store.getConnection();
      InputStream is = myRDFData.openStream();
      conn.add(is, baseURI, format);
      is.close();
      conn.commit();
      conn.close();
    }
  }
 
  /**
 
View Full Code Here

    String baseURI = "";
    RepositoryConnection conn = m.getConnection();
    InputStream is = myRDFData.openStream();
    conn.add(is, baseURI, format);   
    is.close();
    conn.commit();
    conn.close();
  }
 
  //==============================================================================
  // Inner class definitions
View Full Code Here

      conn.setAutoCommit(false);
      while(it.hasNext()) {
        Statement s = it.next();
        conn.add(s.getSubject(), s.getPredicate(), s.getObject(), s.getContext());
      }
      conn.commit();
      conn.setAutoCommit(true);
      conn.close();
    } catch (RepositoryException sue) {
      System.err.println("Could not add to repository: " + sue);
      return null;
View Full Code Here

          }
          while (selects.hasNext()) {
            Statement selected = selects.next();
            RepositoryConnection mconn = this._model.getConnection();
            mconn.add(selected.getSubject(), selected.getPredicate(), selected.getObject(), selected.getContext());
            mconn.commit();
            mconn.close();
            URI predicate;

            boolean inverse = !selected.getSubject().equals(focus);
            Value object = inverse ? selected.getSubject() : selected.getObject();
View Full Code Here

              tmconn.setAutoCommit(false);
              while(types.hasNext()) {
                Statement s = types.next();
                tmconn.add(s.getSubject(), s.getPredicate(), s.getObject(), s.getContext());
              }
              tmconn.commit();
              tmconn.setAutoCommit(true);
              tmconn.close();
              if (selector instanceof PropertyDescription) {
                PropertyDescription selectorPD = (PropertyDescription) selector;
                if (current == max) {
View Full Code Here

      conn.setAutoCommit(false);
      while (it.hasNext()) {
        Statement s = it.next();
        conn.add(s.getSubject(), s.getPredicate(), s.getObject(), s.getContext());
      }
      conn.commit();
      conn.setAutoCommit(true);
      conn.close();
    } catch (RepositoryException sue) {
      System.err.println("Could not add to repository: " + sue);
      return null;
View Full Code Here

            Statement selected = selects.next();
            RepositoryConnection mconn = this._model.getConnection();
            mconn.add(FresnelUtilities.dupResource(selected.getSubject()),
                FresnelUtilities.dupURI(selected.getPredicate()),
                FresnelUtilities.dupValue(selected.getObject()));
            mconn.commit();
            mconn.close();
            URI prop = FresnelUtilities.dupURI(selected.getPredicate());
            Value object = selected.getObject();
            PropertyResult pr = r.getProperties().lookup(prop);
            if (null == pr) {
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.