Package org.deri.grefine.rdf

Examples of org.deri.grefine.rdf.RdfSchema


            response.setCharacterEncoding("UTF-8");
            response.setHeader("Content-Type", "application/json");

            String jsonString = request.getParameter("schema");
            JSONObject json = ParsingUtilities.evaluateJsonStringToObject(jsonString);
            final RdfSchema schema = RdfSchema.reconstruct(json);
           
            RdfRowVisitor visitor = new RdfRowVisitor(schema) {
              final int limit = 10;
              int _count;
        @Override
        public boolean visit(Project project, int rowIndex, Row row) {
          if(_count>=limit){
                    return true;
                }
          for(Node root:roots){
            root.createNode(baseUri, factory, con, project, row, rowIndex,blanks);
          }
                _count +=1;
                return false;
        }
      };
     
            Repository model = RdfExporter.buildModel(project, engine, visitor);
            StringWriter sw = new StringWriter();
            try{
              RepositoryConnection con = model.getConnection();
              try{
                RDFWriter w = Rio.createWriter(RDFFormat.TURTLE, sw);
                for(Vocabulary v:schema.getPrefixesMap().values()){
                  w.handleNamespace(v.getName(), v.getUri());
                }
                con.export(w);
          }finally{
                con.close();
View Full Code Here


            writer.write("/ec/\n"); // end of change marker
        }
       
        static public Change load(LineNumberReader reader, Pool pool)
                throws Exception {
            RdfSchema oldSchema = null;
            RdfSchema newSchema = null;
           
            String line;
            while ((line = reader.readLine()) != null && !"/ec/".equals(line)) {
                int equal = line.indexOf('=');
                CharSequence field = line.subSequence(0, equal);
View Full Code Here

            }else{
                nodes = getRdfContext().getVocabularySearcher().searchClasses(query,projectId);
            }
           
            if(nodes.size()==0){
              RdfSchema schema = Util.getProjectSchema(getRdfContext(),getProject(request));
              nodes = search(schema,query);
            }
            for(SearchResultItem c:nodes){
                c.writeAsSearchResult(writer);
            }
View Full Code Here

        try {
            Project project = getProject(request);
           
            String jsonString = request.getParameter("schema");
            JSONObject json = ParsingUtilities.evaluateJsonStringToObject(jsonString);
            RdfSchema schema = RdfSchema.reconstruct(json);
           
            AbstractOperation op = new SaveRdfSchemaOperation(schema);
            Process process = op.createProcess(project, new Properties());
           
            performProcessAndRespond(request, response, project, process);
View Full Code Here

    return applicationContext;
  }
   
    public void export(Project project, Properties options, Engine engine,
            OutputStream outputStream) throws IOException {
      RdfSchema schema;
      try{
        schema = Util.getProjectSchema(applicationContext,project);
      }catch(VocabularyIndexException ve){
        throw new IOException("Unable to create index for RDF schema",ve);
      }
        Repository model = buildModel(project, engine, schema);
        try{
          RepositoryConnection con = model.getConnection();
          try{
            RDFWriter writer = Rio.createWriter(format, outputStream);
            for(Vocabulary v:schema.getPrefixesMap().values()){
              writer.handleNamespace(v.getName(), v.getUri());
            }
            con.export(writer);
      }finally{
            con.close();
View Full Code Here

    }

   
    public void export(Project project, Properties options, Engine engine,
            Writer writer) throws IOException {
      RdfSchema schema;
      try{
        schema = Util.getProjectSchema(applicationContext,project);
      }catch(VocabularyIndexException ve){
        throw new IOException("Unable to create index for RDF schema",ve);
      }
        Repository model = buildModel(project, engine, schema);
        try{
          RepositoryConnection con = model.getConnection();
          try{
            RDFWriter w = Rio.createWriter(format, writer);
            for(Vocabulary v:schema.getPrefixesMap().values()){
              w.handleNamespace(v.getName(),v.getUri());
            }
            con.export(w);
      }finally{
            con.close();
View Full Code Here

TOP

Related Classes of org.deri.grefine.rdf.RdfSchema

Copyright © 2018 www.massapicom. 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.