# File lib/activerdf_rdflite/rdflite.rb, line 129 129: def add(s,p,o,c=nil) 130: # check illegal input 131: raise(ActiveRdfError, "adding non-resource #{s} while adding (#{s},#{p},#{o},#{c})") unless s.respond_to?(:uri) 132: raise(ActiveRdfError, "adding non-resource #{p} while adding (#{s},#{p},#{o},#{c})") unless p.respond_to?(:uri) 133: 134: triple = [s, p, o].collect{|r| serialise(r) } 135: add_ntriples(triple.join(' ') + " .\n", serialise(c) ) 136: 137: ## get internal representation (array) 138: #quad = [s,p,o,c].collect {|r| internalise(r) } 139: 140: ## insert the triple into the datastore 141: #@db.execute('insert into triple values (?,?,?,?)', *quad) 142: 143: ## if keyword-search available, insert the object into keyword search 144: #@ferret << {:subject => s, :object => o} if keyword_search? 145: end