OrientDB
Author: t | 2025-04-25
OrientDB v . OrientDB for Microsoft Windows; OrientDB for Linux and any other NIX system; OrientDB for Mac OSX; OrientDB Zip for any OS; OrientDB with Gremlin Server - zip
Neo4j to OrientDB Importer - OrientDB
#OrientDB with Apache TinkerPop 3(since v 3.0) OrientDB adheres to the Apache TinkerPop standard and implements TinkerPop Stack interfaces.In versions prior to 3.0, OrientDB uses the TinkerPop 2.x implementation as the default for Java Graph API.Starting from version 3.0, OrientDB ships its own APIs for handling Graphs (Multi-Model API). Those APIs are used to implement the TinkerPop 3 interfaces.The OrientDB TinkerPop development happens hereInstallationGremlin ConsoleGremlin ServerGraph APIInstallationSince TinkerPop stack has been removed as a dependency from the OrientDB Community Edition, starting with version 3.0 it will be available for download as an Apache TinkerPop 3 enabled edition of OrientDB based on the Community Edition.It contains all the features of the OrientDB Community Edition plus the integration with the Tinkerpop stack:Gremlin ConsoleGremlin ServerGremlin DriverSource Code InstallationIn addition to the binary packages, you can compile the OrientDB TinkerPop enabled distribution from the source code.This process requires that you install Git and Apache Maven on your system. As a pre-requirement, you have to build the same branch for OrientDB core distribution:$ git clone cd orientdb$ git checkout develop$ mvn clean install -DskipTests$ cd ..Then you can proceed and build orientdb-gremlin$ git clone cd orientdb-gremlin$ git checkout develop$ mvn clean installIt is possible to skip tests:$ mvn clean install -DskipTestsThis project follows the branching system of OrientDB. The build process installs all jars in the local maven repository and creates archives under the distribution module inside the target directory. At the time of writing, building from branch develop gave: $ls -l distribution/target/total 266640drwxr-xr-x 2 staff staff 68B Mar 21 13:07 archive-tmp/drwxr-xr-x 3 staff staff 102B Mar 21 13:07 dependency-maven-plugin-markers/drwxr-xr-x 12 staff staff 408B Mar 21 13:07 orientdb-community-3.0.0-SNAPSHOT/drwxr-xr-x 3 staff staff 102B Mar 21 13:07 orientdb-gremlin-community-3.0.0-SNAPSHOT.dir/-rw-r--r-- 1 staff staff 65M Mar 21 13:08 orientdb-gremlin-community-3.0.0-SNAPSHOT.tar.gz-rw-r--r-- 1 staff staff 65M Mar 21 13:08 orientdb-gremlin-community-3.0.0-SNAPSHOT.zip$The directory orientdb-gremlin-community-3.0.0-SNAPSHOT.dir contains the OrientDB Gremlin distribution uncompressed.Gremlin ConsoleThe Gremlin Console is an interactive terminal or REPL that can be used to traverse graphs and interact with the data that they contain. For more information about it see the documentation hereTo start the Gremlin console run the gremlin.sh (or gremlin.bat on Windows OS) Edges of a vertex use .outE() .Label is optional and if passed the outgoing edges will be filtered by that labelExample:gremlin> g.V('#41:1').outE()==>e[#221:6][#41:1-HasFriend->#42:1]==>e[#222:6][#41:1-HasFriend->#43:1]To display all the incoming edges of a vertex use .inE(). Example:gremlin> g.V('#41:1').inE()==>e[#224:0][#41:0-HasFriend->#41:1]==>e[#217:2][#42:0-HasFriend->#41:1]==>e[#217:3][#43:0-HasFriend->#41:1]==>e[#224:3][#44:0-HasFriend->#41:1]==>e[#222:4][#45:0-HasFriend->#41:1]==>e[#219:5][#46:0-HasFriend->#41:1]==>e[#223:5][#47:0-HasFriend->#41:1]==>e[#218:6][#48:0-HasFriend->#41:1]==>e[#185:0][#121:0-HasProfile->#41:1]For more information look at the Gremlin Traversal.Filter resultsThis example returns all the outgoing edges of all the vertices with label equal to 'friend'.gremlin> g.V('#41:1').inE('HasProfile')==>e[#185:0][#121:0-HasProfile->#41:1]gremlin> Create complex pathsGremlin allows you to concatenate expressions to create more complex traversals in a single line:g.V().in().out()Of course this could be much more complex. Below is an example with the graph taken from the official documentation:gremlin> g.V('44:0').out('HasFriend').out('HasFriend').values('Name').dedup()==>Frank==>Emanuele==>Paolo==>Colin==>Andrey==>Sergeygremlin> Gremlin ServerThere are two ways to use OrientDB inside the Gremlin ServerUse the OrientDB-TP3 distribution that embed the Gremlin ServerInstall the OrientDB-Gremlin Driver into a GremlinServerOrientDB-TP3Download the latest version of OrientDB-TP3 here.and start OrientDB to automatically start the embedded Gremlin Server.The configuration of the Gremlin Server is in $ORIENTDB_HOME/config.When using the embedded version by default the Authentication manager authenticate the users against OrientDB server userwith permission gremlin.server.Install OrientDB-GremlinDownload the latest Gremlin Server distribution hereand then install the OrientDB Gremlin driver with bin/gremlin-server.sh -i com.orientechnologies orientdb-gremlin ${version}OrientDB Gremlin Server configurationYAML configuration example (save as gremlin-server.yaml)host: localhostport: 8182scriptEvaluationTimeout: 30000channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizergraphs: { graph : conf/orientdb-empty.properties}scriptEngines: { gremlin-groovy: { plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, org.apache.tinkerpop.gremlin.orientdb.jsr223.OrientDBGremlinPlugin: {}, org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [ scripts/empty-sample.groovy]}}}}serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.orientdb.io.OrientIoRegistry] }} # application/vnd.gremlin-v3.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }} # application/vnd.gremlin-v3.0+gryo-stringd - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.orientdb.io.OrientIoRegistry] }} # application/jsonprocessors: - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }} - { className: org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor, config: { cacheExpirationTime: 600000, cacheMaxSize: 1000 }}metrics: { consoleReporter: {enabled: true, interval: 180000}, csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv}, jmxReporter: {enabled: true}, slf4jReporter: {enabled: true, interval: 180000}}strictTransactionManagement: falsemaxInitialLineLength: 4096maxHeaderSize: 8192maxChunkSize: 8192maxContentLength: 65536maxAccumulationBufferComponents: 1024resultIterationBatchSize: 64writeBufferLowWaterMark: 32768writeBufferHighWaterMark: 65536ssl: { enabled: false}Graph Configuration properties example (e.g. save as orientdb-empty.properties. It has to be the one referenced in the gremlin-server.yaml file)gremlin.graph=org.apache.tinkerpop.gremlin.orientdb.OrientFactoryorient-url=plocal:/tmp/graphorient-user=adminorient-pass=adminNote: currently is missing. Download and add to lib or plugins folder.OrientDB TinkerPop Graph APIIn order to use the OrientDB TinkerPop Graph API implementation, you need to create an instance of theOverview of OrientDB OrientDB Manual
This example describes the process for importing from a CSV file into OrientDB as a Graph. For the sake of simplicity, consider only these 2 entities:POSTCOMMENTAlso consider the relationship between Post and Comment as One-2-Many. One Post can have multiple Comments. We're representing them as they would appear in an RDBMS, but the source could be anything.With an RDBMS Post and Comment would be stored in 2 separate tables:TABLE POST:+----+----------------+| id | title |+----+----------------+| 10 | NoSQL movement || 20 | New OrientDB |+----+----------------+TABLE COMMENT:+----+--------+--------------+| id | postId | text |+----+--------+--------------+| 0 | 10 | First || 1 | 10 | Second || 21 | 10 | Another || 41 | 20 | First again || 82 | 20 | Second Again |+----+--------+--------------+With an RDBMS, one-2-many references are inverted from the target table (Comment) to the source one (Post). This is due to the inability of an RDBMS to handle a collection of values.In comparison, using the OrientDB Graph model, relationships are modeled as you would think, when you design an application: POSTs have edges to COMMENTs.So, with an RDBMS you have:Table POST With OrientDB, the Graph model uses Edges to manage relationships:Class POST ->* (collection of edges) Class COMMENT(1) Export to CSVIf you're using an RDBMS or any other source, export your data in CSV format. The ETL module is also able to extract from JSON and an RDBMS directly through JDBC drivers. However, for the sake of simplicity, in this example we're going to use CSV as the source format.Consider having 2 CSV files:File posts.csvposts.csv file, containing all the postsid,title10,NoSQL movement20,New OrientDBcomments.csv file, containing all the comments, with the relationship to the commented postid,postId,text0,10,First1,10,Second21,10,Another41,20,First again82,20,Second Again(2) ETL ConfigurationThe OrientDB ETL tool requires only a JSON file to define the ETL process as Extractor, a list of Transformers to be executed in the pipeline, and a Loader, to load graph elements into the OrientDB database.Below are 2 files containing the ETL to import Posts and Comments separately.post.json ETL file{ "source": { "file": { "path": "/temp/datasets/posts.csv" } }, "extractor": { "csv": {} }, "transformers": [ { "vertex": { "class": "Post" } } ], "loader": { "orientdb": { "dbURL": "plocal:/temp/databases/blog", "dbType": "graph", "classes": [ {"name": "Post", "extends": "V"}, {"name": "Comment", "extends": "V"}, {"name": "HasComments", "extends": "E"} ], "indexes": [ {"class":"Post", "fields":["id:integer"], "type":"UNIQUE" } ] } }}The Loader contains all the information to connect to an OrientDB database. We have used a plocal database, because it's faster. However, if you have an OrientDB server up & running, use "remote:" instead. Note the classes and indexes declared in the Loader. As soon as the Loader is configured, the classes and indexes are created, if they do not already exist. We have created the index on the Post.id field to assure that there are no duplicates and that the lookup on the created edges (see below) will be fast enough.{ "source": { "file": { "path": "/temp/datasets/comments.csv" } }, "extractor": { "csv": {} }, "transformers": [ { "vertex": { "class": "Comment" } }, { "edge":. OrientDB v . OrientDB for Microsoft Windows; OrientDB for Linux and any other NIX system; OrientDB for Mac OSX; OrientDB Zip for any OS; OrientDB with Gremlin Server - ziporientdb Tutorial = Getting started with orientdb
{ "class": "HasComments", "joinFieldName": "postId", "lookup": "Post.id", "direction": "in" } } ], "loader": { "orientdb": { "dbURL": "plocal:/temp/databases/blog", "dbType": "graph", "classes": [ {"name": "Post", "extends": "V"}, {"name": "Comment", "extends": "V"}, {"name": "HasComments", "extends": "E"} ], "indexes": [ {"class":"Post", "fields":["id:integer"], "type":"UNIQUE" } ] } }}This file is similar to the previous one, but the Edge transformer does the job. Since the link found in the CSV goes in the opposite direction (Comment->Post), while we want to model directly (Post->Comment), we used the direction "in" (default is always "out").(3) Run the ETL processNow allow the ETL to run by executing both imports in sequence. Open a shell under the OrientDB home directory, and execute the following steps:$ cd bin$ ./oetl.sh post.json$ ./oetl.sh comment.jsonOnce both scripts execute successfully, you'll have your Blog imported into OrientDB as a Graph!(4) Check the databaseOpen the database under the OrientDB console and execute the following commands to check that the import is ok:$ ./console.shOrientDB console v.2.0-SNAPSHOT (build 2565) www.orientechnologies.comType 'help' to display all the supported commands.Installing extensions for GREMLIN language v.2.6.0orientdb> connect plocal:/temp/databases/blog admin adminConnecting to database [plocal:/temp/databases/blog] with user 'admin'...OKorientdb {db=blog}> select expand( out() ) from Post where id = 10----+-----+-------+----+------+-------+--------------# |@RID |@CLASS |id |postId|text |in_HasComments----+-----+-------+----+------+-------+--------------0 |#12:0|Comment|0 |10 |First |[size=1]1 |#12:1|Comment|1 |10 |Second |[size=1]2 |#12:2|Comment|21 |10 |Another|[size=1]----+-----+-------+----+------+-------+--------------3 item(s) found. Query executed in 0.002 sec(s).orientdb {db=blog}> select expand( out() ) from Post where id = 20----+-----+-------+----+------+------------+--------------# |@RID |@CLASS |id |postId|text |in_HasComments----+-----+-------+----+------+------------+--------------0 |#12:3|Comment|41 |20 |First again |[size=1]1 |#12:4|Comment|82 |20 |Second Again|[size=1]----+-----+-------+----+------+------------+--------------2 item(s) found. Query executed in 0.001 sec(s). Script located in the bin directory of the OrientDB Gremlin Distribution$ ./gremlin.sh \,,,/ (o o)-----oOOo-(3)-oOOo-----plugin activated: tinkerpop.orientdbgremlin> Alternatively if you downloaded the Gremlin Console from the Apache Tinkerpop Site, just install the OrientDB Gremlin Plugin withgremlin> :install com.orientechnologies orientdb-gremlin {version}and then activate itgremlin> :plugin use tinkerpop.orientdbOpen the graph databaseBefore playing with Gremlin you need a valid OrientGraph instance that points to an OrientDB database. To know all the database types look at Storage types.When you're working with a local or an in-memory database, if the database does not exist it's created for you automatically. Using the remote connection you need to create the database on the target server before using it. This is due to security restrictions.Once created the OrientGraph instance with a proper URL is necessary to assign it to a variable. Gremlin is written in Groovy, so it supports all the Groovy syntax, and both can be mixed to create very powerful scripts!Example with a memory database (see below for more information about it):gremlin> graph = OrientGraph.open();==>orientgraph[memory:orientdb-0.5772652169975153]Some useful links:The GraphAll available stepsWorking with in-memory databaseIn this mode the database is volatile and all the changes will be not persistent. Use this in a clustered configuration (the database life is assured by the cluster itself) or just for test.gremlin> graph = OrientGraph.open()==>orientgraph[memory:orientdb-0.4274754723616194]Working with local databaseThis is the most often used mode. The console opens and locks the database for exclusive use. This doesn't require starting an OrientDB server.gremlin> graph = OrientGraph.open("embedded:/tmp/gremlin/demo");==>orientgraph[plocal:/tmp/gremlin/demo]Working with a remote databaseTo open a database on a remote server be sure the server is up and running first. To start the server just launch server.sh (or server.bat on Windows OS) script. For more information look at OrientDB Servergremlin> graph = OrientGraph.open("remote:localhost/demodb");==>orientgraph[remote:localhost/demodb]Use securityOrientDB supports security by creating multiple users and roles associated with certain privileges. To know more look at Security. To open the graph database with a different user than the default, pass the user and password as additional parameters:gremlin> graph = OrientGraph.open("remote:localhost/demodb","reader","reader");==>orientgraph[remote:localhost/demodb]With Configurationgremlin> config = new BaseConfiguration()==>org.apache.commons.configuration.BaseConfiguration@2d38edfdgremlin> config.setProperty("orient-url","remote:localhost/demodb")==>nullgremlin> graph = OrientGraph.open(config)==>orientgraph[remote:localhost/demodb]Available configurations are :orient-url: Connection URL.orient-user: Database User.orient-pass: Database Password.orient-transactional: Transactional. Configuration. If true theGitHub - orientechnologies/orientdb: OrientDB is the most
Expected behavior and actual behaviorExpected - root password should set and orientDB should run after installationActual - Getting following JAVA error during installation on MAC Book air running on OS X EI Capitan,+---------------------------------------------------------------+| WARNING: FIRST RUN CONFIGURATION |+---------------------------------------------------------------+| This is the first time the server is running. Please type a || password of your choice for the 'root' user or leave it blank || to auto-generate it. || || To avoid this message set the environment variable or JVM || setting ORIENTDB_ROOT_PASSWORD to the root password to use. |+---------------------------------------------------------------+Root password [BLANK=auto generate it]: *****Please confirm the root password: _^Rro_*Exception in thread "main" com.orientechnologies.orient.core.exception.OSecurityException: Cannot create a key with 'PBKDF2WithHmacSHA256' algorithmat com.orientechnologies.orient.core.security.OSecurityManager.getPbkdf2(OSecurityManager.java:246)at com.orientechnologies.orient.core.security.OSecurityManager.createHashWithSalt(OSecurityManager.java:189)at com.orientechnologies.orient.core.security.OSecurityManager.createHash(OSecurityManager.java:154)at com.orientechnologies.orient.server.OServer.addUser(OServer.java:840)at com.orientechnologies.orient.server.OServer.createDefaultServerUsers(OServer.java:1121)at com.orientechnologies.orient.server.OServer.loadUsers(OServer.java:990)at com.orientechnologies.orient.server.OServer.activate(OServer.java:379)at com.orientechnologies.orient.server.OServerMain.main(OServerMain.java:41)Caused by: java.security.NoSuchAlgorithmException: PBKDF2WithHmacSHA256 SecretKeyFactory not availableat javax.crypto.SecretKeyFactory.(DashoA13_..)at javax.crypto.SecretKeyFactory.getInstance(DashoA13_..)at com.orientechnologies.orient.core.security.OSecurityManager.getPbkdf2(OSecurityManager.java:236)... 7 moreSteps to reproduce the problemdownload the orientdb-community-2.2.0.tar.gz fileunzip it and run bin/server.sh from terminalSet root password, again confirm root password4 hit enter - you will see the above issue.Important QuestionsPlease let me know the steps to fix the issue or fix the orientDB package itself if issue is there. I want to run it on machine ASAP.Runninng ModeMAC terminalMiscNAOrientDB Versioncommunity-2.2.0Operating SystemMacOSXJava Version8OrientDB Data Import Programs - OrientDB
OrientGraph instance will support transactions (Disabled by default).Mutating the GraphCreate a new VertexTo create a new vertex, use the addVertex() method. The vertex will be created and a unique id will be displayed as the return value.graph.addVertex();==>v[#5:0]Create an edgeTo create a new edge between two vertices, use the v1.addEdge(label, v2) method. The edge will be created with the label specified.In the example below two vertices are created and assigned to a variable (Gremlin is based on Groovy), then an edge is created between them.gremlin> v1 = graph.addVertex();==>v[#10:0]gremlin> v2 = graph.addVertex();==>v[#11:0]gremlin> e = v1.addEdge('friend',v2)==>e[#17:0][#10:0-friend->#11:0]Close the databaseTo close a graph use the close() method:gremlin> graph.close()==>nullThis is not strictly necessary because OrientDB always closes the database when the Gremlin Console quits.TransactionsOrientGraph supports Transactions. By default Tx are disabled. Use configuration to enable it.gremlin> config = new BaseConfiguration()==>org.apache.commons.configuration.BaseConfiguration@2d38edfdgremlin> config.setProperty("orient-url","remote:localhost/demodb")==>nullgremlin> config.setProperty("orient-transactional",true)==>nullgremlin> graph = OrientGraph.open(config)==>orientgraph[remote:localhost/demodb]When using transactions OrientDB assigns a temporary identifier to each vertex and edge that is created.use graph.tx().commit() to save them.Transaction Examplegremlin> config = new BaseConfiguration()==>org.apache.commons.configuration.BaseConfiguration@6b7d1df8gremlin> config.setProperty("orient-url","remote:localhost/demodb")==>nullgremlin> config.setProperty("orient-transactional",true)==>nullgremlin> graph = OrientGraph.open(config)==>orientgraph[remote:localhost/demodb]gremlin> graph.tx().isOpen()==>truegremlin> v1 = graph.addVertex()==>v[#-1:-2]gremlin> v2 = graph.addVertex()==>v[#-1:-3]gremlin> e = v1.addEdge("friends",v2)==>e[#-1:-4][#-1:-2-friends->#-1:-3]gremlin> graph.tx().commit()==>nullTraversalThe power of Gremlin is in traversal. Once you have a graph loaded in your database you can traverse it in many different ways. For more info about traversal with Gremlin see hereThe entry point for traversal is a TraversalSource that can be easily obtained by an opened OrientGraph instance with:gremlin> graph = OrientGraph.open()==>orientgraph[memory:orientdb-0.41138060448051794]gremlin> g = graph.traversal()==>graphtraversalsource[orientgraph[memory:orientdb-0.41138060448051794], standard]Retrieve a vertexTo retrieve a vertex by its ID, use the V(id) method passing the RecordId as an argument (with or without the prefix '#'). This example retrieves the first vertex created in the above example.gremlin> g.V('#33:0')==>v[#33:0]Get all the verticesTo retrieve all the vertices in the opened graph use .V() (V in upper-case):gremlin> g.V()==>v[#33:0]==>v[#33:1]==>v[#33:2]==>v[#33:3]Retrieve an edgeRetrieving an edge is very similar to retrieving a vertex. Use the E(id) method passing the RecordId as an argument (with or without the prefix '#'). This example retrieves the first edge created in the previous example.gremlin> g.E('145:0')==>e[#145:0][#121:0-IsFromCountry->#33:29]Get all the edgesTo retrieve all the edges in the opened graph use .E() (E in upper-case):gremlin> g.E()==>e[#145:0][#121:0-IsFromCountry->#33:29]==>e[#145:1][#121:1-IsFromCountry->#40:11]==>e[#145:2][#121:2-IsFromCountry->#37:0]Basic TraversalTo display all the outgoing. OrientDB v . OrientDB for Microsoft Windows; OrientDB for Linux and any other NIX system; OrientDB for Mac OSX; OrientDB Zip for any OS; OrientDB with Gremlin Server - zipAvailable OrientDB Plugins OrientDB Manual
The following is a list of tools that automatically expose a REST, GraphQL, or another kind of API for your database, as well as databases with a built-in HTTP API. Project name/link Database(s) supported API type Implementation language License GitHub stats Notes Apinizer API Creator Oracle, MySQL, PostgreSQL, MsSQL, IBM DB2, SAP Sybase ASE, Apache Impala, Apache Hive REST Java Proprietary (SaaS) n/a Generates OpenAPI Specifications. ArangoDB ArangoDB REST C++ Apache-2.0 13637 ★; 51753 commits, latest 2025-01-08 A database with a built-in REST API.Official Docker image. CouchDB CouchDB REST Erlang Apache-2.0 6346 ★; 13855 commits, latest 2025-01-07 A database with a built-in REST API.Official Docker image. Datasette SQLite 3 REST Python 3 Apache-2.0 9702 ★; 2664 commits, latest 2025-01-01 Read-only.Official Docker image. DB2Rest PostgreSQL, MySQL, MariaDB, Oracle, CockroachDB REST Java Apache-2.0 257 ★; 1363 commits, latest 2024-12-15 Official Docker image. Dgraph Dgraph GraphQL (since version 2.0.0-rc1) Go Apache-2.0 20571 ★; 6240 commits, latest 2025-01-08 A database with a built-in GraphQL API.Official Docker image. Directus PostgreSQL, MySQL, SQLite, OracleDB, CockroachDB, MariaDB, MS SQL REST and GraphQL TypeScript Propretary (BUSL-1.1), GPL-3.0 (after three years) 28616 ★; 12491 commits, latest 2025-01-08 Official Docker image. DreamFactory MySQL, PostgreSQL, SQLite, MongoDB, CouchDB, andothers. REST PHP 5 Apache-2.0, proprietary (optional extras) 1573 ★; 1140 commits, latest 2024-05-16 Official Docker image. EJDB2 EJDB2 REST C MIT 1447 ★; 2849 commits, latest 2024-12-02 A database with a built-in REST API.Official Docker image. Eve MongoDB; extensions for Elasticsearch, Neo4j, SQLAlchemy (SQL databases). REST Python 2/3 BSD-3-Clause 6711 ★; 3403 commits, latest 2024-10-15 The SQLAlchemy extension isn't automatic.It requires the user to write SQLAlchemy mappings. GraphJin Service PostgreSQL, MySQL, Yugabyte GraphQL Go Apache-2.0 2942 ★; 936 commits, latest 2024-09-06 Using GraphJin as a standlone service.Official Docker image. GraphQL Mesh PostgreSQL (PostGraphile), MongoDB (graphql-compose-mongoose), SQLite 3 (tuql), Neo4j (Neo4j GraphQL Library), MySQL GraphQL TypeScript (Node.js) MIT 3319 ★; 8054 commits, latest 2025-01-08 Provides a common GraphQL gateway for different APIs and databases. Hasura GraphQL Engine PostgreSQL, MS SQL, MySQL, Snowflake, and others GraphQL, REST Haskell Apache-2.0 31260 ★; 9148 commits, latest 2025-01-08 Official Docker image. HTSQL MySQL, PostgreSQL, SQLite (free); Oracle, MS SQL (proprietary) REST Python 3 Apache-2.0, proprietary (Oracle and MS SQL support) 25 ★; 1235 commits, latest 2020-08-11 InfluxDB InfluxDB REST Go MIT 29283 ★; 49443 commits, latest 2025-01-08 A timeseries database with a built-in REST API.Official Docker image. neo4j-graphql Neo4j GraphQL Kotlin Apache-2.0 449 ★; 164 commits, latest 2020-10-22 Can generate a GraphQL API from an existing databaseor derive a new database model from a GraphQL schema and auto-generate the resolvers. NocoDB MySQL, PostgreSQL, SQL Server, SQLite REST JavaScript (Node.js) MIT 50728 ★; 26350 commits, latest 2025-01-08 Official Docker image. OrientDB OrientDB REST Java Apache-2.0 4762 ★; 25944 commits, latest 2025-01-07 A database with a built-in REST API.Official Docker image. PHP-CRUD-API MySQL, PostgreSQL, MS SQL Server. REST PHP 7 MIT 3635 ★; 2154 commits, latest 2024-11-22 Supports GIS + automatic OpenAPI 3.0 docs. PostGraphile PostgreSQL GraphQL TypeScript (Node.js) MIT 12645 ★; 11461 commits, latest 2025-01-07 Formerly "PostGraphQL".Official DockerComments
#OrientDB with Apache TinkerPop 3(since v 3.0) OrientDB adheres to the Apache TinkerPop standard and implements TinkerPop Stack interfaces.In versions prior to 3.0, OrientDB uses the TinkerPop 2.x implementation as the default for Java Graph API.Starting from version 3.0, OrientDB ships its own APIs for handling Graphs (Multi-Model API). Those APIs are used to implement the TinkerPop 3 interfaces.The OrientDB TinkerPop development happens hereInstallationGremlin ConsoleGremlin ServerGraph APIInstallationSince TinkerPop stack has been removed as a dependency from the OrientDB Community Edition, starting with version 3.0 it will be available for download as an Apache TinkerPop 3 enabled edition of OrientDB based on the Community Edition.It contains all the features of the OrientDB Community Edition plus the integration with the Tinkerpop stack:Gremlin ConsoleGremlin ServerGremlin DriverSource Code InstallationIn addition to the binary packages, you can compile the OrientDB TinkerPop enabled distribution from the source code.This process requires that you install Git and Apache Maven on your system. As a pre-requirement, you have to build the same branch for OrientDB core distribution:$ git clone cd orientdb$ git checkout develop$ mvn clean install -DskipTests$ cd ..Then you can proceed and build orientdb-gremlin$ git clone cd orientdb-gremlin$ git checkout develop$ mvn clean installIt is possible to skip tests:$ mvn clean install -DskipTestsThis project follows the branching system of OrientDB. The build process installs all jars in the local maven repository and creates archives under the distribution module inside the target directory. At the time of writing, building from branch develop gave: $ls -l distribution/target/total 266640drwxr-xr-x 2 staff staff 68B Mar 21 13:07 archive-tmp/drwxr-xr-x 3 staff staff 102B Mar 21 13:07 dependency-maven-plugin-markers/drwxr-xr-x 12 staff staff 408B Mar 21 13:07 orientdb-community-3.0.0-SNAPSHOT/drwxr-xr-x 3 staff staff 102B Mar 21 13:07 orientdb-gremlin-community-3.0.0-SNAPSHOT.dir/-rw-r--r-- 1 staff staff 65M Mar 21 13:08 orientdb-gremlin-community-3.0.0-SNAPSHOT.tar.gz-rw-r--r-- 1 staff staff 65M Mar 21 13:08 orientdb-gremlin-community-3.0.0-SNAPSHOT.zip$The directory orientdb-gremlin-community-3.0.0-SNAPSHOT.dir contains the OrientDB Gremlin distribution uncompressed.Gremlin ConsoleThe Gremlin Console is an interactive terminal or REPL that can be used to traverse graphs and interact with the data that they contain. For more information about it see the documentation hereTo start the Gremlin console run the gremlin.sh (or gremlin.bat on Windows OS)
2025-04-06Edges of a vertex use .outE() .Label is optional and if passed the outgoing edges will be filtered by that labelExample:gremlin> g.V('#41:1').outE()==>e[#221:6][#41:1-HasFriend->#42:1]==>e[#222:6][#41:1-HasFriend->#43:1]To display all the incoming edges of a vertex use .inE(). Example:gremlin> g.V('#41:1').inE()==>e[#224:0][#41:0-HasFriend->#41:1]==>e[#217:2][#42:0-HasFriend->#41:1]==>e[#217:3][#43:0-HasFriend->#41:1]==>e[#224:3][#44:0-HasFriend->#41:1]==>e[#222:4][#45:0-HasFriend->#41:1]==>e[#219:5][#46:0-HasFriend->#41:1]==>e[#223:5][#47:0-HasFriend->#41:1]==>e[#218:6][#48:0-HasFriend->#41:1]==>e[#185:0][#121:0-HasProfile->#41:1]For more information look at the Gremlin Traversal.Filter resultsThis example returns all the outgoing edges of all the vertices with label equal to 'friend'.gremlin> g.V('#41:1').inE('HasProfile')==>e[#185:0][#121:0-HasProfile->#41:1]gremlin> Create complex pathsGremlin allows you to concatenate expressions to create more complex traversals in a single line:g.V().in().out()Of course this could be much more complex. Below is an example with the graph taken from the official documentation:gremlin> g.V('44:0').out('HasFriend').out('HasFriend').values('Name').dedup()==>Frank==>Emanuele==>Paolo==>Colin==>Andrey==>Sergeygremlin> Gremlin ServerThere are two ways to use OrientDB inside the Gremlin ServerUse the OrientDB-TP3 distribution that embed the Gremlin ServerInstall the OrientDB-Gremlin Driver into a GremlinServerOrientDB-TP3Download the latest version of OrientDB-TP3 here.and start OrientDB to automatically start the embedded Gremlin Server.The configuration of the Gremlin Server is in $ORIENTDB_HOME/config.When using the embedded version by default the Authentication manager authenticate the users against OrientDB server userwith permission gremlin.server.Install OrientDB-GremlinDownload the latest Gremlin Server distribution hereand then install the OrientDB Gremlin driver with bin/gremlin-server.sh -i com.orientechnologies orientdb-gremlin ${version}OrientDB Gremlin Server configurationYAML configuration example (save as gremlin-server.yaml)host: localhostport: 8182scriptEvaluationTimeout: 30000channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizergraphs: { graph : conf/orientdb-empty.properties}scriptEngines: { gremlin-groovy: { plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, org.apache.tinkerpop.gremlin.orientdb.jsr223.OrientDBGremlinPlugin: {}, org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [ scripts/empty-sample.groovy]}}}}serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.orientdb.io.OrientIoRegistry] }} # application/vnd.gremlin-v3.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }} # application/vnd.gremlin-v3.0+gryo-stringd - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.orientdb.io.OrientIoRegistry] }} # application/jsonprocessors: - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }} - { className: org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor, config: { cacheExpirationTime: 600000, cacheMaxSize: 1000 }}metrics: { consoleReporter: {enabled: true, interval: 180000}, csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv}, jmxReporter: {enabled: true}, slf4jReporter: {enabled: true, interval: 180000}}strictTransactionManagement: falsemaxInitialLineLength: 4096maxHeaderSize: 8192maxChunkSize: 8192maxContentLength: 65536maxAccumulationBufferComponents: 1024resultIterationBatchSize: 64writeBufferLowWaterMark: 32768writeBufferHighWaterMark: 65536ssl: { enabled: false}Graph Configuration properties example (e.g. save as orientdb-empty.properties. It has to be the one referenced in the gremlin-server.yaml file)gremlin.graph=org.apache.tinkerpop.gremlin.orientdb.OrientFactoryorient-url=plocal:/tmp/graphorient-user=adminorient-pass=adminNote: currently is missing. Download and add to lib or plugins folder.OrientDB TinkerPop Graph APIIn order to use the OrientDB TinkerPop Graph API implementation, you need to create an instance of the
2025-04-07This example describes the process for importing from a CSV file into OrientDB as a Graph. For the sake of simplicity, consider only these 2 entities:POSTCOMMENTAlso consider the relationship between Post and Comment as One-2-Many. One Post can have multiple Comments. We're representing them as they would appear in an RDBMS, but the source could be anything.With an RDBMS Post and Comment would be stored in 2 separate tables:TABLE POST:+----+----------------+| id | title |+----+----------------+| 10 | NoSQL movement || 20 | New OrientDB |+----+----------------+TABLE COMMENT:+----+--------+--------------+| id | postId | text |+----+--------+--------------+| 0 | 10 | First || 1 | 10 | Second || 21 | 10 | Another || 41 | 20 | First again || 82 | 20 | Second Again |+----+--------+--------------+With an RDBMS, one-2-many references are inverted from the target table (Comment) to the source one (Post). This is due to the inability of an RDBMS to handle a collection of values.In comparison, using the OrientDB Graph model, relationships are modeled as you would think, when you design an application: POSTs have edges to COMMENTs.So, with an RDBMS you have:Table POST With OrientDB, the Graph model uses Edges to manage relationships:Class POST ->* (collection of edges) Class COMMENT(1) Export to CSVIf you're using an RDBMS or any other source, export your data in CSV format. The ETL module is also able to extract from JSON and an RDBMS directly through JDBC drivers. However, for the sake of simplicity, in this example we're going to use CSV as the source format.Consider having 2 CSV files:File posts.csvposts.csv file, containing all the postsid,title10,NoSQL movement20,New OrientDBcomments.csv file, containing all the comments, with the relationship to the commented postid,postId,text0,10,First1,10,Second21,10,Another41,20,First again82,20,Second Again(2) ETL ConfigurationThe OrientDB ETL tool requires only a JSON file to define the ETL process as Extractor, a list of Transformers to be executed in the pipeline, and a Loader, to load graph elements into the OrientDB database.Below are 2 files containing the ETL to import Posts and Comments separately.post.json ETL file{ "source": { "file": { "path": "/temp/datasets/posts.csv" } }, "extractor": { "csv": {} }, "transformers": [ { "vertex": { "class": "Post" } } ], "loader": { "orientdb": { "dbURL": "plocal:/temp/databases/blog", "dbType": "graph", "classes": [ {"name": "Post", "extends": "V"}, {"name": "Comment", "extends": "V"}, {"name": "HasComments", "extends": "E"} ], "indexes": [ {"class":"Post", "fields":["id:integer"], "type":"UNIQUE" } ] } }}The Loader contains all the information to connect to an OrientDB database. We have used a plocal database, because it's faster. However, if you have an OrientDB server up & running, use "remote:" instead. Note the classes and indexes declared in the Loader. As soon as the Loader is configured, the classes and indexes are created, if they do not already exist. We have created the index on the Post.id field to assure that there are no duplicates and that the lookup on the created edges (see below) will be fast enough.{ "source": { "file": { "path": "/temp/datasets/comments.csv" } }, "extractor": { "csv": {} }, "transformers": [ { "vertex": { "class": "Comment" } }, { "edge":
2025-04-08