Class: RDF::Literal::PositiveInteger

Inherits:
NonNegativeInteger show all
Defined in:
vendor/bundler/ruby/2.1.0/bundler/gems/rdf-xsd-8b9b0e49b1df/lib/rdf/xsd/integer.rb

Overview

positiveInteger is derived from nonNegativeInteger by setting the value of minInclusive to be 1. This results in the standard mathematical concept of the positive integer numbers. The value space of positiveInteger is the infinite set [1,2,...]. The base type of positiveInteger is nonNegativeInteger.

See Also:

Constant Summary

GRAMMAR =
/^\+?\d+$/.freeze
DATATYPE =
RDF::XSD.positiveInteger

Constants inherited from RDF::Literal

FALSE, TRUE, ZERO

Instance Attribute Summary

Attributes inherited from RDF::Literal

#datatype, #language

Instance Method Summary (collapse)

Methods inherited from Integer

#abs, #canonicalize!, #even?, #initialize, #nonzero?, #odd?, #pred, #round, #succ, #to_bn, #to_s, #zero?

Methods inherited from Decimal

#abs, #canonicalize!, #ceil, #floor, #initialize, #nonzero?, #round, #to_s, #zero?

Methods inherited from Numeric

#*, #+, #+@, #-, #-@, #/, #<=>, #==, #abs, #ceil, #floor, #round, #to_d, #to_f, #to_i, #to_r

Methods inherited from RDF::Literal

#==, #anonymous?, #canonicalize!, #comperable_datatype?, #eql?, #has_datatype?, #has_language?, #hash, #initialize, #inspect, #literal?, #object, #plain?, #simple?, #to_base, #to_s, #validate!, #value, #value_hash

Methods included from Term

#<=>, #==, #aggregate?, #compatible?, #eql?, #escape, #evaluate, #term?, #to_base, #to_term

Methods included from SPARQL::Algebra::Expression

cast, #constant?, #evaluate, extension, extensions, for, new, open, #optimize, parse, register_extension, #to_sxp_bin, #variable?

Methods included from Value

#anonymous?, #canonicalize, #canonicalize!, #constant?, #graph?, #inspect, #inspect!, #invalid?, #iri?, #list?, #literal?, #node?, #resource?, #statement?, #term?, #to_nquads, #to_ntriples, #to_rdf, #to_term, #type_error, #uri?, #validate!, #variable?

Constructor Details

This class inherits a constructor from RDF::Literal::Integer

Instance Method Details

- (Boolean) valid?

Returns:



135
136
137
# File 'vendor/bundler/ruby/2.1.0/bundler/gems/rdf-xsd-8b9b0e49b1df/lib/rdf/xsd/integer.rb', line 135

def valid?
  super && @object > 0
end