私はPythonで以下のコードを持っています:
import RDF
parser = RDF.Parser()
model=RDF.Model()
stream=parser.parse_into_model(model,"file:./zoo/zoo.rdf")
list = []
for triple in model:
print triple.subject, triple.predicate, triple.object
list.append([ triple.subject , triple.predicate , triple.object ] )
print len(list)
for k in list:
print k
最初のループでは、rdf のステートメントは正しく出力されますが、2 番目のステートメントでは、各要素のアドレスが出力されます。
< RDF.Node object at 0x7eec158c>, < RDF.Node object at 0x7eec1b2c>, < RDF.Node object at
0x7eec1b8c>
< RDF.Node object at 0x7eec146c>, < RDF.Node object at 0x7eec606c>, < RDF.Node object at 0x7eec612c>
. . .
ステートメントを印刷する代わりに、なぜこれが起こったのですか?