Sha256: 20f1af166046e8a965732632f771ae0ba5f37dbe03f733d0285cc6acda9ae59d

Contents?: true

Size: 564 Bytes

Versions: 6

Compression:

Stored size: 564 Bytes

Contents

module RDFS
  
  # Helper Module that contains same additional methods that
  # are expected from classes that want to behave like
  # RDFS::Resource.
  #
  # The module expects that the including class has an uri
  # method or property.
  module ResourceLike
    
    # returns uri of resource, can be overridden in subclasses
    def to_s
      "<#{uri}>"
    end
    
    # overriding sort based on uri
    def <=>(other) 
      uri <=> other.uri
    end
    
    # NTriple representation of element
    def to_ntriple
      "<#{uri}>"
    end
    
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activerdf_net7-1.6.16 lib/active_rdf/objectmanager/resource_like.rb
activerdf_net7-1.6.15 lib/active_rdf/objectmanager/resource_like.rb
activerdf_net7-1.6.14 lib/active_rdf/objectmanager/resource_like.rb
activerdf_net7-1.6.13 lib/active_rdf/objectmanager/resource_like.rb
activerdf_net7-1.6.12 lib/active_rdf/objectmanager/resource_like.rb
activerdf_net7-1.6.11 lib/active_rdf/objectmanager/resource_like.rb