Module: RDF::Resource

Includes:
Term
Included in:
Node, Statement, URI, Vocabulary::Term
Defined in:
vendor/bundler/ruby/3.3.0/bundler/gems/rdf-196b73b4a78a/lib/rdf/model/resource.rb

Overview

An RDF resource.

Constant Summary

Constants included from SPARQL::Algebra::Expression

SPARQL::Algebra::Expression::PATTERN_PARENTS

Constants included from Util::Logger

Util::Logger::IOWrapper

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Term

#<=>, #==, #aggregate?, #as_datetime, #as_number, #compatible?, #eql?, #escape, #evaluate, #ndvars, #optimize, #sameTerm?, #term?, #terms, #to_base, #to_sparql, #to_term, #vars

Methods included from SPARQL::Algebra::Expression

cast, #constant?, #evaluate, extension, extension?, extensions, for, #invalid?, #node?, open, #optimize, #optimize!, parse, register_extension, #to_sxp_bin, #valid?, #validate!, #variable?

Methods included from Util::Logger

#log_debug, #log_depth, #log_error, #log_fatal, #log_info, #log_recover, #log_recovering?, #log_statistics, #log_warn, #logger

Methods included from Value

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

Class Method Details

.new(*args, &block) ⇒ RDF::Resource

Instantiates an Node or an URI, depending on the given argument.

Returns:



12
13
14
15
16
17
18
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-196b73b4a78a/lib/rdf/model/resource.rb', line 12

def self.new(*args, &block)
  case arg = args.shift
    when Symbol     then Node.intern(arg, *args, &block)
    when /^_:(.*)$/ then Node.new($1, *args, &block)
    else URI.new(arg, *args, &block)
  end
end

Instance Method Details

#resource?Boolean

Returns true to indicate that this value is a resource.

Returns:

  • (Boolean)


24
25
26
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-196b73b4a78a/lib/rdf/model/resource.rb', line 24

def resource?
  true
end