Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Fcrepo4 and LDP from RDF::Vocab instead of local versions #887

Merged
merged 1 commit into from
Aug 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/active_fedora/clean_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ def get(*args)

def omit_uris
[
RDF::Fcrepo4.ServerManaged,
RDF::Ldp.PreferContainment,
RDF::Ldp.PreferEmptyContainer,
RDF::Ldp.PreferMembership
::RDF::Vocab::Fcrepo4.ServerManaged,
::RDF::Vocab::LDP.PreferContainment,
::RDF::Vocab::LDP.PreferEmptyContainer,
::RDF::Vocab::LDP.PreferMembership
]
end

Expand Down
4 changes: 2 additions & 2 deletions lib/active_fedora/fedora_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ module FedoraAttributes
delegate :rdf_subject, :get_values, :type, to: :resource

property :has_model, predicate: ActiveFedora::RDF::Fcrepo::Model.hasModel
property :create_date, predicate: ActiveFedora::RDF::Fcrepo4.created
property :modified_date, predicate: ActiveFedora::RDF::Fcrepo4.lastModified
property :create_date, predicate: ::RDF::Vocab::Fcrepo4.created
property :modified_date, predicate: ::RDF::Vocab::Fcrepo4.lastModified

def create_date
super.first
Expand Down
2 changes: 1 addition & 1 deletion lib/active_fedora/file/attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def original_name= name
def digest
response = metadata.ldp_source.graph.query(predicate: RDF::Vocab::PREMIS.hasMessageDigest)
# fallback on old predicate for checksum
response = metadata.ldp_source.graph.query(predicate: ActiveFedora::RDF::Fcrepo4.digest) if response.empty?
response = metadata.ldp_source.graph.query(predicate: RDF::Vocab::Fcrepo4.digest) if response.empty?
response.map(&:object)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/active_fedora/fixity_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def check
end

def status
fixity_graph.query(predicate: ActiveFedora::RDF::Fcrepo4.status).map(&:object).first.to_s
fixity_graph.query(predicate: ::RDF::Vocab::Fcrepo4.status).map(&:object).first.to_s
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/active_fedora/inbound_relation_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def get(*args)

def include_uris
[
RDF::Fcrepo4.InboundReferences
::RDF::Vocab::Fcrepo4.InboundReferences
]
end
end
Expand Down
2 changes: 0 additions & 2 deletions lib/active_fedora/rdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ module RDF
extend ActiveSupport::Autoload
autoload :DatastreamIndexing
autoload :Fcrepo
autoload :Fcrepo4
autoload :Ldp
autoload :IndexingService
autoload :Identifiable
autoload :Persistence
Expand Down
13 changes: 0 additions & 13 deletions lib/active_fedora/rdf/fcrepo4.rb

This file was deleted.

9 changes: 0 additions & 9 deletions lib/active_fedora/rdf/ldp.rb

This file was deleted.

6 changes: 3 additions & 3 deletions lib/active_fedora/versions_graph.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def with_label label
end

def resources
query(predicate: ActiveFedora::RDF::Fcrepo4.hasVersion)
query(predicate: ::RDF::Vocab::Fcrepo4.hasVersion)
end

private
Expand All @@ -44,11 +44,11 @@ def version_from_resource statement
end

def label_query statement
query(subject: statement.object).query(predicate: ActiveFedora::RDF::Fcrepo4.hasVersionLabel).first.object.to_s
query(subject: statement.object).query(predicate: ::RDF::Vocab::Fcrepo4.hasVersionLabel).first.object.to_s
end

def created_query statement
query(subject: statement.object).query(predicate: ActiveFedora::RDF::Fcrepo4.created).first.object.to_s
query(subject: statement.object).query(predicate: ::RDF::Vocab::Fcrepo4.created).first.object.to_s
end

def fedora_versions
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
context "with pre-4.3.0 predicate" do
before do
graph = ActiveTriples::Resource.new
graph << RDF::Statement.new(file.uri, ActiveFedora::RDF::Fcrepo4.digest, RDF::URI.new("urn:sha1:f1d2d2f924e986ac86fdf7b36c94bcdf32beec15"))
graph << RDF::Statement.new(file.uri, RDF::Vocab::Fcrepo4.digest, RDF::URI.new("urn:sha1:f1d2d2f924e986ac86fdf7b36c94bcdf32beec15"))
allow(file).to receive_message_chain(:metadata, :ldp_source, :graph).and_return(graph)
end
it "falls back on fedora:digest if premis:hasMessageDigest is not present" do
Expand Down