Package org.openrdf.repository

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


    InputStream stream = urlCon.getInputStream();
    try {
      RepositoryConnection repCon = super.getConnection();
      try {
        repCon.setAutoCommit(false);
        repCon.clear(context);
        repCon.add(stream, url.toExternalForm(), format, context);
        repCon.commit();
        lastModified.put(url, modified);
      }
      finally {
View Full Code Here


    }

    queryResult.close();

    // Add the manifest for negative test cases to a repository and query it
    con.clear();
    url = TriGParserTest.class.getResource(MANIFEST_BAD_URL);
    con.add(url, url.toExternalForm(), RDFFormat.TURTLE);

    query = "SELECT testName, inputURL " + "FROM {} mf:name {testName}; "
        + "        mf:action {} qt:data {inputURL} " + "USING NAMESPACE "
View Full Code Here

      con.setAutoCommit(false);

      for (String id : repositoryIDs) {
        Resource context = getContext(con, id);
        if (context != null) {
          con.clear(context);
          con.remove(context, RDF.TYPE, REPOSITORY_CONTEXT);
          changed = true;
        }
      }
View Full Code Here

    HTTPRepository repo = (HTTPRepository)request.getSession().getAttribute(SessionKeys.REPOSITORY_KEY);
    RepositoryConnection conn = null;
    try {
      conn = repo.getConnection();
      conn.clear(toRemove.getContexts());
      conn.commit();
      logger.info("Clear committed.");
    }
    catch (RepositoryException e) {
      logger.warn("Unable to clear repository", e);
View Full Code Here

  {
    Repository systemRepo = new HTTPRepository(Protocol.getRepositoryLocation(SERVER_URL,
        SystemRepository.ID));
    RepositoryConnection con = systemRepo.getConnection();
    try {
      con.clear();
    }
    finally {
      con.close();
    }
View Full Code Here

    }

    queryResult.close();

    // Add the manifest for negative test cases to a repository and query it
    con.clear();
    url = TurtleParserTest.class.getResource(MANIFEST_BAD_URL);
    con.add(url, url.toExternalForm(), RDFFormat.TURTLE);

    query = "SELECT testName, inputURL " + "FROM {} mf:name {testName}; "
        + "        mf:action {} qt:data {inputURL} " + "USING NAMESPACE "
View Full Code Here

        boolean proceed = askProceed("WARNING: you are about to drop repository '" + id + "'.", true);
        if (proceed) {
          if (id.equals(repositoryID)) {
            closeRepository(false);
          }
          con.clear(context);
          writeln("Dropped repository '" + id + "'");
        }
        else {
          writeln("Drop aborted");
        }
View Full Code Here

    }

    try {
      RepositoryConnection con = repository.getConnection();
      try {
        con.clear(contexts);
      }
      finally {
        con.close();
      }
    }
View Full Code Here

    logger.info("Found {} sub-manifests", subManifestList.size());

    for (String subManifest : subManifestList) {
      logger.info("Loading sub manifest {}", subManifest);
      con.clear();

      URL subManifestURL = new URL(subManifest);
      rdfFormat = RDFFormat.forFileName(subManifest, RDFFormat.TURTLE);
      con.add(subManifestURL, subManifest, rdfFormat);
View Full Code Here

  protected Repository createRepository() throws Exception {
    Repository repository = newRepository();
    repository.initialize();
    RepositoryConnection con = repository.getConnection();
    con.clear();
    con.clearNamespaces();
    con.close();
    return repository;
  }
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.