Package org.openrdf.repository.sail

Examples of org.openrdf.repository.sail.SailRepository.initialize()


    File file = new File(filename);
//    String encoding = EncodingDetector.detect(file);
//    String contents = EncodingDetector.getString(file, encoding);
   
    SailRepository myRepository = new SailRepository(new MemoryStore());
    myRepository.initialize();
    SailRepositoryConnection con = myRepository.getConnection();
    con.add(file, "", RDFFormat.TURTLE);
   
    RepositoryResult<Statement> result = con.getStatements(null, new URIImpl("http://isi.edu/integration/karma/dev#hasWorksheetHistory"), null, false);
    if(result.hasNext()) {
View Full Code Here


        try {
            Sail sail = new NativeStore();
            sail.setDataDir(dir);
            ((NativeStore) sail).setTripleIndexes("spoc,posc,opsc");
            Repository r = new SailRepository(sail);
            r.initialize();
            return new RepoSailTuple(r,sail);
        } catch (Exception e) {
            _logger.error("Exception caught while creating Sesame native repository", e);
            return null;
        }
View Full Code Here

    }
   
    Repository tempRepository = new SailRepository(new MemoryStore());
    RepositoryConnection conn = null;
    try {
      tempRepository.initialize();
      conn = tempRepository.getConnection();
    } catch (RepositoryException e1) {
      Global.log().warning("Failed to create repository for merging");
      return;
    }
View Full Code Here

        }
      }
     
      Repository repository = new SailRepository(
          new ForwardChainingRDFSInferencer(new MemoryStore()));
      repository.initialize();
      RepositoryConnection con = repository.getConnection();
      RDFFormat rdfFromat;
      if(format.equals("auto-detect")){
        rdfFromat = guessFormat(filename);
      }else if(format.equals("TTL")){
View Full Code Here

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

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

    URL url = new URL(MANIFEST_URL);
    con.add(url, MANIFEST_URL, RDFFormat.TURTLE);
View Full Code Here

    // 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

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.