본문 바로가기

DB&Hibernate

SDB table DDL 스키마 쿼리(Mysql, Mariadb 용)

반응형
1) Nodes table 생성 쿼리
 CREATE TABLE `nodes` (

  `hash` bigint(20) NOT NULL,

  `lex` text DEFAULT NULL,

  `lang` varchar(10) DEFAULT NULL,

  `datatype` varchar(200) DEFAULT NULL,

  `type` int(11) DEFAULT NULL,

  PRIMARY KEY (`hash`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Nodes table for jena sdb'

2) Nodes table 생성 쿼리
CREATE TABLE `prefixes` (

  `prefix` varchar(50) NOT NULL,

  `uri` varchar(500) DEFAULT NULL,

  PRIMARY KEY (`prefix`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Prefixse table for jena sdb'

3) Nodes table 생성 쿼리
CREATE TABLE `quads` (

  `g` bigint(20) NOT NULL,

  `s` bigint(20) NOT NULL,

  `p` bigint(20) NOT NULL,

  `o` bigint(20) NOT NULL,

  PRIMARY KEY (`g`,`s`,`p`,`o`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Quads table for jena sdb'

4) Nodes table 생성 쿼리
CREATE TABLE `triples` (

 `s` bigint(11) NOT NULL,

  `p` bigint(11) NOT NULL,

  `o` bigint(11) NOT NULL,

  PRIMARY KEY (`s`,`p`,`o`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Triples for jena sdb	'