Class OrientGraph

All Implemented Interfaces:
OStorageRecoverListener, com.tinkerpop.blueprints.Graph, OrientExtendedGraph, com.tinkerpop.blueprints.IndexableGraph, com.tinkerpop.blueprints.KeyIndexableGraph, com.tinkerpop.blueprints.MetaGraph<ODatabaseDocumentTx>, com.tinkerpop.blueprints.TransactionalGraph

public class OrientGraph extends OrientTransactionalGraph
A Blueprints implementation of the graph database OrientDB (http://orientdb.com)
Author:
Luca Garulli (l.garulli--(at)--orientdb.com) (http://orientdb.com)
  • Field Details

    • features

      protected final com.tinkerpop.blueprints.Features features
  • Constructor Details

    • OrientGraph

      public OrientGraph(ODatabaseDocumentInternal iDatabase, String iUserName, String iUserPasswd)
      Creates a new Transactional Graph using an existent database instance. User and password are passed in case of re-open.
      Parameters:
      iDatabase - Underlying database object to attach
    • OrientGraph

      public OrientGraph(ODatabaseDocumentInternal iDatabase, boolean iAutoStartTx)
      Creates a new Transactional Graph using an existent database instance and the auto-start setting to determine if auto start a transaction.
      Parameters:
      iDatabase - Underlying database object to attach
      iAutoStartTx - True to auto start a transaction at the beginning and after each commit/rollback
    • OrientGraph

      public OrientGraph(String url)
      Creates a new Transactional Graph from an URL using default user (admin) and password (admin).
      Parameters:
      url - OrientDB URL
    • OrientGraph

      public OrientGraph(String url, boolean iAutoStartTx)
      Creates a new Transactional Graph from an URL using default user (admin) and password (admin). It receives also the auto-start setting to determine if auto start a transaction.
      Parameters:
      url - OrientDB URL
      iAutoStartTx - True to auto start a transaction at the beginning and after each commit/rollback
    • OrientGraph

      public OrientGraph(String url, String username, String password)
      Creates a new Transactional Graph from an URL using a username and a password.
      Parameters:
      url - OrientDB URL
      username - Database user name
      password - Database user password
    • OrientGraph

      public OrientGraph(String url, String username, String password, boolean iAutoStartTx)
      Creates a new Transactional Graph from an URL using a username and a password. It receives also the auto-start setting to determine if auto start a transaction.
      Parameters:
      url - OrientDB URL
      username - Database user name
      password - Database user password
      iAutoStartTx - True to auto start a transaction at the beginning and after each commit/rollback
    • OrientGraph

      public OrientGraph(OPartitionedDatabasePool pool)
      Creates a new Transactional Graph from a pool.
      Parameters:
      pool - Database pool where to acquire a database instance
    • OrientGraph

      public OrientGraph(OPartitionedDatabasePool pool, OrientConfigurableGraph.Settings configuration)
    • OrientGraph

      public OrientGraph(org.apache.commons.configuration.Configuration iConfiguration)
      Builds a OrientGraph instance passing a configuration. Supported configuration settings are:
      Name Description Default value
      blueprints.orientdb.url Database URL -
      blueprints.orientdb.username User name admin
      blueprints.orientdb.password User password admin
      blueprints.orientdb.saveOriginalIds Saves the original element IDs by using the property _id. This could be useful on import of graph to preserve original ids false
      blueprints.orientdb.keepInMemoryReferences Avoid to keep records in memory but only RIDs false
      blueprints.orientdb.useCustomClassesForEdges Use Edge's label as OrientDB class. If doesn't exist create it under the hood true
      blueprints.orientdb.useCustomClassesForVertex Use Vertex's label as OrientDB class. If doesn't exist create it under the hood true
      blueprints.orientdb.useVertexFieldsForEdgeLabels Store the edge relationships in vertex by using the Edge's class. This allow to use multiple fields and make faster traversal by edge's label (class) true
      blueprints.orientdb.lightweightEdges Uses lightweight edges. This avoid to create a physical document per edge. Documents are created only when they have properties true
      blueprints.orientdb.autoStartTx Auto start a transaction as soon the graph is changed by adding/remote vertices and edges and properties true
      Parameters:
      iConfiguration - graph settings see the details above.
    • OrientGraph

      public OrientGraph(ODatabaseDocumentInternal iDatabase)
      Creates a new Transactional Graph using an existent database instance.
      Parameters:
      iDatabase - Underlying database object to attach
    • OrientGraph

      public OrientGraph(ODatabaseDocumentInternal iDatabase, String iUser, String iPassword, OrientConfigurableGraph.Settings iConfiguration)
      Creates a new Transactional Graph using an existent database instance.
      Parameters:
      iDatabase - Underlying database object to attach
  • Method Details

    • getFeatures

      public com.tinkerpop.blueprints.Features getFeatures()
      Returns the current Graph settings.
      Returns:
      Features object
    • removeEdgeInternal

      public void removeEdgeInternal(OrientEdge edge)
      Removes the Edge from the Graph. Connected vertices aren't removed.