Package org.lab41.dendrite.metagraph.models

Examples of org.lab41.dendrite.metagraph.models.UserMetadata$Id


        faunusPipelineService.configureGraph(faunusGraph, exportDir, graph);
        FaunusPipeline exportPipeline = new FaunusPipeline(faunusGraph);
        exportPipeline._();

        exportPipeline.done();
        FaunusJob faunusJob = new FaunusJob(metaGraphService.getMetaGraph(), jobId, exportPipeline);
        faunusJob.call();
    }
View Full Code Here


                                              @RequestBody String body) throws JSONException, UnsupportedEncodingException {

        HttpHeaders responseHeaders = new HttpHeaders();
        responseHeaders.setContentType(MediaType.APPLICATION_JSON);

        DendriteGraph graph = metaGraphService.getDendriteGraph(graphId);
        if (graph == null) {
            JSONObject json = new JSONObject();
            json.put("status", "error");
            json.put("msg", "unknown graph '" + graphId + "'");

            return new ResponseEntity<>(json.toString(), responseHeaders, HttpStatus.BAD_REQUEST);
        }

        Client client = graph.getElasticSearchClient();
        if (client == null) {
            JSONObject json = new JSONObject();
            json.put("status", "error");
            json.put("msg", "graph does not have graph elasticsearch index");

            return new ResponseEntity<>(json.toString(), responseHeaders, HttpStatus.BAD_REQUEST);
        }

        SearchResponse response = client.prepareSearch(graph.getIndexName())
                .setSource(body)
                .execute()
                .actionGet();

        return new ResponseEntity<>(response.toString(), responseHeaders, HttpStatus.OK);
View Full Code Here

    public ResponseEntity<Map<String, Object>> graphMapping(GraphMetadata.Id graphId) throws JSONException, IOException {

        Map<String, Object> response = new HashMap<>();

        DendriteGraph graph = metaGraphService.getDendriteGraph(graphId);
        if (graph == null) {
            response.put("status", "error");
            response.put("msg", "unknown graph '" + graphId + "'");

            return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST);
        }

        Client client = graph.getElasticSearchClient();
        if (client == null) {
            response.put("status", "error");
            response.put("msg", "graph does not have graph elasticsearch index");

            return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST);
        }

        MetaData metaData = client.admin().cluster().prepareState()
                .setFilterIndices(graph.getIndexName())
                .execute()
                .actionGet()
                .getState()
                .getMetaData();
View Full Code Here

            GraphMetadata graphMetadata = userMetadata.getGraph(new GraphMetadata.Id(graphId));
            if (graphMetadata == null) {
                return null;
            }

            DendriteGraph graph = metaGraphService.getDendriteGraph(graphId);
            if (graph == null) {
                return null;
            }

            List<String> allowableNamespaces = new ArrayList<>();
View Full Code Here

        if (result.hasErrors()) {
            return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
        }

        DendriteGraph graph = metaGraphService.getDendriteGraph(graphId);
        if (graph == null) {
            return new ResponseEntity<>(HttpStatus.NOT_FOUND);
        }

        logger.debug("exporting graph '" + graphId + "'");

        String format = item.getFormat();
        HttpHeaders headers = new HttpHeaders();
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

        DendriteGraphTx tx = graph.buildTransaction().readOnly().start();

        try {
            if (format.equalsIgnoreCase("GraphSON")) {
                headers.setContentType(new MediaType("application", "vnd.rexster+json"));
                headers.set("Content-Disposition", "attachment; filename=\"graph.json\"");
View Full Code Here

        } catch (Throwable t) {
            metaGraphTx.rollback();
            throw t;
        }

        DendriteGraph graph = metaGraphService.getDendriteGraph(graphId);
        if (graph == null) {
            response.put("status", "error");
            response.put("msg", "cannot find graph '" + graphId + "'");
            return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
        }

        logger.debug("saving graph '" + graphId + "'");

        // extract the storage location for the history
        String format = item.getFormat();

        DendriteGraphTx tx = graph.buildTransaction().readOnly().start();

        try {
            try {
                String path;
View Full Code Here

    @RequestMapping(value = "/api/graphs/{graphId}/analysis/{algorithm}", method = RequestMethod.POST)
    public ResponseEntity<Map<String, Object>> startJob(@PathVariable String graphId, @PathVariable String algorithm) throws Exception {

        Map<String, Object> response = new HashMap<>();

        DendriteGraph graph = metaGraphService.getDendriteGraph(graphId);
        if (graph == null) {
            response.put("status", "error");
            response.put("msg", "missing graph metadata '" + graphId + "'");
            return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
        }
View Full Code Here

    @RequestMapping(value = "/api/graphs/{graphId}/analysis/titan-degrees", method = RequestMethod.POST)
    public ResponseEntity<Map<String, Object>> startJob(@PathVariable String graphId) throws Exception {

        Map<String, Object> response = new HashMap<>();

        DendriteGraph graph = metaGraphService.getDendriteGraph(graphId);
        if (graph == null) {
            response.put("status", "error");
            response.put("msg", "missing graph metadata '" + graphId + "'");
            return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
        }
View Full Code Here

    @RequestMapping(value = "/api/graphs/{graphId}/analysis/faunus-degrees", method = RequestMethod.POST)
    public ResponseEntity<Map<String, Object>> startFaunusJob(@PathVariable String graphId) throws Exception {

        Map<String, Object> response = new HashMap<>();

        DendriteGraph graph = metaGraphService.getDendriteGraph(graphId);
        if (graph == null) {
            response.put("status", "error");
            response.put("msg", "missing graph metadata '" + graphId + "'");
            return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
        }
View Full Code Here

    @RequestMapping(value = "/api/graphs/{graphId}/analysis/snap/{algorithm}", method = RequestMethod.POST)
    public ResponseEntity<Map<String, Object>> startJob(@PathVariable String graphId, @PathVariable String algorithm) throws Exception {

        Map<String, Object> response = new HashMap<>();

        DendriteGraph graph = metaGraphService.getDendriteGraph(graphId);
        if (graph == null) {
            response.put("status", "error");
            response.put("msg", "missing graph metadata '" + graphId + "'");
            return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
        }
View Full Code Here

TOP

Related Classes of org.lab41.dendrite.metagraph.models.UserMetadata$Id

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.