#encoding=utf-8 basic = [] yago = [] b = 0 y = 100000 ''' In dbpedia dataset we use two sorts of type: yago type and basic type yago type refers to type with yago prefix basic type refers to objects pointed to by rdf:type this script divide this two kinds of types into different files. ''' with open('type id file here') as f: for line in f: dou = line[:-1].split('\t') if dou[0][:6] == '