Package org.openrdf.repository

Examples of org.openrdf.repository.Repository.initialize()


    // Create test suite
    TestSuite suite = new TestSuite();

    // Add the manifest for positive test cases to a repository and query it
    Repository repository = new SailRepository(new MemoryStore());
    repository.initialize();
    RepositoryConnection con = repository.getConnection();

    URL url = TriGParserTest.class.getResource(MANIFEST_GOOD_URL);
    con.add(url, url.toExternalForm(), RDFFormat.TURTLE);
View Full Code Here


  public static Test suite()
    throws Exception
  {
    // Create an RDF repository for the manifest data
    Repository repository = new SailRepository(new MemoryStore());
    repository.initialize();
    RepositoryConnection con = repository.getConnection();

    // Add W3C's manifest
    URL w3cManifest = resolveURL(W3C_MANIFEST_FILE);
    con.add(w3cManifest, W3C_MANIFEST_FILE, RDFFormat.RDFXML);
View Full Code Here

    String baseURL = NTRIPLES_TEST_URL;
    suite.addTest(new PositiveParserTest(testName, inputURL, outputURL, baseURL));

    // Add the manifest for positive test cases to a repository and query it
    Repository repository = new SailRepository(new MemoryStore());
    repository.initialize();
    RepositoryConnection con = repository.getConnection();

    url = TurtleParserTest.class.getResource(MANIFEST_GOOD_URL);
    con.add(url, url.toExternalForm(), RDFFormat.TURTLE);
View Full Code Here

     *@param locationPath an alternative local path where the ontology can be found (null if none); cam be given as a relative path
     */
    public void addOntology(String docURI, String locationPath){
  Repository r = new SailRepository(new MemoryStore());
  try {
      r.initialize();
      RepositoryConnection c = r.getConnection();
      if (DEBUG){
    System.out.println("Retrieving ontology "+docURI);
      }
      try {
View Full Code Here

  public void testWrite()
    throws RepositoryException, RDFParseException, IOException, RDFHandlerException
  {
    Repository rep1 = new SailRepository(new MemoryStore());
    rep1.initialize();

    RepositoryConnection con1 = rep1.getConnection();

    URL ciaScheme = this.getClass().getResource("/cia-factbook/CIA-onto-enhanced.rdf");
    URL ciaFacts = this.getClass().getResource("/cia-factbook/CIA-facts-enhanced.rdf");
View Full Code Here

    con1.export(rdfWriter);

    con1.close();

    Repository rep2 = new SailRepository(new MemoryStore());
    rep2.initialize();

    RepositoryConnection con2 = rep2.getConnection();

    con2.add(new StringReader(writer.toString()), "foo:bar", RDFFormat.RDFXML);
    con2.close();
View Full Code Here

  {
    TestSuite suite = new TestSuite();

    // Read manifest and create declared test cases
    Repository manifestRep = new SailRepository(new MemoryStore());
    manifestRep.initialize();

    RepositoryConnection con = manifestRep.getConnection();

    logger.debug("Loading manifest data");
    URL manifest = new URL(MANIFEST_FILE);
View Full Code Here

  protected Repository createRepository()
    throws RepositoryException
  {
    Repository dataRep = new DatasetRepository(new SailRepository(new MemoryStore()));
    dataRep.initialize();
    return dataRep;
  }

  @Override
  protected void tearDown()
View Full Code Here

    TestSuite suite = new TestSuite();

    // Read manifest and create declared test cases
    Repository manifestRep = new SailRepository(new MemoryStore());
    manifestRep.initialize();
    RepositoryConnection con = manifestRep.getConnection();

    con.add(new URL(manifestFileURL), manifestFileURL, RDFFormat.TURTLE);

    suite.setName(getManifestName(manifestRep, con, manifestFileURL));
View Full Code Here

    assertEquals(null, operator, compare(term1, term2));
  }

  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.