Examples of RexsterApplicationGraph


Examples of com.tinkerpop.rexster.RexsterApplicationGraph

        configureScriptEngine();
    }

    @Override
    public Graph getGraph(String id) {
        RexsterApplicationGraph graph = getApplicationGraph(id);
        if (graph == null) {
            return null;
        } else {
            return graph.getGraph();
        }
    }
View Full Code Here

Examples of com.tinkerpop.rexster.RexsterApplicationGraph

            List<String> allowableNamespaces = new ArrayList<>();
            allowableNamespaces.add("tp:gremlin");

            List<HierarchicalConfiguration> extensionConfigurations = new ArrayList<>();

            return new RexsterApplicationGraph(
                    graphId,
                    graph,
                    allowableNamespaces,
                    extensionConfigurations);
View Full Code Here

Examples of com.tinkerpop.rexster.RexsterApplicationGraph

    protected final Map<String, RexsterApplicationGraph> graphs = new ConcurrentHashMap<String, RexsterApplicationGraph>();

    @Override
    public Graph getGraph(final String graphName) {
        final RexsterApplicationGraph g = getApplicationGraph(graphName);
        if (g != null) {
            return g.getGraph();
        } else {
            return null;
        }
    }
View Full Code Here

Examples of com.tinkerpop.rexster.RexsterApplicationGraph

        Map<String, RexsterApplicationGraph> graphs = new HashMap<String, RexsterApplicationGraph>();
        GraphConfigurationContext context = new GraphConfigurationContext(graphConfig, graphs);
        this.configuration.setSailType(AbstractSailGraphConfiguration.SAIL_TYPE_MEMORY);
        Graph graph = this.configuration.configureGraphInstance(context);

        graphs.put("ldbase", new RexsterApplicationGraph("ldbase", graph));

        // now configure LinkedDataSailGraph
        graphConfig = new HierarchicalConfiguration();
        context = new GraphConfigurationContext(graphConfig, graphs);
        graphConfig.setProperty(Tokens.REXSTER_GRAPH_LOCATION, "ldbase");
View Full Code Here

Examples of com.tinkerpop.rexster.RexsterApplicationGraph

        Map<String, RexsterApplicationGraph> graphs = new HashMap<String, RexsterApplicationGraph>();
        GraphConfigurationContext context = new GraphConfigurationContext(graphConfig, graphs);
        TinkerGraphGraphConfiguration conf = new TinkerGraphGraphConfiguration();
        Graph baseGraph = conf.configureGraphInstance(context);

        graphs.put("idbase", new RexsterApplicationGraph("idbase", baseGraph));

        // now configure IdGraph
        graphConfig = new HierarchicalConfiguration();
        context = new GraphConfigurationContext(graphConfig, graphs);
        graphConfig.setProperty(Tokens.REXSTER_GRAPH_LOCATION, "idbase");
View Full Code Here

Examples of com.tinkerpop.rexster.RexsterApplicationGraph

                    logger.warn("[" + MemoryStoreSailGraph.class.getSimpleName() + "] doesn't support the graph-file parameter.  It will be ignored.");
                }

                graph = new MemoryStoreSailGraph();
            } else if (this.sailType.equals(SAIL_TYPE_LINKED_DATA)) {
                RexsterApplicationGraph baseGraph = context.getGraphs().get(graphFile);
                if (null == baseGraph) {
                    throw new GraphConfigurationException("no such base graph for LinkedDataSail graph: " + graphFile);
                }
                if (!(baseGraph.getGraph() instanceof SailGraph)) {
                    throw new GraphConfigurationException("base graph for LinkedDataSail graph must be an instance of SailGraph");
                }
                if (baseGraph.getGraph() instanceof LinkedDataSailGraph) {
                    throw new GraphConfigurationException("LinkedDataSail graph based on another LinkedDataSail graph");
                }

                graph = new LinkedDataSailGraph((SailGraph) baseGraph.getGraph());
            } else if (this.sailType.equals(SAIL_TYPE_NATIVE)) {
                String configTripleIndices = "";
                if (sailSpecificConfiguration != null) {
                    configTripleIndices = sailSpecificConfiguration.getString("triple-indices", "");
                }
View Full Code Here

Examples of com.tinkerpop.rexster.RexsterApplicationGraph

                        // one graph failing initialization will not prevent the rest in
                        // their attempt to be created
                        try {
                            final Graph graph = getGraphFromConfiguration(graphConfig);
                            final RexsterApplicationGraph rag = new RexsterApplicationGraph(graphName, graph, graphConfig);
                            this.graphs.put(rag.getGraphName(), rag);

                            logger.info("Graph " + graphName + " - " + graph + " loaded");
                        } catch (GraphConfigurationException gce) {
                            logger.warn("Could not load graph " + graphName + ". Please check the XML configuration.");
                            logger.warn(gce.getMessage(), gce);
View Full Code Here

Examples of com.tinkerpop.rexster.RexsterApplicationGraph

        if (graphFile == null || graphFile.trim().length() == 0) {
            throw new GraphConfigurationException("Check graph configuration. Missing or empty configuration element: " + Tokens.REXSTER_GRAPH_LOCATION);
        }

        RexsterApplicationGraph baseGraph = context.getGraphs().get(graphFile);
        if (null == baseGraph) {
            throw new GraphConfigurationException("no such base graph for IdGraph: " + graphFile);
        }

        if (!(baseGraph.getGraph() instanceof KeyIndexableGraph)) {
            throw new GraphConfigurationException("base graph for IdGraph must be an instance of KeyIndexableGraph");
        }

        // get the <properties> section of the xml configuration
        final HierarchicalConfiguration graphSectionConfig = (HierarchicalConfiguration) context.getProperties();
        SubnodeConfiguration specificConfiguration;

        try {
            specificConfiguration = graphSectionConfig.configurationAt(Tokens.REXSTER_GRAPH_PROPERTIES);
        } catch (IllegalArgumentException iae) {
            throw new GraphConfigurationException("Check graph configuration. Missing or empty configuration element: " + Tokens.REXSTER_GRAPH_PROPERTIES);
        }

        boolean supportVertexIds = specificConfiguration.getBoolean("supportVertexIds", true);
        boolean supportEdgeIds = specificConfiguration.getBoolean("supportEdgeIds", true);

        return new IdGraph((KeyIndexableGraph) baseGraph.getGraph(), supportVertexIds, supportEdgeIds);
    }
View Full Code Here

Examples of com.tinkerpop.rexster.RexsterApplicationGraph

        // add all keys not defined by this request as bindings to the script engine
        placeParametersOnBinding(requestObject, bindings, showTypes);

        // get the list of "stored procedures" to run
        final RexsterApplicationGraph rag = rexsterResourceContext.getRexsterApplicationGraph();

        final ExtensionMethod extensionMethod = rexsterResourceContext.getExtensionMethod();
        Map configurationMap = null;

        Iterator<String> scriptsToRun = null;
        try {
            final ExtensionConfiguration extensionConfiguration = rag != null ? rag.findExtensionConfiguration(EXTENSION_NAMESPACE, EXTENSION_NAME) : null;
            if (extensionConfiguration != null) {
                configurationMap = extensionConfiguration.tryGetMapFromConfiguration();
                scriptsToRun = getScriptsToRun(requestObject, configurationMap);
            }
        } catch (IOException ioe) {
View Full Code Here

Examples of com.tinkerpop.rexster.RexsterApplicationGraph

        // configure the frames extension
        List<HierarchicalConfiguration> configs = new ArrayList<HierarchicalConfiguration>();
        configs.add(xmlConfig);

        this.rag = new RexsterApplicationGraph("tinkergraph", this.graph, allowedNamespaces, configs);
    }
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.