[isidorus-cvs] r195 - in branches/new-datamodel: docs src/model
Lukas Giessmann
lgiessmann at common-lisp.net
Wed Feb 17 21:39:10 UTC 2010
Author: lgiessmann
Date: Wed Feb 17 16:39:10 2010
New Revision: 195
Log:
new-datamodel: updated the uml-schema; started to implement TopiC; implemented TopicMapC
Modified:
branches/new-datamodel/docs/isidorus_data_model.pdf
branches/new-datamodel/docs/isidorus_data_model.vsd
branches/new-datamodel/src/model/datamodel.lisp
Modified: branches/new-datamodel/docs/isidorus_data_model.pdf
==============================================================================
Binary files branches/new-datamodel/docs/isidorus_data_model.pdf (original) and branches/new-datamodel/docs/isidorus_data_model.pdf Wed Feb 17 16:39:10 2010 differ
Modified: branches/new-datamodel/docs/isidorus_data_model.vsd
==============================================================================
Binary files. No diff available.
Modified: branches/new-datamodel/src/model/datamodel.lisp
==============================================================================
--- branches/new-datamodel/src/model/datamodel.lisp (original)
+++ branches/new-datamodel/src/model/datamodel.lisp Wed Feb 17 16:39:10 2010
@@ -11,6 +11,7 @@
(:use :cl :elephant :constants)
(:nicknames :d)
(:export ;;classes
+ :TopicMapC
:AssociationC
:RoleC
:OccurrenceC
@@ -53,6 +54,8 @@
:roles
:add-role
:delete-role
+ :associations
+ :topics
:mark-as-deleted
:in-topicmaps
@@ -72,31 +75,6 @@
;; one revision-infos
-
-;;; start hacks -> just some temporary hacks to avoid compiler-errors ;;;;;;;;;;
-(defpclass TopicC (TopicMapConstructC)
- ()
- (:documentation "A temporary emtpy class to avoid compiler-errors."))
-
-
-(defgeneric merge-constructs(construc-1 construct-2 &key revision)
- (:method ((construct-1 TopicMapConstructC) (construct-2 TopicMapconstructC)
- &key (revision *TM-REVISION*))
- (or construct-1 construct-2 revision)))
-
-
-(defgeneric make-construct (class-symbol &key start-revision &allow-other-keys)
- (:method ((class-symbol symbol) &key (start-revision *TM-REVISION*))
- (or class-symbol start-revision)))
-;;; end hacks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
-
-
-
-
-
-
;;; globals ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar *TM-REVISION* 0)
@@ -301,7 +279,62 @@
(setf (end-revision last-version) revision))))
-;;; Characterics ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; TopicMapC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(elephant:defpclass TopicMapC (ReifiableConstructC)
+ ((topics :accessor topics
+ :associate (TopicC in-topicmaps)
+ :documentation "List of topics that explicitly belong to this TM.")
+ (associations :accessor associations
+ :associate (AssociationC in-topicmaps)
+ :documentation "List of associations that belong to this TM."))
+ (:documentation "Represnets a topic map."))
+
+
+;;; TopicC + Characterics ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defpclass TopicC (ReifiableConstructC)
+ ((topic-identifiers :associate (TopicIdAssociationC parent-construct)
+ :documentation "Contains all association objects that
+ relate a topic with its actual
+ topic-identifiers.")
+ (psis :associate (PersistentIdAssociationC parent-construct)
+ :documentation "Contains all association objects that relate a topic
+ with its actual psis.")
+ (locators :associate (PersistentIdAssociationC parent-construct)
+ :documentation "Contains all association objects that relate a
+ topic with its actual subject-lcoators.")
+ (names :associate (NameAssociationC parent-construct)
+ :documentation "Contains all association objects that relate a topic
+ with its actual names.")
+ (occurrences :associate (OccurrenceAssociationC parent-construct)
+ :documentation "Contains all association objects that relate a
+ topic with its actual occurrences.")
+ (player-in-roles :associate (PlayerAssociationC player-topic)
+ :documentation "Contains all association objects that relate
+ a topic that is a player with its role.")
+ (used-as-type :associate (TypeAssociationC type-topic)
+ :documentation "Contains all association objects that relate a
+ topic that is a type with its typable obejct.")
+ (used-as-theme :associate (ScopeAssociationC theme-topic)
+ :documentation "Contains all association objects that relate a
+ topic that is a theme with its scoppable
+ object.")
+ (reified-construct :associate (ReifiedAssociationC reifier-topic)
+ :documentation "Contains all association objects that
+ relate a topic that is a reifier with
+ its reified object.")
+ (in-topicmaps :associate (TopicMapC topics)
+ :many-to-many t
+ :documentation "List of all topic maps this topic is part of."))
+ (:index t)
+ (:documentation "Represents a TM topic."))
+
+
+;;TODO: delete-construct, topic-identifiers, add-topic-identifier,
+;; delete-topic-identifier, psis, add-psi, delete-psi, locators,
+;; add-locator, delete-locator, names, add-name, delete-name,
+;; occurrences, add-occurrence, delete-occurrence, player-in-roles
+;; used-as-type, used-as-theme, reified-construct, in-topicmaps
+
(defpclass OccurrenceC(CharacteristicC)
((datatype :accessor datatype
:initarg :datatype
@@ -311,7 +344,7 @@
(defpclass NameC(CharacteristicC)
- ((variants :associate (VariantAssociationC name)
+ ((variants :associate (VariantAssociationC parent-construct)
:documentation "Associates this obejct with varian-associations."))
(:documentation "Scoped name of a topic."))
@@ -329,13 +362,13 @@
:inherit t
:documentation "Assocates the characterist obejct with the
parent-association.")
- (charavalue :initarg :charvalue
- :accessor charvalue
- :type string
- :inherit t
- :initform ""
- :index t
- :documentation "Contains the actual data of this object."))
+ (charvalue :initarg :charvalue
+ :accessor charvalue
+ :type string
+ :inherit t
+ :initform ""
+ :index t
+ :documentation "Contains the actual data of this object."))
(:documentation "Scoped characteristic of a topic (meant to be used
as an abstract class)."))
@@ -368,7 +401,7 @@
(make-instance 'VariantAssociationC
:start-revision revision
:characteristic variant
- :name construct)))
+ :parent-construct construct)))
construct))
@@ -430,7 +463,7 @@
'OccurrenceAssociationC
'NameAssociationC)
:start-revision revision
- :topic parent-construct
+ :parent-construct parent-construct
:characteristic construct))
(t
(error "From add-parent(): ~a can't be owned by ~a since it is already owned by the topic ~a"
@@ -454,7 +487,7 @@
((not already-set-name)
(make-instance 'VariantAssociationC
:start-revision revision
- :name parent-construct
+ :parent-construct parent-construct
:characteristic construct))
(t
(error "From add-parent(): ~a can't be owned by ~a since it is already owned by the topic ~a"
@@ -512,11 +545,11 @@
:initform (error "From PlayerAssociationC(): player-topic must be set")
:documentation "Associates this object with a topic that is
a player.")
- (role :initarg :role
- :accessor role
- :associate RoleC
- :initform (error "From PlayerAssociationC(): role must be set")
- :documentation "Associates this object with the parent-association."))
+ (parent-construct :initarg :parent-construct
+ :accessor parent-construct
+ :associate RoleC
+ :initform (error "From PlayerAssociationC(): parent-construct must be set")
+ :documentation "Associates this object with the parent-association."))
(:documentation "This class associates roles and their player in given
revisions."))
@@ -524,7 +557,7 @@
(defmethod delete-construct :before ((construct PlayerAssociationC))
"Deletes all elephant-associations."
(delete-1-n-association construct 'player-topic)
- (delete-1-n-association construct 'role))
+ (delete-1-n-association construct 'parent-construct))
(defpclass RoleAssociationC(VersionedAssociationC)
@@ -536,7 +569,7 @@
(parent-construct :initarg :parent-construct
:accessor parent-construct
:associate AssociationC
- :initform (error "From RoleAssociationC(): association must be set")
+ :initform (error "From RoleAssociationC(): parent-construct must be set")
:documentation "Assocates thius object with an
association-object."))
(:documentation "Associates roles with assoications and adds some
@@ -554,45 +587,45 @@
(defpclass VariantAssociationC(CharateristicAssociationC)
- ((name :initarg :name
- :accessor name
- :initform (error "From VariantAssociationC(): name must be set")
- :associate NameC
- :documentation "Associates this object with a name."))
+ ((parent-construct :initarg :parent-construct
+ :accessor parent-construct
+ :initform (error "From VariantAssociationC(): parent-construct must be set")
+ :associate NameC
+ :documentation "Associates this object with a name."))
(:documentation "Associates variant objects with name obejcts.
Additionally version-infos are stored."))
(defmethod delete-construct :before ((construct VariantAssociationC))
- (delete-1-n-association construct 'name))
+ (delete-1-n-association construct 'parent-construct))
(defpclass NameAssociationC(CharacteristicAssociationC)
- ((topic :initarg :topic
- :accessor topic
- :initform (error "From NameAssociationC(): topic must be set")
- :associate TopicC
- :documentation "Associates this object with a topic."))
+ ((parent-construct :initarg :parent-construct
+ :accessor parent-construct
+ :initform (error "From NameAssociationC(): parent-construct must be set")
+ :associate TopicC
+ :documentation "Associates this object with a topic."))
(:documentation "Associates name objects with their parent topics.
Additionally version-infos are stored."))
(defmethod delete-construct :before ((construct NameAssociationC))
- (delete-1-n-association construct 'topic))
+ (delete-1-n-association construct 'parent-construct))
(defpclass OccurrenceAssociationC(CharacteristicAssociationC)
- ((topic :initarg :topic
- :accessor topic
- :initform (error "From OccurrenceAssociationC(): topic must be set")
- :associate TopicC
- :documentation "Associates this object with a topic."))
+ ((parent-construct :initarg :parent-construct
+ :accessor parent-construct
+ :initform (error "From OccurrenceAssociationC(): parent-construct must be set")
+ :associate TopicC
+ :documentation "Associates this object with a topic."))
(:documentation "Associates occurrence objects with their parent topics.
Additionally version-infos are stored."))
(defmethod delete-construct :before ((construct OccurrenceAssociationC))
- (delete-1-n-association construct 'topic))
+ (delete-1-n-association construct 'parent-construct))
(defpclass CharacteristicAssociationC(VersionedAssociationC)
@@ -795,7 +828,7 @@
(defpclass RoleC(ReifiableConstructC TypableC)
((assocation :associate (RoleAssociationC role)
:documentation "Associates this object with a role-association.")
- (player :associate (PlayerAssociationC parent-role)
+ (player :associate (PlayerAssociationC parent-construct)
:documentation "Associates this object with a player-association.")))
@@ -938,7 +971,7 @@
((not already-set-player)
(make-instance 'PlayerAssociationC
:start-revision revision
- :role construct
+ :parent-construct construct
:player-topic player-topic))
(t
(error "From add-player(): ~a can't be a player of ~a since it has already the player ~a"
@@ -1037,13 +1070,11 @@
;;; ReifiableConstructC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defpclass ReifiableConstructC(TopicMapConstructC)
- ((item-identifiers :initarg :item-identifiers
- :associate (ItemIdAssociationC identified-construct)
+ ((item-identifiers :associate (ItemIdAssociationC identified-construct)
:inherit t
:documentation "A relation to all item-identifiers of
this construct.")
- (reifier :initarg :reifier
- :associate (ReifierAssociationC reified-construct)
+ (reifier :associate (ReifierAssociationC reified-construct)
:inherit t
:documentation "A relation to a reifier-topic."))
(:documentation "Reifiable constructs as per TMDM."))
@@ -1298,4 +1329,31 @@
return type-assoc)))
(when assoc-to-delete
(mark-as-deleted assoc-to-delete :revision revision))
- construct)))
\ No newline at end of file
+ construct)))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+;;; start hacks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defgeneric merge-constructs(construc-1 construct-2 &key revision)
+ (:method ((construct-1 TopicMapConstructC) (construct-2 TopicMapconstructC)
+ &key (revision *TM-REVISION*))
+ (or construct-1 construct-2 revision)))
+
+
+(defgeneric make-construct (class-symbol &key start-revision &allow-other-keys)
+ (:method ((class-symbol symbol) &key (start-revision *TM-REVISION*))
+ (or class-symbol start-revision)))
+;;; end hacks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\ No newline at end of file
More information about the Isidorus-cvs
mailing list