Changeset 168 for trunk/src/xml


Ignore:
Timestamp:
12/10/09 14:44:47 (15 years ago)
Author:
lgiessmann
Message:

all topic-stubs of a fragment are exported explicitely if they do own more than one psi or another identifier

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/xml/rdf/exporter.lisp

    r167 r168  
    570570  "Exports TM-Fragments as RDF/XML data."
    571571  (topic-to-rdf-elem (topic construct))
    572   ;all stubs are exported implicitely by references of the topic or associations
     572  (map 'list #'(lambda(top)
     573                 (when (or (> (length (psis top)) 1)
     574                           (item-identifiers top)
     575                           (locators top))
     576                   (topic-to-rdf-stub-elem top)))
     577       (referenced-topics construct))
     578  ;all other stubs are exported implicitely by references of the main topic or associations
    573579  (map 'list #'to-rdf-elem (intersection (list-tm-associations) (associations construct))))
    574580
     
    613619
    614620
     621(defun topic-to-rdf-stub-elem (construct)
     622  "Exports a topic as a stub."
     623  (declare (TopicC construct))
     624  (cxml:with-element "rdf:Description"
     625    (let ((psi (get-reifier-psi construct))
     626          (ii (item-identifiers construct))
     627          (sl (locators construct)))
     628      (if psi
     629          (if (reified construct)
     630              (let ((reifier-uri (get-reifier-uri construct)))
     631                (if reifier-uri
     632                    (cxml:attribute "rdf:about" (concatenate 'string "#" (get-reifier-uri construct)))
     633                    (cxml:attribute "rdf:about" (uri psi))))
     634              (cxml:attribute "rdf:about" (uri psi)))
     635          (cxml:attribute "rdf:nodeID" (make-object-id construct)))
     636      (map 'list #'to-rdf-elem (remove psi (psis construct)))
     637      (map 'list #'to-rdf-elem sl)
     638      (map 'list #'to-rdf-elem ii))))
     639
     640
    615641(defgeneric to-rdf-string (construct)
    616642  (:documentation "Prints the string representation of a Fragment element as RDF/XML"))
Note: See TracChangeset for help on using the changeset viewer.