Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

active_fedora_relsint

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

active_fedora_relsint

  • 0.4.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

h1. ActiveFedora::RelsInt !https://travis-ci.org/projecthydra/active_fedora_relsint.png?branch=master!:https://travis-ci.org/projecthydra/active_fedora_relsint !https://badge.fury.io/rb/active_fedora_relsint.png!:http://badge.fury.io/rb/active_fedora_relsint A mixin for ActiveFedora to allow use and updating of the RELS-INT datastream.

RELS-INT is similar to RELS-EXT: A shallow (depth = 1) XML serialization of a RDF graph. However, the subjects of triples in the RELS-INT graph are an object's datastreams.

For example, consider a Fedora object with a PID of 'test:1' that hold a TIFF image in a datastream called 'content'. You may add various derivative images in additional datastreams, but feel that relying on encoded datastream IDs is too fragile an approach to indicating their relationship to 'content'. You may indicate these relationships in a RELS-INT like the below:

bc. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="info:fedora/test:1/content"> 2400 1600 </rdf:Description> <rdf:Description rdf:about="info:fedora/test:1/ds1"> 150 100 </rdf:Description> <rdf:Description rdf:about="info:fedora/test:1/ds2"> 1500 1000 </rdf:Description> </rdf:RDF>

Then with a supporting ActiveFedora model:

bc. class GenericImage < ActiveFedora::Base include ActiveFedora::RelsInt end

You can identify the thumbnail image by querying the RELS-INT graph:

bc. my_obj = GenericImage.find('test:1') statement = my_obj.rels_int.relationships(my_obj.datastreams['content'],"http://xmlns.com/foaf/0.1/thumbnail").first unless statement.nil? dsid = statement.object.to_s.split('/')[-1] # this will be a RDF::Statement thumb_ds = my_obj.datastreams[dsid] end

You can also add or delete statements to the RELS-INT graph as tested in spec/unit/relsint_spec.rb

Note that the RELS-INT datastream is not able to monitor the object, so datastream deletions would require a seperate removal of the deleted datastreams subgraph in RELS-INT.

FAQs

Package last updated on 07 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc