159: def add(s, p, o)
160: $activerdflog.debug "adding triple #{s} #{p} #{o}"
161:
162:
163: if s.nil? || p.nil? || o.nil?
164: $activerdflog.debug "cannot add triple with empty subject, exiting"
165: return false
166: end
167:
168: unless s.respond_to?(:uri) && p.respond_to?(:uri)
169: $activerdflog.debug "cannot add triple where s/p are not resources, exiting"
170: return false
171: end
172:
173: begin
174: @model.add(wrap(s), wrap(p), wrap(o))
175: save if ConnectionPool.auto_flush?
176: rescue Redland::RedlandError => e
177: $activerdflog.warn "RedlandAdapter: adding triple failed in Redland library: #{e}"
178: return false
179: end
180: end