No commit activity in last 3 years
No release in over 3 years
active_triples-mongoid provides a graph-based MongoDB persistence strategy for ActiveTriples.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

ActiveTriples::MongoidStrategy

Build Status Coverage Status Gem Version

Provides a graph-based persistence strategy for the ActiveTriples framework. RDF Sources are persisted to MongoDB natively as Flattened JSON-LD documents.

Installation

Add this line to your application's Gemfile:

gem 'active_triples-mongoid_strategy'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install active_triples-mongoid_strategy

Usage

Start by configuring Mongoid for your environment or application as per the documentation.

ActiveTriples currently (as of 0.8.1) uses an RDF::Repository as the default persistence strategy. To override this, you have to manually set MongoidStrategy on instances at runtime:

require 'active_triples/mongoid_strategy'

source = ActiveTriples::Resource.new
source.persistence_strategy # => #<ActiveTriples::RepositoryStrategy:...>

source.set_persistence_strategy(ActiveTriples::MongoidStrategy)
source.persistence_strategy # => #<ActiveTriples::MongoidStrategy:...>

See this gist for more information on Persistence Strategies.

History Tracking

MongoidStrategy optionally allows tracking history (aka 'versioning') to store changes in a graph's state over time. In order to use history tracking, use the ActiveTriples::MongoidStrategy::Trackable persistence strategy.

Contributing

Please observe the following guidelines:

  • Do your work in a feature branch based on master and rebase before submitting a pull request.
  • Write tests for your contributions.
  • Document every method you add using YARD annotations. (Note: Annotations are sparse in the existing codebase, help us fix that!)
  • Organize your commits into logical units.
  • Don't leave trailing whitespace (i.e. run git diff --check before committing).
  • Use well formed commit messages.