Package com.google.refine.freebase.protograph

Examples of com.google.refine.freebase.protograph.Protograph


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


   
    @Override
    public void export(Project project, Properties options, Engine engine,
            Writer writer) throws IOException {
       
        Protograph protograph = (Protograph) project.overlayModels.get("freebaseProtograph");
        if (protograph != null) {
            TransposedNodeFactory nodeFactory = createNodeFactory(project, writer);
           
            Transposer.transpose(project, engine.getAllFilteredRows(),
                    protograph, protograph.getRootNode(0), nodeFactory, -1);
           
            nodeFactory.flush();
        }
    }
View Full Code Here

            response.setCharacterEncoding("UTF-8");
            response.setHeader("Content-Type", "application/json");
           
            String jsonString = request.getParameter("protograph");
            JSONObject json = ParsingUtilities.evaluateJsonStringToObject(jsonString);
            Protograph protograph = Protograph.reconstruct(json);
           
            StringBuffer sb = new StringBuffer(2048);
            sb.append("{ ");
           
            {
                StringWriter stringWriter = new StringWriter();
                TripleLoaderTransposedNodeFactory nodeFactory = new TripleLoaderTransposedNodeFactory(project, stringWriter);
               
                Transposer.transpose(project, filteredRows, protograph, protograph.getRootNode(0), nodeFactory);
                nodeFactory.flush();
               
                sb.append("\"tripleloader\" : ");
                sb.append(JSONObject.quote(stringWriter.toString()));
            }
           
            {
                StringWriter stringWriter = new StringWriter();
                MqlwriteLikeTransposedNodeFactory nodeFactory = new MqlwriteLikeTransposedNodeFactory(stringWriter);
               
                Transposer.transpose(project, filteredRows, protograph, protograph.getRootNode(0), nodeFactory);
                nodeFactory.flush();
               
                sb.append(", \"mqllike\" : ");
                sb.append(stringWriter.toString());
            }
View Full Code Here

            writer.write("oldProtograph="); writeProtograph(_oldProtograph, writer); writer.write('\n');
            writer.write("/ec/\n"); // end of change marker
        }
       
        static public Change load(LineNumberReader reader, Pool pool) throws Exception {
            Protograph oldProtograph = null;
            Protograph newProtograph = 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

TOP

Related Classes of com.google.refine.freebase.protograph.Protograph

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.