Download the PHP package the-don-himself/gremlin-ogm without Composer
On this page you can find all versions of the php package the-don-himself/gremlin-ogm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download the-don-himself/gremlin-ogm
More information about the-don-himself/gremlin-ogm
Files in the-don-himself/gremlin-ogm
Package gremlin-ogm
Short Description A PHP Object Graph Mapper for Tinkerpop 3+ compatible Graph Databases (JanusGraph, Neo4j, etc.) that allows you to persist data and run gremlin queries.
License MIT
Informations about the package gremlin-ogm
gremlin-ogm
A PHP Object Graph Mapper for Tinkerpop 3+ compatible Graph Databases (JanusGraph, Neo4j, etc.) that allows you to persist data and run gremlin queries.
Check out the TwitterGraph folder for an elaborate example of how to use gremlin-ogm to graph Twitter in a Graph Database.
Usage
Configure a Graph connection. This is simply a proxy to the underlying gremlin-server client for php aka brightzone/gremlin-php so you can check out the connection Class for configuration defaults and options Brightzone\GremlinDriver\Connection. For testing and development, I suggest something like the below
`
After configuring options, initiate a Graph connection
`
At this point you can open a connection to the Graph database and send gremlin-queries to it as shown.
`
Again these are just proxies to the underlying brightzone/gremlin-php library, so what does gremlin-ogm do? Gremlin-OGM helps you map PHP objects to Graph Vertexes, Edges, Properties and Indexes. It also provides a way to validate that mapping and point out areas where the schema fails. Moreover, the library attempts to create a cross-vendor abstraction layer because different providers might give different ways to execute gremlin commands.
Current Tested & Supported Vendors:
- [ ] Amazon Neptune
- [x] Azure Cosmos DB
- [ ] Datastax Enterprise Graph
- [x] JanusGraph on Compose
- [x] JanusGraph Self-Hosted
- [ ] Neo4j
- [ ] OrientDB
To tell the library of a specific vendor extend the options array as shown for self-hosted
`
Omiting the version will make the library assume the latest.
An example configuration for JanusGraph on Compose would look like this.
`
An example configuration for CosmosDB on Azure would look like this.
`
Vendor information is critical to the library so as to know whether to enable certain features like bindings which is does by default and may not work in all situations. Submitted vendor information can now be gotten as an array under the graph object `
Sample Usage
Please Check Out The-Don-Himself/twitter-graph, for a full working sample code of how to use this library to map your Twitter connection and tweets onto a compatible graph database.
GraphQL
You might also be interested in The-Don-Himself/graphql2gremlin, an attempt to create a standard around transforming GraphQL queries to Gremlin Traversals.
All versions of gremlin-ogm with dependencies
brightzone/gremlin-php Version ^3.0
doctrine/annotations Version ^1.8
jms/serializer Version ^3.0 || ^2.0