From: MORIOKA Tomohiko Date: Fri, 15 Mar 2019 08:47:19 +0000 (+0900) Subject: (chise-turtle-uri-encode-feature-name): X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=7bca3e2c8bd714195d366515c849fa92e80a97c7;p=chise%2Ftomoyo-tools.git (chise-turtle-uri-encode-feature-name): - Use ":subsumed-in" for `<-subsumptive'. - Use ":unify" for `->denotational'. - Use ":unified-by" for `<-denotational'. - Use ":formed" for `->formed'. - Use "ideo:same" for `->same'. - Use "ideo:simplified-form" for `->simplified'. - Use "ideo:vulgar-form" for `->vulgar'. - Use "ideo:wrong-form" for `->wrong'. - Use "ideo:original-form" for `->original'. - Use "ideo:ancient-form" for `->ancient'. - Use "ideo:Small-Seal-form" for `->Small-Seal'. - Use "ideo:Small-Seal-form-of" instead of "ideo:Small-Seal-of" for `<-Small-Seal'. - Use "ideo:Oracle-Bone-character" for `->Oracle-Bones'. - Use "ideo:Oracle-Bone-character-of" for `<-Oracle-Bones'. - Use "ideo:interchangeable-form" instead of "ideo:interchangeable" for `->interchangeable'. - Use "ideo:interchangeable" for `<-interchangeable'. - Use "ideo:mistakable-character" instead of "ideo:mistakable" for `->mistakable'. - Use "ideo:mistakable-character-of" for `<-mistakable'. - Use ":reference" for `*references'. (concord-turtle-insert-relation-feature): Modify format of non-list value. (concord-turtle-insert-metadata): Use `concord-turtle-insert-references'. (concord-turtle-insert-references): New function. (concord-turtle-insert-target-value): Use `concord-turtle-insert-references' for `*references'. (concord-turtle-insert-object-features): Modify format of `<-denotational@component'; modify indent of total-strokes@domain*sources. --- diff --git a/concord-turtle-dump.el b/concord-turtle-dump.el index 90f504a..7449c94 100644 --- a/concord-turtle-dump.el +++ b/concord-turtle-dump.el @@ -193,34 +193,62 @@ (cond ((eq '->subsumptive feature-name) ":subsume") + ((eq '<-subsumptive feature-name) + ":subsumed-in") + ((eq '->denotational feature-name) + ":unify") ((eq '<-denotational feature-name) - ":denotation-of") + ":unified-by") + ((eq '->formed feature-name) + ":formed") ((eq '<-formed feature-name) ":form-of") + ((eq '->same feature-name) + "ideo:same") ((eq '<-same feature-name) "ideo:same-as") + ((eq '->simplified feature-name) + "ideo:simplified-form") ((eq '<-simplified feature-name) "ideo:simplified-form-of") + ((eq '->vulgar feature-name) + "ideo:vulgar-form") ((eq '<-vulgar feature-name) "ideo:vulgar-form-of") + ((eq '->wrong feature-name) + "ideo:wrong-form") ((eq '<-wrong feature-name) "ideo:wrong-form-of") + ((eq '->original feature-name) + "ideo:original-form") ((eq '<-original feature-name) "ideo:original-form-of") + ((eq '->ancient feature-name) + "ideo:ancient-form") ((eq '<-ancient feature-name) "ideo:ancient-form-of") + ((eq '->Small-Seal feature-name) + "ideo:Small-Seal-form") ((eq '<-Small-Seal feature-name) - "ideo:Small-Seal-of") - ((eq '<-interchangeable feature-name) - "ideo:interchangeable-form-of") + "ideo:Small-Seal-form-of") + ((eq '->Oracle-Bones feature-name) + "ideo:Oracle-Bone-character") + ((eq '<-Oracle-Bones feature-name) + "ideo:Oracle-Bone-character-of") ((eq '->interchangeable feature-name) + "ideo:interchangeable-form") + ((eq '<-interchangeable feature-name) "ideo:interchangeable") ((eq '->mistakable feature-name) - "ideo:mistakable") + "ideo:mistakable-character") + ((eq '<-mistakable feature-name) + "ideo:mistakable-character-of") ((eq 'hanyu-dazidian feature-name) "ideo:hanyu-dazidian") ((eq '*note feature-name) "rdfs:comment") + ((eq '*references feature-name) + ":reference") ((eq '*instance feature-name) ":instance") (t @@ -412,15 +440,19 @@ (defun concord-turtle-insert-relation-feature (char name value line-breaking ccss readable) - (insert (format " %s%s " - (chise-turtle-uri-encode-feature-name name) - line-breaking)) + (if (and (consp value) + (cdr value)) + (insert (format " %s%s " + (chise-turtle-uri-encode-feature-name name) + line-breaking)) + (insert (format " %-20s " + (chise-turtle-uri-encode-feature-name name)))) (concord-turtle-insert-relations value readable) (insert " ;") ) (defun concord-turtle-insert-metadata (name value) - (let (col indent ret) + (let (col indent) (insert (format "%-7s " name)) (cond ((or (eq name :sources) @@ -434,14 +466,7 @@ (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))) + (concord-turtle-insert-references value) nil) (t (insert (format "%S" value)) @@ -542,6 +567,17 @@ (insert " ;") 'with-separator)) +(defun concord-turtle-insert-references (value &optional readable) + (let (ret col indent) + (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))))) + (defun concord-turtle-insert-object (cell &optional readable) (if (integerp cell) (setq cell (decode-char '=ucs cell))) @@ -609,6 +645,9 @@ ((eq feature-name-base '=decomposition) (concord-turtle-insert-decomposition value readable) ) + ((eq feature-name-base '*references) + (concord-turtle-insert-references value readable) + ) ((or (eq feature-name-base 'ideographic-combination) (eq feature-name-base '*instance) (eq feature-name-base '<-formed) @@ -763,15 +802,15 @@ ccss readable) (setq obj-spec (delete feature-pair obj-spec)) ) - (when (and (setq feature-pair (assq '<-denotational@component obj-spec)) - (setq value (cdr feature-pair))) - (insert line-separator) - (concord-turtle-insert-relation-feature - object '<-denotational@component value - line-breaking - ccss readable) - (setq obj-spec (delete feature-pair obj-spec)) - ) + ;; (when (and (setq feature-pair (assq '<-denotational@component obj-spec)) + ;; (setq value (cdr feature-pair))) + ;; (insert line-separator) + ;; (concord-turtle-insert-relation-feature + ;; object '<-denotational@component value + ;; line-breaking + ;; ccss readable) + ;; (setq obj-spec (delete feature-pair obj-spec)) + ;; ) (when (and (setq feature-pair (assq 'name obj-spec)) (setq value (cdr feature-pair))) (insert (format "%s " line-separator)) @@ -989,19 +1028,18 @@ (insert (format "%s ideo:total-strokes [ " line-separator)) (setq col (current-column)) + (setq indent (make-string col ?\ )) (insert (format ":context domain:%-7s ;\n%srdf:value %S" (chise-turtle-uri-encode-ccs-name domain) - (make-string col ?\ ) + indent value)) (setq obj-spec (delete feature-pair obj-spec)) (setq skey (intern (format "%s*sources" key))) (when (and (setq feature-pair (assq skey obj-spec)) (setq value (cdr feature-pair))) - (insert (format " ;\n%s" indent)) + (insert (format " ;\n%s" indent)) (concord-turtle-insert-metadata :sources value) ;; (insert (format " ;\n%s:sources (" indent)) - ;; (setq col (current-column)) - ;; (setq indent (make-string col ?\ )) ;; (insert (format " chisebib:%s" (car value))) ;; (dolist (cell (cdr value)) ;; (insert (format "\n%s chisebib:%s" indent cell)))