Changeset 219 for branches/new-datamodel
- Timestamp:
- 03/09/10 11:11:24 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/new-datamodel/src/model/datamodel.lisp ¶
r218 r219 764 764 765 765 ;;; PointerC 766 (defmethod delete-construct :before ((construct PointerC)) 767 (dolist (p-assoc (slot-p construct 'identified-construct)) 768 (delete-construct p-assoc))) 769 770 766 771 (defgeneric owned-p (construct) 767 772 (:documentation "Returns t if the passed construct is referenced by a parent … … 786 791 787 792 793 ;;; PointerAssociationC 794 (defmethod delete-construct :before ((construct PointerAssociationC)) 795 (delete-1-n-association construct 'identifier)) 796 797 798 ;;; ItemIdAssociationC 799 (defmethod delete-construct :before ((construct ItemIdAssociationC)) 800 (delete-1-n-association construct 'parent-construct)) 801 802 803 ;;; TopicIdAssociationC 804 (defmethod delete-construct :before ((construct TopicIdAssociationC)) 805 (delete-1-n-association construct 'parent-construct)) 806 807 808 ;;; PersistentIdAssociationC 809 (defmethod delete-construct :before ((construct PersistentIdAssociationC)) 810 (delete-1-n-association construct 'parent-construct)) 811 812 813 ;;; SubjectLocatorAssociationC 814 (defmethod delete-construct :before ((construct SubjectLocatorAssociationC)) 815 (delete-1-n-association construct 'parent-construct)) 816 817 818 ;;; ReifierAssociationC 819 (defmethod delete-construct :before ((construct ReifierAssociationC)) 820 (delete-1-n-association construct 'reifiable-construct) 821 (delete-1-n-association construct 'reifier-topic)) 822 823 824 ;;; TypeAssociationC 825 (defmethod delete-construct :before ((construct TypeAssociationC)) 826 (delete-1-n-association construct 'type-topic) 827 (delete-1-n-association construct 'typable-construct)) 828 829 830 ;;; ScopeAssociationC 831 (defmethod delete-construct :before ((construct ScopeAssociationC)) 832 (delete-1-n-association construct 'theme-topic) 833 (delete-1-n-association construct 'scopable-construct)) 834 835 836 ;;; CharacteristicAssociationC 837 (defmethod delete-construct :before ((construct CharacteristicAssociationC)) 838 (delete-1-n-association construct 'charactersitic)) 839 840 841 ;;; OccurrenceAssociationC 842 (defmethod delete-construct :before ((construct OccurrenceAssociationC)) 843 (delete-1-n-association construct 'parent-construct)) 844 845 846 ;;; NameAssociationC 847 (defmethod delete-construct :before ((construct NameAssociationC)) 848 (delete-1-n-association construct 'parent-construct)) 849 850 851 ;;; VariantAssociationC 852 (defmethod delete-construct :before ((construct VariantAssociationC)) 853 (delete-1-n-association construct 'parent-construct)) 854 855 788 856 ;;; TopicC 857 (defmethod delete-construct :before ((construct TopicC)) 858 (let ((psis-to-delete 859 (map 'list #'identifier (slot-p construct 'psis))) 860 (sls-to-delete 861 (map 'list #'identifier (slot-p construct 'psis))) 862 (names-to-delete 863 (map 'list #'characteristic (slot-p construct 'names))) 864 (occurrences-to-delete (slot-p construct 'occurrences)) 865 ;TODO: roles -> associations? 866 (typables-to-delete 867 (map 'list #'typable-construct (slot-p construct 'used-as-type))) 868 (reifier-assocs-to-delete (slot-p construct 'reified-construct))) 869 (dolist (construct-to-delete (append psis-to-delete 870 sls-to-delete 871 names-to-delete 872 occurrences-to-delete 873 typables-to-delete 874 reifier-assocs-to-delete)) 875 (delete-construct construct-to-delete))) 876 (dolist (scope-assoc-to-delete (slot-p construct 'used-as-theme)) 877 (delete-construct scope-assoc-to-delete)) 878 (dolist (tm (slot-p construct 'in-topicmaps)) 879 (remove-association construct 'in-topicmaps tm))) 880 881 789 882 (defmethod owned-p ((construct TopicC)) 790 883 (when (slot-p construct 'in-topicmaps) … … 1194 1287 1195 1288 ;;; NameC 1289 (defmethod delete-construct :before ((construct NameC)) 1290 (dolist (variant-to-delete 1291 (map 'list #'characteristic 1292 (slot-p construct 'variants))) 1293 (delete-construct variant-to-delete))) 1294 1295 1196 1296 (defgeneric variants (construct &key revision) 1197 1297 (:documentation "Returns all variants that correspond with the given revision … … 1244 1344 1245 1345 ;;; CharacteristicC 1346 (defmethod delete-construct :before ((construct CharacteristicC)) 1347 (dolist (characteristic-assoc-to-delete (slot-p construct 'parent)) 1348 (delete-construct characteristic-assoc-to-delete))) 1349 1350 1246 1351 (defmethod owned-p ((construct CharacteristicC)) 1247 1352 (when (slot-p construct 'parent) … … 1473 1578 1474 1579 ;;; ReifiableConstructC 1580 (defmethod delete-construct :before ((construct ReifiableConstructC)) 1581 (let ((iis-to-delete 1582 (map 'list #'identifier (slot-p construct 'item-identifiers))) 1583 (reifier-tops-to-delete 1584 (map 'list #'reifier-topic (slot-p construct 'reifier)))) 1585 (dolist (construct-to-delete (append iis-to-delete reifier-tops-to-delete)) 1586 (delete-construct construct-to-delete)))) 1587 1588 1475 1589 (defgeneric item-identifiers (construct &key revision) 1476 1590 (:documentation "Returns the ItemIdentifierC-objects that correspond … … 1588 1702 1589 1703 ;;; ScopableC 1704 (defmethod delete-construct :before ((construct ScopableC)) 1705 (dolist (scope-assoc-to-delete (slot-p construct 'themes)) 1706 (delete-construct scope-assoc-to-delete))) 1707 1708 1590 1709 (defgeneric themes (construct &key revision) 1591 1710 (:documentation "Returns all topics that correspond with the given revision … … 1633 1752 1634 1753 ;;; TypableC 1754 (defmethod delete-construct :before ((construct TypableC)) 1755 (dolist (type-assoc-to-delete (slot-p construct 'instance-of)) 1756 (delete-construct type-assoc-to-delete))) 1757 1635 1758 (defgeneric instance-of (construct &key revision) 1636 1759 (:documentation "Returns the type topic that is set on the passed … … 1691 1814 1692 1815 ;;; TopicMapC 1816 (defmethod delete-construct :before ((construct TopicMapC)) 1817 (dolist (top (slot-p construct 'topics)) 1818 (remove-association construct 'topics top)) 1819 (dolist (assoc (slot-p construct 'associations)) 1820 (remove-association construct 'associations assoc))) 1821 1822 1693 1823 (defgeneric topics (construct &key revision) 1694 1824 (:documentation "Returns all TopicC-objects that are contained in the tm.")
Note: See TracChangeset
for help on using the changeset viewer.