Changeset 319 for branches/new-datamodel


Ignore:
Timestamp:
10/02/10 09:20:25 (15 years ago)
Author:
lgiessmann
Message:

new-datamodel: changed "changed-p", so a ReifiableConstructC also changed when an ItemIdentifierC or a reifier was marked-as-deleted one revision ago; a NameC changed also when a variant was marked-as-deleted one revsion ago; a TopicC changed when any identifier or CharacteristicC was marked-as-deleted one revision ago; an AssociationC changed also when a RoleC was marked-as-deleted one revision ago

Location:
branches/new-datamodel/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branches/new-datamodel/src/model/changes.lisp

    r318 r319  
    152152                   'Changed' can mean:
    153153    * newly created
     154    * deletion of an element
    154155    * modified through the addition or removal of identifiers
    155156    * (for associations) modified through the addition or removal of
     
    211212
    212213
     214(defgeneric end-revision-p (construct revision)
     215  (:documentation "A helper function for changed-p. It returns the latest
     216                   version-info if the passed versioned-construct was
     217                   marked-as-deleted in the version that is given.")
     218  (:method ((construct VersionedConstructC) (revision integer))
     219    (let ((version-info (find revision (versions construct)
     220                              :key #'end-revision :test #'=)))
     221      (when (and version-info
     222                 (not
     223                  (find-if
     224                   #'(lambda(vi)
     225                       (or (> (end-revision vi) (end-revision version-info))
     226                           (= (end-revision vi) 0)))
     227                   (versions construct))))
     228        version-info))))
     229
     230
    213231(defmethod changed-p ((construct ReifiableConstructC) (revision integer))
    214232  "Returns t if a ReifiableConstructC changed in the given version, i.e.
    215233   an item-identifier or reifier was added to the construct itself."
    216   (some #'(lambda(vc)
    217             (changed-p vc revision))
    218         (union (item-identifiers construct :revision revision)
    219                (let ((reifier-top (reifier construct :revision revision)))
    220                  (when reifier-top
    221                    (list reifier-top))))))
     234  (or (some #'(lambda(vc)
     235                (changed-p vc revision))
     236            (union (item-identifiers construct :revision revision)
     237                   (let ((reifier-top (reifier construct :revision revision)))
     238                     (when reifier-top
     239                       (list reifier-top)))))
     240      (some #'(lambda(vc)
     241                (end-revision-p vc revision))
     242            (union (slot-p construct 'item-identifiers)
     243                   (slot-p construct 'reifier)))))
    222244
    223245
     
    228250      (some #'(lambda(var)
    229251                (changed-p var revision))
    230             (variants construct :revision revision))))
     252            (variants construct :revision revision))
     253      (some #'(lambda(vc)
     254                (end-revision-p vc revision))
     255            (slot-p construct 'variants))))
    231256
    232257
     
    255280                                 (eql (reifiable-construct reifier-assoc) rc))
    256281                             (slot-p construct 'reified-construct))))
    257             (changed-p ra revision))))))
     282            (changed-p ra revision))))
     283      (some #'(lambda(vc)
     284                (end-revision-p vc revision))
     285            (union (union (union (slot-p construct 'psis)
     286                                 (slot-p construct 'locators))
     287                          (union (slot-p construct 'names)
     288                                 (slot-p construct 'occurrences)))
     289                   (slot-p construct 'reified-construct)))))
     290           
    258291
    259292
     
    264297      (some #'(lambda(role)
    265298                (changed-p role revision))
    266             (roles construct :revision revision))))
     299            (roles construct :revision revision))
     300      (some #'(lambda(vc)
     301                (end-revision-p vc revision))
     302            (slot-p construct 'roles))))
    267303
    268304
  • TabularUnified branches/new-datamodel/src/unit_tests/versions_test.lisp

    r318 r319  
    332332      (is-true (changed-p norwegian-curriculum-assoc fixtures::revision1))
    333333      (is-true (changed-p norwegian-curriculum-assoc fixtures::revision2))
    334       )))
    335       ;(is-true (changed-p norwegian-curriculum-assoc fixtures::revision3)))))
     334      (is-true (changed-p norwegian-curriculum-assoc fixtures::revision3))
     335      (delete-name service-topic service-name :revision fixtures::revision3)
     336      (is-true (changed-p service-topic fixtures::revision3)))))
    336337
    337338
  • TabularUnified branches/new-datamodel/src/xml/rdf/exporter.lisp

    r240 r319  
    6161
    6262(defun init-*ns-map* ()
    63   "Initializes the variable *ns-map* woith some prefixes and corresponding
     63  "Initializes the variable *ns-map* with some prefixes and corresponding
    6464   namepsaces. So the predifend namespaces are not contain ed twice."
    6565  (setf *ns-map* (list
Note: See TracChangeset for help on using the changeset viewer.