Package org.lab41.dendrite.metagraph

Examples of org.lab41.dendrite.metagraph.DendriteGraph


    @RequestMapping(value = "/api/graphs/{graphId}/analysis/jung/barycenter-distance", method = RequestMethod.POST)
    public ResponseEntity<Map<String, Object>> jungBarycenterDistance(@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/jung/betweenness-centrality", method = RequestMethod.POST)
    public ResponseEntity<Map<String, Object>> jungBetweennessCentrality(@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/jung/closeness-centrality", method = RequestMethod.POST)
    public ResponseEntity<Map<String, Object>> jungClosenessCentrality(@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/jung/eigenvector-centrality", method = RequestMethod.POST)
    public ResponseEntity<Map<String, Object>> jungEigenvectorCentrality(@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

            response.put("status", "error");
            response.put("msg", result.toString());
            return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST);
        }

        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

                "name:A",
                0);

        branchCommitSubsetJob.run();

        DendriteGraph dstGraph = metaGraph.getGraph(branchCommitSubsetJob.getDstGraphId());
        Assert.assertNotNull(dstGraph);

        DendriteGraphTx dstTx = dstGraph.newTransaction();

        try {
            Vertex dstAVertex = dstTx.getVertices("name", "A").iterator().next();
            Assert.assertNotNull(dstAVertex);
            Assert.assertEquals(dstAVertex.getProperty("name"), "A");
View Full Code Here

                "name:A",
                1);

        branchCommitSubsetJob.run();

        DendriteGraph dstGraph = metaGraph.getGraph(branchCommitSubsetJob.getDstGraphId());
        Assert.assertNotNull(dstGraph);

        DendriteGraphTx dstTx = dstGraph.newTransaction();

        try {
            Vertex dstAVertex = dstTx.getVertices("name", "A").iterator().next();
            Assert.assertNotNull(dstAVertex);
            Assert.assertEquals(dstAVertex.getProperty("name"), "A");
View Full Code Here

                "name:A",
                2);

        branchCommitSubsetJob.run();

        DendriteGraph dstGraph = metaGraph.getGraph(branchCommitSubsetJob.getDstGraphId());
        Assert.assertNotNull(dstGraph);

        DendriteGraphTx dstTx = dstGraph.newTransaction();

        try {
            Vertex dstAVertex = dstTx.getVertices("name", "A").iterator().next();
            Assert.assertNotNull(dstAVertex);
            Assert.assertEquals(dstAVertex.getProperty("name"), "A");
View Full Code Here

            GraphMetadata graphMetadata = tx.getGraph(graphId);
            if (graphMetadata == null) {
                throw new NotFound(GraphMetadata.class, graphId);
            }

            DendriteGraph graph = metaGraphService.getDendriteGraph(graphId);

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

            try {
                Map<Object, Object> verticesMap = new HashMap<>();
                Map<Object, Object> edgesMap = new HashMap<>();
View Full Code Here

                + " job " + jobId
                + " " + Thread.currentThread().getName());

        setJobState(jobId, JobMetadata.RUNNING);

        DendriteGraph srcGraph = metaGraph.getGraph(srcGraphId);
        DendriteGraph dstGraph = metaGraph.getGraph(dstGraphId);

        try {
            copyIndices(srcGraph, dstGraph);
            copyGraph(srcGraph, dstGraph);

            // Update the branch to point the new graph.
            MetaGraphTx tx = metaGraph.newTransaction();
            try {
                BranchMetadata branchMetadata = tx.getBranch(branchId);
                branchMetadata.setGraph(tx.getGraph(dstGraph.getId()));
                tx.commit();
            } catch (Throwable t) {
                tx.rollback();
                throw t;
            }
View Full Code Here

TOP

Related Classes of org.lab41.dendrite.metagraph.DendriteGraph

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.