Examples of VocabularyImporter


Examples of com.google.refine.rdf.vocab.VocabularyImporter

public class ImportPrefixTest {

  @Test
  public void testImportAndSeach()throws Exception{
    VocabularyImporter fakeImporter = new FakeImporter();
    VocabularySearcher searcher = new VocabularySearcher(new File("tmp"));
    searcher.importAndIndexVocabulary("foaf", "http://xmlns.com/foaf/0.1/", "http://xmlns.com/foaf/0.1/","1", fakeImporter);
   
    assertFalse(searcher.searchClasses("foaf:P", "1").isEmpty());
  }
View Full Code Here

Examples of org.deri.grefine.rdf.vocab.VocabularyImporter

      }
      con.add(in, "", rdfFromat);
      con.close();
     
      getRdfSchema(request).addPrefix(prefix, uri);
          getRdfContext().getVocabularySearcher().importAndIndexVocabulary(prefix, uri, repository, projectId, new VocabularyImporter());
          //success
          PrintWriter out = response.getWriter();
      out.print("<html><body><textarea>\n{\"code\":\"ok\"}\n</textarea></body></html>");
      out.flush();
    } catch (Exception e) {
View Full Code Here

Examples of org.deri.grefine.rdf.vocab.VocabularyImporter

      try {
        String name = tokenizer.nextToken();
        String uri = tokenizer.nextToken();
        String url = tokenizer.nextToken();
        //import and index
        this.applicationContext.getVocabularySearcher().importAndIndexVocabulary(name, uri,url, new VocabularyImporter());
        this.predefinedVocabulariesMap.put(name,new Vocabulary(name, uri));
      } catch (Exception e) {
        // predefined vocabularies are not defined properly
        // ignore the exception, just log it
        logger.warn("unable to add predefined vocabularies", e);
View Full Code Here

Examples of org.deri.grefine.rdf.vocab.VocabularyImporter

    String projectId = request.getParameter("project");
    getRdfSchema(request).removePrefix(name);
   
    getRdfContext().getVocabularySearcher().deleteTermsOfVocab(name, projectId);
    try{
      getRdfContext().getVocabularySearcher().importAndIndexVocabulary(name, uri, uri, projectId,new VocabularyImporter());
        } catch (PrefixExistException e) {
            respondException(response, e);
            return;
        } catch (Exception e){
          response.setCharacterEncoding("UTF-8");
View Full Code Here

Examples of org.deri.grefine.rdf.vocab.VocabularyImporter

          if(fetchOption.equals("web")){
            String fetchUrl = request.getParameter("fetch-url");
            if(fetchUrl==null || fetchOption.trim().isEmpty()){
              fetchUrl = uri;
            }
            getRdfContext().getVocabularySearcher().importAndIndexVocabulary(name, uri, fetchUrl, projectId,new VocabularyImporter());
          }
            respondJSON(response, new Jsonizable() {
               
                @Override
                public void write(JSONWriter writer, Properties options)
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.