- (when (member kind '(:item-identifier :subject-identifier))
- (dolist (topic (%topic-map-topics map))
- (dolist (occurrence (%topic-occurrences topic))
- (when (member iri (%occurrence-item-identifiers occurrence) :test #'string=)
- (occurrence-problem (if (eq kind :item-identifier) :duplicate-item-identifier :unsupported-reification-identity)
- "Topic identity conflicts with an existing Occurrence item identifier."))))))
-(defun validate-occurrence-identifiers (map topic type value datatype identifiers)
- (unless (and (listp identifiers) (every #'absolute-locator-p identifiers))
- (occurrence-problem :invalid-item-identifiers "Item identifiers must be a list of resolved absolute locators."))
- (dolist (id identifiers)
- (dolist (owner (%topic-map-topics map))
- (when (member id (%topic-item-identifiers owner) :test #'string=)
- (occurrence-problem :duplicate-item-identifier "An Item Identifier is already assigned to a Topic."))
- (when (member id (%topic-subject-identifiers owner) :test #'string=)
- (occurrence-problem :unsupported-reification-identity "Topic/Occurrence reification identity is outside this model."))
- (dolist (other (%topic-occurrences owner))
- (when (and (member id (%occurrence-item-identifiers other) :test #'string=)
- (not (and (eq owner topic) (same-occurrence-properties-p other value datatype type))))
- (occurrence-problem :duplicate-item-identifier "An Item Identifier is already assigned to a different Occurrence."))))))
+ ;; TMDM 5.3.5's SI/II cross-identity rule concerns two Topics, not an
+ ;; implicit Reification between a Topic and a non-Topic construct.
+ (when (eq kind :item-identifier)
+ (handler-case (validate-item-identifiers map (list iri) :topic-p t)
+ (item-identifier-error (c) (legacy-identifier-problem c)))))
+(defun validate-occurrence-identifiers (map topic type value datatype identifiers scope)
+ (handler-case
+ (validate-item-identifiers map identifiers
+ :allowed (remove-if-not (lambda (other) (same-occurrence-properties-p other value datatype type scope))
+ (%topic-occurrences topic)))
+ (item-identifier-error (c) (legacy-identifier-problem c))))