Commit 7bca3e2c authored by MORIOKA Tomohiko's avatar MORIOKA Tomohiko
Browse files

(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.
parent 28eb433d
...@@ -193,34 +193,62 @@ ...@@ -193,34 +193,62 @@
(cond (cond
((eq '->subsumptive feature-name) ((eq '->subsumptive feature-name)
":subsume") ":subsume")
((eq '<-subsumptive feature-name)
":subsumed-in")
((eq '->denotational feature-name)
":unify")
((eq '<-denotational feature-name) ((eq '<-denotational feature-name)
":denotation-of") ":unified-by")
((eq '->formed feature-name)
":formed")
((eq '<-formed feature-name) ((eq '<-formed feature-name)
":form-of") ":form-of")
((eq '->same feature-name)
"ideo:same")
((eq '<-same feature-name) ((eq '<-same feature-name)
"ideo:same-as") "ideo:same-as")
((eq '->simplified feature-name)
"ideo:simplified-form")
((eq '<-simplified feature-name) ((eq '<-simplified feature-name)
"ideo:simplified-form-of") "ideo:simplified-form-of")
((eq '->vulgar feature-name)
"ideo:vulgar-form")
((eq '<-vulgar feature-name) ((eq '<-vulgar feature-name)
"ideo:vulgar-form-of") "ideo:vulgar-form-of")
((eq '->wrong feature-name)
"ideo:wrong-form")
((eq '<-wrong feature-name) ((eq '<-wrong feature-name)
"ideo:wrong-form-of") "ideo:wrong-form-of")
((eq '->original feature-name)
"ideo:original-form")
((eq '<-original feature-name) ((eq '<-original feature-name)
"ideo:original-form-of") "ideo:original-form-of")
((eq '->ancient feature-name)
"ideo:ancient-form")
((eq '<-ancient feature-name) ((eq '<-ancient feature-name)
"ideo:ancient-form-of") "ideo:ancient-form-of")
((eq '->Small-Seal feature-name)
"ideo:Small-Seal-form")
((eq '<-Small-Seal feature-name) ((eq '<-Small-Seal feature-name)
"ideo:Small-Seal-of") "ideo:Small-Seal-form-of")
((eq '<-interchangeable feature-name) ((eq '->Oracle-Bones feature-name)
"ideo:interchangeable-form-of") "ideo:Oracle-Bone-character")
((eq '<-Oracle-Bones feature-name)
"ideo:Oracle-Bone-character-of")
((eq '->interchangeable feature-name) ((eq '->interchangeable feature-name)
"ideo:interchangeable-form")
((eq '<-interchangeable feature-name)
"ideo:interchangeable") "ideo:interchangeable")
((eq '->mistakable feature-name) ((eq '->mistakable feature-name)
"ideo:mistakable") "ideo:mistakable-character")
((eq '<-mistakable feature-name)
"ideo:mistakable-character-of")
((eq 'hanyu-dazidian feature-name) ((eq 'hanyu-dazidian feature-name)
"ideo:hanyu-dazidian") "ideo:hanyu-dazidian")
((eq '*note feature-name) ((eq '*note feature-name)
"rdfs:comment") "rdfs:comment")
((eq '*references feature-name)
":reference")
((eq '*instance feature-name) ((eq '*instance feature-name)
":instance") ":instance")
(t (t
...@@ -412,15 +440,19 @@ ...@@ -412,15 +440,19 @@
(defun concord-turtle-insert-relation-feature (char name value line-breaking (defun concord-turtle-insert-relation-feature (char name value line-breaking
ccss readable) ccss readable)
(insert (format " %s%s " (if (and (consp value)
(chise-turtle-uri-encode-feature-name name) (cdr value))
line-breaking)) (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) (concord-turtle-insert-relations value readable)
(insert " ;") (insert " ;")
) )
(defun concord-turtle-insert-metadata (name value) (defun concord-turtle-insert-metadata (name value)
(let (col indent ret) (let (col indent)
(insert (format "%-7s " name)) (insert (format "%-7s " name))
(cond (cond
((or (eq name :sources) ((or (eq name :sources)
...@@ -434,14 +466,7 @@ ...@@ -434,14 +466,7 @@
(chise-turtle-uri-encode-ccs-name source)))) (chise-turtle-uri-encode-ccs-name source))))
nil) nil)
((eq name :references) ((eq name :references)
(setq ret (car value)) (concord-turtle-insert-references 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) nil)
(t (t
(insert (format "%S" value)) (insert (format "%S" value))
...@@ -542,6 +567,17 @@ ...@@ -542,6 +567,17 @@
(insert " ;") (insert " ;")
'with-separator)) '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) (defun concord-turtle-insert-object (cell &optional readable)
(if (integerp cell) (if (integerp cell)
(setq cell (decode-char '=ucs cell))) (setq cell (decode-char '=ucs cell)))
...@@ -609,6 +645,9 @@ ...@@ -609,6 +645,9 @@
((eq feature-name-base '=decomposition) ((eq feature-name-base '=decomposition)
(concord-turtle-insert-decomposition value readable) (concord-turtle-insert-decomposition value readable)
) )
((eq feature-name-base '*references)
(concord-turtle-insert-references value readable)
)
((or (eq feature-name-base 'ideographic-combination) ((or (eq feature-name-base 'ideographic-combination)
(eq feature-name-base '*instance) (eq feature-name-base '*instance)
(eq feature-name-base '<-formed) (eq feature-name-base '<-formed)
...@@ -763,15 +802,15 @@ ...@@ -763,15 +802,15 @@
ccss readable) ccss readable)
(setq obj-spec (delete feature-pair obj-spec)) (setq obj-spec (delete feature-pair obj-spec))
) )
(when (and (setq feature-pair (assq '<-denotational@component obj-spec)) ;; (when (and (setq feature-pair (assq '<-denotational@component obj-spec))
(setq value (cdr feature-pair))) ;; (setq value (cdr feature-pair)))
(insert line-separator) ;; (insert line-separator)
(concord-turtle-insert-relation-feature ;; (concord-turtle-insert-relation-feature
object '<-denotational@component value ;; object '<-denotational@component value
line-breaking ;; line-breaking
ccss readable) ;; ccss readable)
(setq obj-spec (delete feature-pair obj-spec)) ;; (setq obj-spec (delete feature-pair obj-spec))
) ;; )
(when (and (setq feature-pair (assq 'name obj-spec)) (when (and (setq feature-pair (assq 'name obj-spec))
(setq value (cdr feature-pair))) (setq value (cdr feature-pair)))
(insert (format "%s " line-separator)) (insert (format "%s " line-separator))
...@@ -989,19 +1028,18 @@ ...@@ -989,19 +1028,18 @@
(insert (format "%s ideo:total-strokes [ " (insert (format "%s ideo:total-strokes [ "
line-separator)) line-separator))
(setq col (current-column)) (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) (chise-turtle-uri-encode-ccs-name domain)
(make-string col ?\ ) indent
value)) value))
(setq obj-spec (delete feature-pair obj-spec)) (setq obj-spec (delete feature-pair obj-spec))
(setq skey (intern (format "%s*sources" key))) (setq skey (intern (format "%s*sources" key)))
(when (and (setq feature-pair (assq skey obj-spec)) (when (and (setq feature-pair (assq skey obj-spec))
(setq value (cdr feature-pair))) (setq value (cdr feature-pair)))
(insert (format " ;\n%s" indent)) (insert (format " ;\n%s" indent))
(concord-turtle-insert-metadata :sources value) (concord-turtle-insert-metadata :sources value)
;; (insert (format " ;\n%s:sources (" indent)) ;; (insert (format " ;\n%s:sources (" indent))
;; (setq col (current-column))
;; (setq indent (make-string col ?\ ))
;; (insert (format " chisebib:%s" (car value))) ;; (insert (format " chisebib:%s" (car value)))
;; (dolist (cell (cdr value)) ;; (dolist (cell (cdr value))
;; (insert (format "\n%s chisebib:%s" indent cell))) ;; (insert (format "\n%s chisebib:%s" indent cell)))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment