;;; char-db-turtle.el --- Character Database utility -*- coding: utf-8-er; -*-
-;; Copyright (C) 2017 MORIOKA Tomohiko.
+;; Copyright (C) 2017, 2018 MORIOKA Tomohiko.
;; Author: MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
;; Keywords: CHISE, Character Database, RDF, Turtle, ISO/IEC 10646, UCS, Unicode, MULE.
=ucs-itaiji-004
=ucs-itaiji-005
=ucs-itaiji-006
+ =ucs-itaiji-007
+ =ucs-itaiji-008
+ =ucs-itaiji-009
+ =ucs-itaiji-010
+ =ucs-itaiji-011
=ucs-itaiji-084
=ucs-var-001
=ucs-var-002
+ =ucs-var-003
=ucs-var-004
+ =ucs-var-005
+ =ucs-var-006
+ =ucs-var-008
+ =ucs-var-010
=cns11643-1 =cns11643-2 =cns11643-3
=cns11643-4 =cns11643-5 =cns11643-6 =cns11643-7
=gb2312
=ucs@unicode
=ucs@JP/hanazono
=gb12345
+ =ucs@cns
+ =ucs@gb
=zinbun-oracle =>zinbun-oracle
=daikanwa
=ruimoku-v6
=cbeta =jef-china3
- =shinjigen@1ed
- =shinjigen/+p@rev
+ =daikanwa/+2p
=+>ucs@iso =+>ucs@unicode
=+>ucs@jis
=+>ucs@cns
=+>ucs@ks
+ =+>ucs@jis/1990
=>mj
=>jis-x0208 =>jis-x0213-1
=>jis-x0208@1997
=>ucs@iwds-1
+ =>ucs@cognate
=>ucs@component
=>iwds-1
=>ucs@iso
=>gt-k
=>>ucs@iso =>>ucs@unicode
=>>ucs@jis =>>ucs@cns =>>ucs@ks
+ =>>mj
=>>gt-k
+ =>>hanyo-denshi/ks
==mj
==ucs@iso
==ucs@unicode
==gt
==cns11643-1 ==cns11643-2 ==cns11643-3
==cns11643-4 ==cns11643-5 ==cns11643-6 ==cns11643-7
+ ==jis-x0212
==ucs@cns
- ==gt-k
==koseki
+ ==daikanwa
+ ==gt-k
+ ==ucs@gb
+ ==ucs-itaiji-001
+ ==ucs-itaiji-002
+ ==ucs-itaiji-003
+ ==ucs-itaiji-005
+ ==ucs-itaiji-006
+ ==ucs-var-002
==ucs@JP/hanazono
- ==shinjigen
- ==shinjigen@rev
- ==daikanwa/+p
+ ==daikanwa/+2p
=>>jis-x0208 =>>jis-x0213-1 =>>jis-x0213-2
=+>jis-x0208 =+>jis-x0213-1 =+>jis-x0213-2
=+>hanyo-denshi/jt
=jis-x0208@1983 =jis-x0208@1978
=>ucs-itaiji-001
=>ucs-itaiji-002
+ =>ucs-itaiji-003
+ =>ucs-itaiji-004
=>ucs-itaiji-005
+ =>ucs-itaiji-006
+ =>ucs-itaiji-007
+ =>ucs-itaiji-001@iwds-1
==>ucs@bucs
=big5
=>cbeta
===gt
===gt-k
===ucs@ks
+ ===ucs@gb
+ =shinjigen
+ =shinjigen@rev
+ =shinjigen@1ed
+ =shinjigen/+p@rev
+ ==shinjigen
+ ==shinjigen@rev
+ ==daikanwa/+p
+ ==shinjigen@1ed
===daikanwa/+p
+ =>daikanwa/ho
===daikanwa/ho
))
"._.")
((eq c ?=)
".:.")
+ ((eq c ?|)
+ "._cmp_.")
(t
(char-to-string c))))
(www-uri-encode-feature-name feature-name)
":denotation-of")
((eq '<-formed feature-name)
":form-of")
+ ((eq '<-same feature-name)
+ "ideo:same-as")
+ ((eq '<-simplified feature-name)
+ "ideo:simplified-form-of")
+ ((eq '<-vulgar feature-name)
+ "ideo:vulgar-form-of")
+ ((eq '<-wrong feature-name)
+ "ideo:wrong-form-of")
+ ((eq '<-original feature-name)
+ "ideo:original-form-of")
+ ((eq '<-ancient feature-name)
+ "ideo:ancient-form-of")
+ ((eq '<-Small-Seal feature-name)
+ "ideo:Small-Seal-of")
+ ((eq '<-interchangeable feature-name)
+ "ideo:interchangeable-form-of")
+ ((eq '->interchangeable feature-name)
+ "ideo:interchangeable")
+ ((eq '->mistakable feature-name)
+ "ideo:mistakable")
((eq 'hanyu-dazidian feature-name)
"ideo:hanyu-dazidian")
(t
(defun chise-turtle-encode-char (object)
(let ((ccs-list est-coded-charset-priority-list)
- ccs ret)
+ ccs ret ret2)
(if (setq ret (encode-char object '=ucs))
(chise-turtle-format-ccs-code-point '=ucs ret)
(while (and ccs-list
(setq ret (encode-char object ccs)))
(chise-turtle-format-ccs-code-point ccs ret)
)
+ ((setq ret (get-char-attribute object 'ideographic-combination))
+ (format "ideocomb:%s"
+ (mapconcat (lambda (cell)
+ (cond ((characterp cell)
+ (char-to-string cell)
+ )
+ ((setq ret2 (find-char cell))
+ (char-to-string ret2)
+ )
+ (t
+ (format "%S" cell)
+ )))
+ ret ""))
+ )
(t
(format (if est-hide-cgi-mode
"system-char-id=0x%X"
)
(defun char-db-turtle-insert-metadata (name value)
- (let (col indent)
+ (let (col indent ret)
(insert (format "%-7s " name))
(cond
((or (eq name :sources)
(insert (format " ,\n%schisebib:%s" indent
(chise-turtle-uri-encode-ccs-name source))))
nil)
+ ((eq name :references)
+ (setq ret (car value))
+ (setq ret (plist-get (nth 1 ret) :ref))
+ (setq col (current-column))
+ (setq indent (make-string col ?\ ))
+ (insert (format "<%s>" ret))
+ (dolist (refspec (cdr value))
+ (setq ret (plist-get (nth 1 refspec) :ref))
+ (insert (format " ,\n%s<%s>" indent ret)))
+ nil)
(t
(insert (format "%S" value))
nil))))
(defun char-db-turtle-insert-source-list (value &optional readable)
(let (lbs separator rest cell al cal key ret)
- (setq lbs (concat "\n" (make-string (current-column) ?\ ))
+ (setq lbs (concat " ,\n" (make-string (current-column) ?\ ))
separator nil)
(while (consp value)
(setq cell (car value))
(setq separator (format " ,%s" lbs)))
(if (characterp cell)
(insert (format "%-20s" (chise-turtle-encode-char cell)))
- (char-db-turtle-insert-char-ref cell 'ideographic-combination))
+ (char-db-turtle-insert-char-ref cell '<-formed))
(setq value (cdr value)))
nil))
)
((or (eq feature-name-base 'ideographic-combination)
(eq feature-name-base '=decomposition)
+ (eq feature-name-base '<-formed)
(string-match "^\\(->\\|<-\\)[^*]*$" (symbol-name feature-name-base)))
(char-db-turtle-insert-relations value readable)
)
line-separator))
(setq col (current-column))
(insert (format ":context domain:%-7s ;\n%s:target %S"
- domain
+ (chise-turtle-uri-encode-ccs-name domain)
(make-string col ?\ )
value))
(setq attributes (delq key attributes))
))
)
((eq name 'ideographic-structure)
- (insert (isd-turtle-format-char nil nil value nil
+ (insert (isd-turtle-format-char nil nil value (/ column 4)
'isd 'without-head-char))
(insert " ;")
)
@prefix chisegg: <http://rdf.chise.org/rdf/type/character/ggg/> .
@prefix domain: <http://rdf.chise.org/data/domain/> .
@prefix script: <http://rdf.chise.org/data/script/> .
+@prefix ideocomb: <http://rdf.chise.org/data/character/ideo/combination/> .
@prefix chisebib: <http://rdf.chise.org/data/bibliography/> .
@prefix ruimoku: <http://www.chise.org/est/view/article@ruimoku/rep.id=/> .
@prefix zob1959: <http://chise.zinbun.kyoto-u.ac.jp/koukotsu/rubbings/> .