本体存储 mysql 意义_风落沙--用MySQL存储本体

首先要安装好MySQL服务器,然后建立一个数据库,如OntologyDB。再建立一个用户如OntologyDBUser,并给予其对数据库OntologyDB的所有操作权限。然后下载MySQL的JDBC驱动程序mysql-connector-java-3.1.12.zip,解压后将其中的mysql-connector-java-3.1.12-bin.jar改名为Driver.jar并将其COPY到Protege 3.1的安装目录中。

进入Protege,打开本体工程文件,然后选择文件菜单中的Convert Project to Format,选择在弹出的对话框中选择OWL Database。然后在弹出的对话框中按如下内容填写:

Project ---- 项目名称,自己定;

JDBC Driver Class Name ---- com.mysql.jdbc.Driver

JDBC URL ---- jdbc:mysql://localhost/OntologyDB

Table ---- OntologyDB数据库中用于存储本体的表,如OntologyTable

Username ---- OntologyDBUser

Password ---- OntologyDBUser

OK以后本体就存储到MySQL中了,可以打开Query Browser看一下。表中每个Column均为Protege预定义,其含义如下(来自http://protege.stanford.edu/doc/design/jdbc_backend.html):

Column

Description

Can be null

Can be empty

frame

[integer]

frame id Frame ID's < 10000 are reserved for the system. The frame ids for system frames are declared in the file: edu.stanford.smi.protege.model.Model.java

No

No

frame_type

[smallint]

same as "value_type" but for the frame column

No

No

slot

[integer]

slot frame id

No

No

facet

[integer]

facet frame id (0 if not a facet value)

No

No

is_template

[smallint]

0 => value is OKBC "own", 1 => value is OKBC "template"

No

No

value_index

[integer]

number used to maintain relative ordering of slot_or_facet_value entries for a frame-slot(-facet) combination

No

No

value_type

[smallint]

number used to indicate the "type" of the value stored in slot_or_facet_value.  The number-to-type conversion is given in the file: edu.stanford.smi.protege.storage.database.DatabaseUtils.java

No

No

slot_or_facet_value

[varchar(N)]

facet value if facet is not 0, slot value otherwise. Holds values of length that will fit in a varchar (typically <= 255)

Yes

No

long_slot_or_facet_value

[longvarchar]

same as slot_or_facet_value but holds values too long to fit in slot_or_facet_value

Yes

No

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值