Project

locabulary

0.0
No release in over 3 years
An extraction of limited localized vocabulary for Sipity and CurateND.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Locabulary

Build Status Code Climate Test Coverage Dependency Status Documentation Status APACHE 2 License

An extraction of limited localized vocabulary for Sipity and CurateND. This controlled vocabulary has a limited shelf-life as we explore other more robust options.

Getting Started

At its core Locabulary provides a set of public methods that helps with building a list or hierarchy tree of controlled vocabularies.

The module methods marked @api public in the Locabulary top-level module are the public facing methods that both Sipity and CurateND utilize. They should not use any other methods of Locabulary.

As such, the implementation details of Locabulary are opaque to downstream dependencies.

Peeling the details back a bit, Locabulary provides several controlled vocabularies. You can find them in the ./data directory. By convention, the data file is the predicate_name of the term (e.g. the predicate_name: "copyright" will use the ./data/copyright.json data).

Everything else is about mapping and querying the JSON data.

Testing

Install the gems via BUNDLE_GEMFILE=gemfiles/activesupport4.gemfile bundle install

The full test suite is run via bundle exec rake.

If you are interested in running each file in isolation - a good thing for unit tests - use ./bin/rspec_isolated.

Testing/Using Different Gemfiles

If you want to run your tests via a different gemfile, see the following:

$ BUNDLE_GEMFILE=gemfiles/activesupport4.gemfile bundle update
$ BUNDLE_GEMFILE=gemfiles/activesupport4.gemfile bundle install
$ BUNDLE_GEMFILE=gemfiles/activesupport4.gemfile bundle exec rspec

See the Bundler bundle config documentation for further information.

Updating Data Files

The "administrative_units" data is maintained in a Google Spreadsheet. To synchronize the JSON data:

  1. Ensure that you have a copy of the config/client_secret.yml from the staging secrets
  2. Make sure you have a clean working tree (eg. git status shows no changes)
  3. Run bundle exec ./script/update_data_files.sh script following its instructions
  4. Review changes to the data/administrative_units.json file (eg. git diff)
  5. Commit changes

Once committed and pushed upstream, to see the changes will require a deploy of the applications.