(www-display-object-desc): Use [RDF (Turtle)] instead of [Turtle]; use
[chise/est.git] / est-eval.el
index 835d5b4..8076a43 100644 (file)
@@ -14,7 +14,7 @@
        ((eq spec 02) (concat value "巻"))
        ((eq spec 03) (concat value "号"))
        ((eq spec 04) (concat value "編"))
-       ((eq spec 05) (concat value "&HD-JA-4A53;"))
+       ((eq spec 05) (concat value "&MJ019590;"))
        ((eq spec 06) (concat value "集"))
        ((eq spec 07) (concat value "輯"))
        ((eq spec 08) (concat value "部"))
                value)))
     (est-eval-value-as-S-exp value)))
 
-(defun est-eval-value-as-image-resource (value)
+(defun est-eval-value-as-image-resource (value &optional accept-full-image)
   (let ((name (concord-object-get value 'name)))
-    (if (concord-object-get value 'image-offset-x)
-       (list 'img (list* :src (or (concord-object-get value '=location@iiif)
-                                  (concord-object-get value '=location))
-                         (if name
-                             (list :alt name))))
-      name)))
+    (cond
+     ((concord-object-get value 'image-offset-x)
+      (list 'img (list* :src (or (concord-object-get value '=location@iiif)
+                                (concord-object-get value '=location))
+                       (if name
+                           (list :alt name))))
+      )
+     (accept-full-image
+      (list 'img (list* :src (concord-object-get value '=location)
+                       (if name
+                           (list :alt name))))
+      )
+     (t
+      name))))
 
 (defun est-eval-value-as-glyph-image (value)
   (let ((image-resource (car (concord-object-get value '->image-resource))))
     (est-eval-value-as-image-resource image-resource)))
 
+(defun est-eval-value-as-image-object (value)
+  (let ((image-resource (car (concord-object-get value '->image-resource))))
+    (list 'object (list :object value)
+         (est-eval-value-as-image-resource
+          image-resource 'accept-full-image))))
+
 ;; (defun est-journal-volume-object-get-volume-format (spec feature)
 ;;   (when (integerp spec)
 ;;     (setq spec (format "%02d" spec)))
 ;;         ((string= spec "02") `((decimal (:feature ,feature)) "巻"))
 ;;         ((string= spec "03") `((decimal (:feature ,feature)) "号"))
 ;;         ((string= spec "04") `((decimal (:feature ,feature)) "&AJ1-03620;"))
-;;         ((string= spec "05") `((decimal (:feature ,feature)) "&HD-JA-4A53;"))
+;;         ((string= spec "05") `((decimal (:feature ,feature)) "&MJ019590;"))
 ;;         ((string= spec "06") `((decimal (:feature ,feature)) "集"))
 ;;         ((string= spec "07") `((decimal (:feature ,feature)) "輯"))
 ;;         ((string= spec "08") `((decimal (:feature ,feature)) "部"))
        (error (format "%s" value)))
     (format "%s" value)))
 
+(defun est-eval-value-as-image-list (value &optional separator subtype)
+  (if (and (listp value)
+          (listp (cdr value)))
+      (condition-case nil
+         (let (props)
+           (if separator
+               (setq props (list :separator separator)))
+           (if subtype
+               (setq props (list* :subtype subtype props)))
+           (list* 'image-list props
+                  (mapcar #'est-eval-value-as-image-object value)))
+       (error (format "%s" value)))
+    (format "%s" value)))
+
 (defun est-eval-value-as-composition-list (value &optional separator subtype)
   (if (and (listp value)
           (listp (cdr value)))
                 '(:subtype unordered-list)
               '(:separator " "))
             (mapcar (lambda (creator)
-                      (est-eval-list
-                       '((value (:feature <-creator)))
-                       creator nil))
+                      (if (concord-object-p creator)
+                          (est-eval-list
+                           '((value (:feature <-creator)))
+                           creator nil)
+                        (est-eval-value-default creator)))
                     value))
     (est-eval-value-default value)))
 
         ((eq format 'wiki-text)
          (est-eval-list value object feature-name nil uri-object)
          )
+        ((eq format 'unordered-link-list)
+         (est-eval-list value object feature-name nil uri-object
+                        '(:subtype unordered-list :separator " "))
+         )
         ((eq format 'S-exp)
          (est-eval-value-as-S-exp value)
          )
          (est-eval-value-as-location-list value nil))
         ((eq format 'name-list)
          (est-eval-value-as-name-list value nil))
+        ((eq format 'image-list)
+         (est-eval-value-as-image-list value nil))
         ((eq format 'unordered-list)
          (est-eval-value-as-object-list value nil 'unordered-list))
         ((eq format 'unordered-composition-list)
       exp)))))
 
 (defun est-eval-list (format-list object feature-name
-                                 &optional lang uri-object)
+                                 &optional lang uri-object list-props)
   (if (consp format-list)
       (let ((ret
             (mapcar
                (est-eval-unit exp object feature-name lang uri-object nil))
              format-list)))
        (if (cdr ret)
-           (list* 'list nil ret)
+           (list* 'list list-props ret)
          (car ret)))
     (est-eval-unit format-list object feature-name lang uri-object nil)))