Sha256: df6492c361ab8c50d1eac6eff9edff81be9f683325eca11f32ce1b1bf8289631

Contents?: true

Size: 741 Bytes

Versions: 41

Compression:

Stored size: 741 Bytes

Contents

module ActiveFedora
  module RdfObject
    extend ActiveSupport::Concern

    included do
      include RdfNode
      attr_reader :rdf_subject, :graph
    end

    def graph
      @graph ||= RDF::Graph.new
      @graph 
    end


    def initialize(graph, subject=nil)
      subject ||= RDF::Node.new
      @graph = graph
      @rdf_subject = subject
      insert_type_assertion
    end

    def get_values(subject, predicate)
      predicate = find_predicate(predicate) unless predicate.kind_of? RDF::URI
      return TermProxy.new(@graph, @subject, predicate)
    end

    private
    
    def insert_type_assertion
      rdf_type = self.class.rdf_type
      @graph.insert([@rdf_subject, RDF.type, rdf_type]) if rdf_type
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
active-fedora-5.7.1 lib/active_fedora/rdf_object.rb
active-fedora-5.7.0 lib/active_fedora/rdf_object.rb
active-fedora-6.4.4 lib/active_fedora/rdf_object.rb
active-fedora-6.4.3 lib/active_fedora/rdf_object.rb
active-fedora-6.4.2 lib/active_fedora/rdf_object.rb
active-fedora-6.4.1 lib/active_fedora/rdf_object.rb
active-fedora-6.4.0 lib/active_fedora/rdf_object.rb
active-fedora-6.4.0.rc4 lib/active_fedora/rdf_object.rb
active-fedora-6.4.0.rc3 lib/active_fedora/rdf_object.rb
active-fedora-6.4.0.rc2 lib/active_fedora/rdf_object.rb
active-fedora-6.4.0.rc1 lib/active_fedora/rdf_object.rb
active-fedora-6.3.0 lib/active_fedora/rdf_object.rb
active-fedora-6.2.0 lib/active_fedora/rdf_object.rb
active-fedora-6.1.1 lib/active_fedora/rdf_object.rb
active-fedora-6.1.0 lib/active_fedora/rdf_object.rb
active-fedora-5.6.3 lib/active_fedora/rdf_object.rb
active-fedora-6.0.0 lib/active_fedora/rdf_object.rb
active-fedora-6.0.0.rc7 lib/active_fedora/rdf_object.rb
active-fedora-6.0.0.rc6 lib/active_fedora/rdf_object.rb
active-fedora-6.0.0.rc5 lib/active_fedora/rdf_object.rb