neo4j-meta_model is a Rails engine for providing a web user interface for easily managing neo4j databases. It can be included in your Rails app or used independently via the neo4j-meta_model-app application.
The neo4j gem is used behind the scenes, and so the concepts of Models and Associations are exposed directly in
- Models Models correspond to Neo4j Labels. Models define which properties which we are concerned with as well as validations and business logic. Models also support inheritance. Currently
neo4j-meta_modelsupports properties and inheritance but not validation or custom business logic.
- Associations Associations specify which nodes are related to a node under consideration. For example, if there are
Articlemodels with a
WROTE_ARTICLErelationship between them, one might define an
articlesassociation for the
Personmodel and an
authorassociation for the
Articlemodel, both of which use the
neo4j-meta_model, both associations are always defined at the same time.
neo4j-meta_model has two main sections: one for managing your domain model, and one for editing records in the domain model.
Domain Model Management (Admin)
Models can be added by going to the section for Models and entering a new name for your model. Once a model has been added, click it in the list to edit.
When editing models, you can define if the model inherits properties from other models and what properties the model has. Properties are the slots where data is stored in records for those models. The ID Property is a property which is unique across all records in the model. If you do not choose an ID Property, a
uuid property will be created automatically.
neo4j-meta_model, opposite pair associations are always defined at the same time. The following diagram is used in a couple of places to describe associations.
In this case it indicates a many-to-many relationship where:
Personmodel has a
Gistmodel has a
WRITER_OFrelationship type is used to query the associations
gem 'neo4j-meta_model', require: 'neo4j/meta_model'
In your environment (
config/environments/development.rb for example)
config.neo4j.session_type = :server_db config.neo4j.session_path = 'http://localhost:7474'
mount Neo4j::MetaModel::Engine => "/mount/path"
This project rocks and uses MIT-LICENSE.