Class | Redland::Resource |
In: |
lib/rdf/redland/resource.rb
|
Parent: | Node |
include Redland
model | [R] | The internal model this Resource is connected to |
node | [R] | The internal librdf_node |
Create a Redland::Resource. Arg can be a String, or a Redland::Uri
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)
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
returns the RDF type of this Resource where RDF type is <www.w3.org/1999/02/22-rdf-syntax-ns#TYPE>
Sets the RDF type of this Resource where RDF type is <www.w3.org/1999/02/22-rdf-syntax-ns#TYPE>