(chise-turtle-encode-char): Add code for `ideographic-combination'.
authorMORIOKA Tomohiko <tomo.git@chise.org>
Mon, 24 Apr 2017 07:52:50 +0000 (16:52 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Mon, 24 Apr 2017 07:52:50 +0000 (16:52 +0900)
(char-db-turtle-insert-relations): Use `<-formed' instead of
`ideographic-combination' to represent relation features.
(char-db-turtle-insert-target-value): Add shortcut condition for
`<-formed'.
(char-db-turtle-insert-prefix): Add "ideocomb:" for the prefix for
<http://rdf.chise.org/data/character/ideo/combination/>.

char-db-turtle.el

index 287f134..83d1731 100644 (file)
 
 (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"
        (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)
         )
 @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/> .