[isidorus-cvs] r180 - trunk/src/model
Lukas Giessmann
lgiessmann at common-lisp.net
Mon Feb 8 21:19:48 UTC 2010
Author: lgiessmann
Date: Mon Feb 8 16:19:47 2010
New Revision: 180
Log:
datamodel: fixed a problem with the datamodel and elephant's/sb-mop's function finalize-inheritance when reading data of the type ItemIdentiferC and SubjectLocatorC after a system-restart without creating new objects of these types
Modified:
trunk/src/model/datamodel.lisp
Modified: trunk/src/model/datamodel.lisp
==============================================================================
--- trunk/src/model/datamodel.lisp (original)
+++ trunk/src/model/datamodel.lisp Mon Feb 8 16:19:47 2010
@@ -255,6 +255,93 @@
(defgeneric get-most-recent-version-info (construct))
+;;;;;;;;;;;;;;
+;;
+;; ItemIdentifierC
+
+(elephant:defpclass ItemIdentifierC (IdentifierC)
+ ()
+ (:index t)
+ (:documentation "Represents an item identifier"))
+
+
+;;;;;;;;;;;;;;
+;;
+;; SubjectLocator
+
+(elephant:defpclass SubjectLocatorC (IdentifierC)
+ ((identified-construct :accessor identified-construct
+ :initarg :identified-construct
+ :associate TopicC))
+ (:index t)
+ (:documentation "Represents a subject locator"))
+
+
+;;;;;;;;;;;;;;
+;;
+;; IdentifierC
+
+(elephant:defpclass IdentifierC (PointerC)
+ ()
+ (:documentation "Abstract base class for ItemIdentifierC and
+ PersistentIdC, primarily in view of the equality rules"))
+
+
+;;;;;;;;;;;;;;
+;;
+;; PointerC
+
+(elephant:defpclass PointerC (TopicMapConstructC)
+ ((uri :accessor uri
+ :initarg :uri
+ :type string
+ :initform (error "The uri must be set for a pointer")
+ :index t)
+ (identified-construct :accessor identified-construct
+ :initarg :identified-construct
+ :associate ReifiableConstructC))
+ (:documentation "Abstract base class for all types of pointers and identifiers"))
+
+(defmethod delete-construct :before ((construct PointerC))
+ (delete-1-n-association construct 'identified-construct))
+
+(defmethod find-all-equivalent ((construct PointerC))
+ (delete construct
+ (elephant:get-instances-by-value (class-of construct)
+ 'uri
+ (uri construct))
+ :key #'internal-id))
+(defgeneric uri-p (construct)
+ (:documentation "Check if the slot uri is bound in an identifier and not nil")
+ (:method ((identifier PointerC)) (slot-predicate identifier 'uri)))
+
+(defgeneric identified-construct-p (construct)
+ (:documentation "Check if the slot identified-construct is bound in an identifier and not nil")
+ (:method ((identifier PointerC)) (slot-predicate identifier 'identified-construct)))
+
+(defmethod print-object ((identifier PointerC) stream)
+ (format stream
+ "~a(href: ~a; Construct: ~a)"
+ (class-name (class-of identifier))
+ (if (uri-p identifier)
+ (uri identifier)
+ "URI UNDEFINED")
+ (if (identified-construct-p identifier)
+ (identified-construct identifier)
+ "SLOT UNBOUND")))
+
+(defmethod equivalent-constructs ((identifier1 PointerC) (identifier2 PointerC))
+ (string= (uri identifier1) (uri identifier2)))
+
+(defmethod initialize-instance :around ((identifier PointerC) &key
+ (start-revision (error "Start revision must be present") )
+ (end-revision 0))
+ (call-next-method)
+ (add-to-version-history identifier
+ :start-revision start-revision
+ :end-revision end-revision)
+ identifier)
+
;;;;;;;;;;;;;;
;;
@@ -448,110 +535,6 @@
(slot-value construct (find-symbol "OID" 'elephant)))
-
-;;;;;;;;;;;;;;
-;;
-;; PointerC
-
-(elephant:defpclass PointerC (TopicMapConstructC)
- ((uri :accessor uri
- :initarg :uri
- :type string
- :initform (error "The uri must be set for a pointer")
- :index t)
- (identified-construct :accessor identified-construct
- :initarg :identified-construct
- :associate ReifiableConstructC))
- (:documentation "Abstract base class for all types of pointers and identifiers"))
-
-(defmethod delete-construct :before ((construct PointerC))
- (delete-1-n-association construct 'identified-construct))
-
-(defmethod find-all-equivalent ((construct PointerC))
- (delete construct
- (elephant:get-instances-by-value (class-of construct)
- 'uri
- (uri construct))
- :key #'internal-id))
-(defgeneric uri-p (construct)
- (:documentation "Check if the slot uri is bound in an identifier and not nil")
- (:method ((identifier PointerC)) (slot-predicate identifier 'uri)))
-
-(defgeneric identified-construct-p (construct)
- (:documentation "Check if the slot identified-construct is bound in an identifier and not nil")
- (:method ((identifier PointerC)) (slot-predicate identifier 'identified-construct)))
-
-(defmethod print-object ((identifier PointerC) stream)
- (format stream
- "~a(href: ~a; Construct: ~a)"
- (class-name (class-of identifier))
- (if (uri-p identifier)
- (uri identifier)
- "URI UNDEFINED")
- (if (identified-construct-p identifier)
- (identified-construct identifier)
- "SLOT UNBOUND")))
-
-(defmethod equivalent-constructs ((identifier1 PointerC) (identifier2 PointerC))
- (string= (uri identifier1) (uri identifier2)))
-
-(defmethod initialize-instance :around ((identifier PointerC) &key
- (start-revision (error "Start revision must be present") )
- (end-revision 0))
- (call-next-method)
- (add-to-version-history identifier
- :start-revision start-revision
- :end-revision end-revision)
- identifier)
-
-;;;;;;;;;;;;;;
-;;
-;; IdentifierC
-
-(elephant:defpclass IdentifierC (PointerC)
- ()
- (:documentation "Abstract base class for ItemIdentifierC and
- PersistentIdC, primarily in view of the equality rules"))
-
-
-;;;;;;;;;;;;;;
-;;
-;; ItemIdentifierC
-
-(elephant:defpclass ItemIdentifierC (IdentifierC)
- ()
- (:index t)
- (:documentation "Represents an item identifier"))
-
-
-;;;;;;;;;;;;;;
-;;
-;; PSI
-
-(elephant:defpclass PersistentIdC (IdentifierC)
- ((identified-construct :accessor identified-construct
- :initarg :identified-construct
- :associate TopicC))
- (:index t)
- (:documentation "Represents a PSI"))
-
-
-
-;;(defmethod print-object ((psi PersistentIdC) stream)
-;; (format stream "PSI(URI: ~a; TopicId: ~a)" (uri psi) (topicid (identified-construct psi))))
-
-
-;;;;;;;;;;;;;;
-;;
-;; SubjectLocator
-
-(elephant:defpclass SubjectLocatorC (IdentifierC)
- ((identified-construct :accessor identified-construct
- :initarg :identified-construct
- :associate TopicC))
- (:index t)
- (:documentation "Represents a subject locator"))
-
;;;;;;;;;;;;;;
;;
;; TopicIdentificationC
@@ -600,6 +583,19 @@
(elephant:get-instance-by-value 'TopicIdentificationC
'xtm-id xtm-id))
+
+;;;;;;;;;;;;;;
+;;
+;; PSI
+
+(elephant:defpclass PersistentIdC (IdentifierC)
+ ((identified-construct :accessor identified-construct
+ :initarg :identified-construct
+ :associate TopicC))
+ (:index t)
+ (:documentation "Represents a PSI"))
+
+
;;;;;;;;;;;;;;
;;
;; ReifiableConstructC
More information about the Isidorus-cvs
mailing list