+ (reference (topic-name-type name)))
+ (require-set (topic-occurrences topic))
+ (dolist (item (topic-occurrences topic))
+ (require-exact-item item 'occurrence)
+ (unless (and (eq item (canonical-occurrence item)) (eq (occurrence-parent item) topic))
+ (fail :invalid-parent "Occurrence must be current and owned by its containing Topic."))
+ (reference (occurrence-type item))
+ (unless (member (occurrence-datatype item) (list (string-datatype) (iri-datatype)) :test #'string=)
+ (fail :unsupported-occurrence-datatype "Only string and anyURI values are supported." t))
+ (when (and (string= (occurrence-datatype item) (iri-datatype))
+ (not (topic-maps.tmdm::absolute-locator-p (occurrence-value item))))
+ (fail :invalid-occurrence-value "IRI-valued Occurrences must store an absolute locator."))
+ (let ((ids (occurrence-item-identifiers item)))
+ (unless (and (every #'topic-maps.tmdm::absolute-locator-p ids)
+ (= (length ids) (length (remove-duplicates ids :test #'string=))))
+ (fail :invalid-locators "Occurrence identifiers must be an absolute locator set.")))))