Sha256: 9b0141d7b78587cd62e5bdc4b665586dc068b39bddcf46fb82e18bf3d467d47d
Contents?: true
Size: 1.81 KB
Versions: 17
Compression:
Stored size: 1.81 KB
Contents
module RDF ## # An RDF term. # # Terms can be used as subjects, predicates, objects, and contexts of # statements. # # @since 0.3.0 module Term include RDF::Value include Comparable ## # Compares `self` to `other` for sorting purposes. # # Subclasses should override this to provide a more meaningful # implementation than the default which simply performs a string # comparison based on `#to_s`. # # @abstract # @param [Object] other # @return [Integer] `-1`, `0`, or `1` def <=>(other) self.to_s <=> other.to_s end ## # Compares `self` to `other` to implement RDFterm-equal. # # Subclasses should override this to provide a more meaningful # implementation than the default which simply performs a string # comparison based on `#to_s`. # # @abstract # @param [Object] other # @return [Integer] `-1`, `0`, or `1` # # @see http://www.w3.org/TR/rdf-sparql-query/#func-RDFterm-equal def ==(other) super end ## # Determins if `self` is the same term as `other`. # # Subclasses should override this to provide a more meaningful # implementation than the default which simply performs a string # comparison based on `#to_s`. # # @abstract # @param [Object] other # @return [Integer] `-1`, `0`, or `1` # # @see http://www.w3.org/TR/rdf-sparql-query/#func-sameTerm def eql?(other) super end ## # Returns `true` if this term is constant. # # @return [Boolean] `true` or `false` # @see #variable? def constant? !(variable?) end ## # Returns `true` if this term is variable. # # @return [Boolean] `true` or `false` # @see #constant? def variable? false end end # Term end # RDF
Version data entries
17 entries across 17 versions & 2 rubygems