def get_triples2(self):
instance_triple = []<EOL>relation_triple = []<EOL>for i in range(len(self.nodes)):<EOL><INDENT>instance_triple.append(("<STR_LIT>", self.nodes[i], self.node_values[i]))<EOL>for l in self.relations[i]:<EOL><INDENT>relation_triple.append((l[<NUM_LIT:0>], self.nodes[i], l[<NUM_LIT:1>]))<EOL><DEDENT>for l in self.attributes[i]:<EOL><INDENT>relation_triple.append((l[<NUM_LIT:0>], self.nodes[i], l[<NUM_LIT:1>]))<EOL><DEDENT><DEDENT>return instance_triple, relation_triple<EOL>
Get the triples in two lists:
instance_triple: a triple representing an instance. E.g. instance(w, want-01)
relation_triple: a triple representing all relations. E.g arg0 (w, b) or E.g. polarity(w, - )
Note that we do not differentiate between attribute triple and relation triple. Both are considered as relation
triples.
All triples are represented by (triple_type, argument 1 of the triple, argument 2 of the triple)