我使用Ontonotes数据库工具,但遇到了问题。
我阅读了它的文档,它说这个工具在mysql 5.0上运行良好。但是,我找不到这个版本。所以,我安装了mysql 5.7。出现此问题,问题是这样的:
python on/tools/init_db.py --init ontonotes localhost root ontonotes-release-4.0/
初始化DB ...
/Users/anaconda/lib/python2.7/site-packages/on/的初始化的.py:525: 警告:未知表'ontonotes.tree'cursor.execute(“”“删除表 如果存在%s;“”“%thing.sql_table_name”
create table tree
(
id varchar(255) not null collate utf8_bin primary key,
parent_id varchar(255),
document_id varchar(255),
word varchar(255),
child_index int,
start int not null,
end int not null,
coref_section int not null,
syntactic_link_type varchar(255),
tag varchar(255) not null,
part_of_speech varchar(255),
phrase_type varchar(255),
function_tag_id varchar(255),
string longtext,
no_trace_string longtext,
parse longtext,
foreign key (parent_id) references tree.id,
foreign key (document_id) references document.id,
foreign key (syntactic_link_type) references syntactic_link_type.id,
foreign key (part_of_speech) references pos_type.id,
foreign key (phrase_type) references phrase_type.id,
foreign key (function_tag_id) references compound_function_tag.id
)
default character set utf8;
Traceback(最近一次调用最后一次):文件“on / tools / init_db.py”,行 81,在 on.ontonotes.initialize_db(a_cursor)文件“/Users/anaconda/lib/python2.7/site-packages/on/init.py”,行 528,在initialize_db中 cursor.execute(thing.sql_create_statement)文件“/Users/anaconda/lib/python2.7/site-packages/MySQLdb/cursors.py”,行 205,执行中 self.errorhandler(self,exc,value)文件“/Users/anaconda/lib/python2.7/site-packages/MySQLdb/connections.py”, 第36行,在defaulterrorhandler中 提出错误类,错误值 _mysql_exceptions.IntegrityError:(1215,'无法添加外键约束')
并且已经创建了三个表:
create table ontonotes
(
id varchar(255) not null primary key
)
default character set utf8;
create table subcorpus
(
id varchar(255) not null primary key,
base_dir varchar(255) not null,
top_dir varchar(255) not null,
root_dir varchar(255) not null,
language_id varchar(255) not null,
encoding_id varchar(255) not null,
ontonotes_id varchar(255) not null
)
default character set utf8;
create table file
(
id varchar(255) not null primary key,
base_dir varchar(255) not null,
physical_filename varchar(255) not null,
document_id varchar(255) not null,
file_type varchar(255) not null,
subcorpus_id varchar(255) not null
)
default character set utf8;
我真的不知道如何解决这个问题,因为我对mysql不熟悉。有人可以帮帮我,还是给我一个mysql 5.0版本(linux 64bit / mac 64bit)?非常想你!