Skip to content

Instantly share code, notes, and snippets.

@Streamweaver
Streamweaver / gist:6381859
Last active December 21, 2015 23:19
This is an example of initializing an ActiveFedora RDFDatastream object with child nodes where the childnode rdf_subject is set with the URI provided in the id: attribute.
# Creating an object via the build method DOES NOT create an rdf_subject and treates
# child nodes as b-nodes no matter what I do.
bag = Bag.new
@mf = bag.fileManifest
@mf.title = "uva_uva_lib_1229365"
@mf.uri = "https://s3.amazonaws.com/aptrust_test_bags/uva_uva_lib_1229365"
@fi = @mf.files.build(
id: "https://s3.amazonaws.com/aptrust_test_bags/uva_uva_lib_1229365" # I've tried it as RDF::URI.new and RDF::Resource.new too.
format: "text/plain",
uri: "https://s3.amazonaws.com/aptrust_test_bags/uva_uva_lib_1229365/bagit.txt",