Tame your RDF Metadata with ActiveFedora

Andrew Myers edited this page Apr 13, 2015 · 15 revisions

Tame your RDF Metadata with ActiveFedora

This Tutorial is known to work with ActiveFedora version 9.0.0.
Please update this wiki to reflect any other versions that have been tested.


Disclaimer: This is not an introductory RDF primer, nor is it an introduction to the rdf.rb gem. It assumes that you know how to read RDF and understand how to manipulate RDF graphs with the rdf.rb gem. If you are comfortable with both Ruby and RDF (even if you haven't looked at rdf.rb), you will probably be comfortable with this tutorial, but might want to reference the rdf.rb API docs when it comes to understanding how graph operations are performed underneath the hood.

Note: When we show examples of RDF graphs, we mainly use n-triples

Note: All of the code used in this tutorial is currently part of the active-fedora gem and the modules are namespaced within the ActiveFedora namespace (ie. ActiveFedora::RdfNode). This is because the code was all written by & for people using Fedora. However, internally, these modules do not have any dependencies on active-fedora or Fedora. If you want to use the functionality outside of active-fedora, we would not be opposed to someone splitting it out into a separate gem similar to om (possibly call it om-rdf) and fix the namespaces to suit. In fact, if you speak up requesting it, one of the existing maintainers might do it.


  • Define Ruby Classes for Creating, Parsing and Manipulating RDF Metadata
  • Declare & Use your own Vocabularies of RDF predicates alongside the default Vocabularies provided by rdf.rb
  • Define Ruby Classes that Create, Parse and Manipulate heterogeneous graphs of linked RDF Nodes
  • Use your Ruby Classes to Parse and edit existing RDF documents
  • Put your RDF into Fedora Datastreams and Retrieve it from Fedora Datastreams


  1. Lesson: Install ActiveFedora
  2. Lesson: Use RDF to Represent Flat Metadata like Dublin Core (AF7)
  3. Lesson: Define a custom Vocabulary
  4. Lesson: Define a Complex Network of Related RDF Types
  5. Lesson: Using Rails Nested Attributes behavior to modify Nested Nodes
  6. Lesson: Use Rails fields_for helper to Create Forms that Edit Complex Nested RDF Graphs
  7. Lesson: Write your RDF into Fedora Datastreams
  8. Lesson: Control Indexing of your RDF metadata
  9. Lesson: Using typed predicates in your models

Next Steps

If you're using Hydra, return to the Dive into Hydra tutorial.
If you're using XML Metadata, check out the Tame your XML with OM tutorial.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.