Class Redland::Resource
In: lib/rdf/redland/resource.rb
Parent: Node

include Redland

Methods

Attributes

model  [R]  The internal model this Resource is connected to
node  [R]  The internal librdf_node

Public Class methods

Public Instance methods

Adds a statement to the model with the subject as the resource and p as the predicate and o as the object same as Model.add(this,p,o)

Removes all of the properties from the model with this resource as the subject

Removes the property from the model with the predicate pred and optional context

Answer model.find(self,pred,nil) in the associated model If no predicate or block given, returns and array of statements matching model.find(self,nil,nil) If block_given? yields the predicate and the object

  resource.get_properties() do |p,o|
    puts "<td>#{p}</td><td>#{o}</td>"
  end

If pred given, answers model.find(self,pred,nil) if no block return an array of the object values

  nicknames = resource.get_properties(FOAF::NICK)

if block_given yields the objects which satisfy the predicate

  puts "Nicknames are"
    resource.get_properties(FOAF_NICK){|o| puts o}

Answer model.find(self,p,nil) in the associated model. If there are several such statements, any one of them may be returned

Finds all objects of a given predicate. Takes an optional block, yielding each statement if given.

Defines a context for this resource

returns the RDF type of this Resource where RDF type is <www.w3.org/1999/02/22-rdf-syntax-ns#TYPE>

Determine if this resource is of a given type

Change the value of the given property

[Validate]