From b0ed07b9a91ebc792636d46e58bf6edf83b04b21 Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Thu, 13 Dec 2018 15:26:57 +0900 Subject: [PATCH] (chise-turtle-uri-encode-feature-name): Use "rdfs:comment" for `*note'. (concord-turtle-insert-feature-value): Insert main value before metadata. (concord-turtle-insert-char-ref): Modify spaces between `rdf:value' and value. (concord-turtle-insert-object-features): Likewise; use `rdfs:label' instead of `:unofficial-name'; modify other spaces. (concord-turtle-insert-prefix): Add "rdfs:" for the prefix for . --- concord-turtle-dump.el | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/concord-turtle-dump.el b/concord-turtle-dump.el index 195b6ac..f6f0b5e 100644 --- a/concord-turtle-dump.el +++ b/concord-turtle-dump.el @@ -273,6 +273,8 @@ "ideo:mistakable") ((eq 'hanyu-dazidian feature-name) "ideo:hanyu-dazidian") + ((eq '*note feature-name) + "rdfs:comment") (t (concat ":" (chise-turtle-uri-encode-ccs-name feature-name))))) @@ -701,19 +703,17 @@ (insert (format ":context domain:%-7s ;" (chise-turtle-uri-encode-ccs-name domain))) (setq lb t)) + (if lb + (insert (format "\n%s" indent))) + (insert "rdf:value ") + (setq lb (concord-turtle-insert-target-value value feature-name-base)) (setq rest metadata) (while rest (setq mdname (pop rest) mdval (pop rest)) - (if lb - (insert (format "\n%s" indent)) - (setq lb t)) - (unless (concord-turtle-insert-metadata mdname mdval) - (insert " ;"))) + (insert (format " ;\n%s" indent)) + (setq lb (concord-turtle-insert-metadata mdname mdval))) (if lb - (insert (format "\n%s" indent))) - (insert "rdf:value ") - (if (concord-turtle-insert-target-value value feature-name-base) (insert (format "\n%s] ;" indent0)) (insert " ] ;")) 'with-separator) @@ -739,7 +739,7 @@ (setq lb t)) (setq last-sep (cond ((eq mdname :value) - (insert "rdf:value ") + (insert "rdf:value ") (concord-turtle-insert-target-value mdval feature-name-base) ) (t @@ -773,7 +773,7 @@ skey dest-ccss ; sources required-features ccss eq-cpos-list - uri-ccs uri-cpos ccs-base children child-ccs-list col indent) + uri-ccs uri-cpos ccs-base children child-ccs-list col indent lb) (setq line-separator line-breaking) (setq id (concord-turtle-encode-object object)) (insert (format "%s" id)) @@ -796,7 +796,7 @@ (chise-turtle-uri-encode-ccs-name ccs-base) uri-cpos)) (insert " [ ") (setq col (current-column)) - (insert (format ":context domain:%-7s ;\n%srdf:value %7s:%-7s ] ;" + (insert (format ":context domain:%-7s ;\n%srdf:value %5s:%-7s ] ;" (chise-turtle-uri-encode-ccs-name domain) (make-string col ?\ ) (chise-turtle-uri-encode-ccs-name ccs-base) uri-cpos))) @@ -843,8 +843,8 @@ (insert (format "%s " line-separator)) (insert (format (if (> (+ (current-column) (length value)) 48) - ":unofficial-name %S ;" - ":unofficial-name %S ;") + "rdfs:label %S ;" + "rdfs:label %S ;") value)) (setq obj-spec (delete feature-pair obj-spec)) ) @@ -988,15 +988,16 @@ line-separator)) (setq col (current-column)) (setq indent (make-string col ?\ )) - (insert (format ":context domain:%-7s ;\n%srdf:value %S" + (insert (format ":context domain:%-7s ;\n%srdf:value " (chise-turtle-uri-encode-ccs-name domain) - indent radical)) + indent)) + (setq lb (concord-turtle-insert-radical radical)) (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)) - (concord-turtle-insert-metadata :sources value) + (insert (format "\n%s" indent)) + (setq lb (concord-turtle-insert-metadata :sources value)) ;; (insert (format " ;\n%s:sources (" indent)) ;; (setq col (current-column)) ;; (setq indent (make-string col ?\ )) @@ -1006,7 +1007,9 @@ ;; (insert " )") ) (setq obj-spec (delete feature-pair obj-spec)) - (insert " ] ;") + (if lb + (insert (format "\n%s] ;" (make-string (- col 2) ?\ ))) + (insert " ] ;")) ) (setq key (intern (format "%s@%s" 'ideographic-strokes domain))) (when (and (setq feature-pair (assq key obj-spec)) @@ -1016,7 +1019,7 @@ line-separator)) (setq col (current-column)) (setq indent (make-string col ?\ )) - (insert (format ":context domain:%-7s ;\n%srdf:value %S" + (insert (format ":context domain:%-7s ;\n%srdf:value %S" (chise-turtle-uri-encode-ccs-name domain) indent strokes)) (setq obj-spec (delete feature-pair obj-spec)) @@ -1042,7 +1045,7 @@ (insert (format "%s ideo:total-strokes [ " line-separator)) (setq col (current-column)) - (insert (format ":context domain:%-7s ;\n%srdf:value %S" + (insert (format ":context domain:%-7s ;\n%srdf:value %S" (chise-turtle-uri-encode-ccs-name domain) (make-string col ?\ ) value)) @@ -1190,7 +1193,7 @@ (setq ret (chise-split-ccs-name (nth 1 eq-cpos))) (insert (format "%s %s" line-breaking (car eq-cpos))) - (insert (format "%s %25s" line-breaking + (insert (format "%s %s" line-breaking (format ":%s-of" (nth 1 ret)))) (if (null (nth 2 ret)) (insert (format " %14s:%-7s ." @@ -1198,7 +1201,7 @@ (nth 1 (split-string (car eq-cpos) ":")))) (insert " [ ") (setq col (current-column)) - (insert (format ":context domain:%-7s ;\n%srdf:value %7s:%-7s ] ." + (insert (format ":context domain:%-7s ;\n%srdf:value %5s:%-7s ] ." (chise-turtle-uri-encode-ccs-name (nth 2 ret)) (make-string col ?\ ) (chise-turtle-uri-encode-ccs-name (car ret)) @@ -1222,6 +1225,7 @@ (defun concord-turtle-insert-prefix () (let (base-ccs-list ret) (insert "@prefix rdf: . +@prefix rdfs: . @prefix : . @prefix ideo: . @prefix isd: . -- 1.7.10.4