Changeset 240 for branches/new-datamodel
- Timestamp:
- 03/21/10 18:15:47 (15 years ago)
- Location:
- branches/new-datamodel/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/new-datamodel/src/model/datamodel.lisp ¶
r239 r240 21 21 (:export ;;classes 22 22 :TopicMapConstructC 23 :VersionedConstructC 24 :ReifiableConstructC 23 25 :TopicMapC 24 26 :AssociationC 25 27 :RoleC 28 :CharacteristicC 26 29 :OccurrenceC 27 30 :NameC 28 31 :VariantC 32 :PointerC 33 :IdentifierC 29 34 :PersistentIdC 30 35 :ItemIdentifierC … … 125 130 :make-construct 126 131 :list-instanceOf 132 :list-super-types 127 133 :in-topicmap 128 134 :string-starts-with … … 132 138 :unique-id 133 139 :topic 140 :referenced-topics 134 141 :revision 135 142 :get-all-revisions-for-tm … … 1592 1599 1593 1600 1594 1595 (defgeneric list-instanceOf (topic &key tm) 1601 (defgeneric list-instanceOf (topic &key tm revision) 1596 1602 (:documentation "Generates a list of all topics that this topic is an 1597 instance of, optionally filtered by a topic map")) 1598 1599 1600 (defmethod list-instanceOf ((topic TopicC) &key (tm nil)) 1601 (remove-if 1602 #'null 1603 (map 'list #'(lambda(x) 1604 (when (loop for psi in (psis (instance-of x)) 1605 when (string= (uri psi) constants:*instance-psi*) 1606 return t) 1607 (loop for role in (roles (parent x)) 1608 when (not (eq role x)) 1609 return (player role)))) 1610 (if tm 1611 (remove-if-not 1612 (lambda (role) 1613 (in-topicmap tm (parent role))) 1614 (player-in-roles topic)) 1615 (player-in-roles topic))))) 1603 instance of, optionally filtered by a topic map") 1604 (:method ((topic TopicC) &key (tm nil) (revision 0)) 1605 (declare (type (or null TopicMapC) tm) 1606 (integer revision)) 1607 (remove-if 1608 #'null 1609 (map 'list 1610 #'(lambda(x) 1611 (when (loop for psi in (psis (instance-of x :revision revision) 1612 :revision revision) 1613 when (string= (uri psi) constants:*instance-psi*) 1614 return t) 1615 (loop for role in (roles (parent x :revision revision) 1616 :revision revision) 1617 when (not (eq role x)) 1618 return (player role :revision revision)))) 1619 (if tm 1620 (remove-if-not 1621 (lambda (role) 1622 (in-topicmap tm (parent role :revision revision))) 1623 (player-in-roles topic :revision revision)) 1624 (player-in-roles topic :revision revision)))))) 1625 1626 1627 (defgeneric list-super-types (topic &key tm revision) 1628 (:documentation "Generate a list of all topics that this topic is an 1629 subclass of, optionally filtered by a topic map") 1630 (:method ((topic TopicC) &key (tm nil) (revision 0)) 1631 (declare (type (or null TopicMapC) tm) 1632 (integer revision)) 1633 (remove-if 1634 #'null 1635 (map 'list 1636 #'(lambda(x) 1637 (when (loop for psi in (psis (instance-of x :revision revision) 1638 :revision revision) 1639 when (string= (uri psi) *subtype-psi*) 1640 return t) 1641 (loop for role in (roles (parent x :revision revision) 1642 :revision revision) 1643 when (not (eq role x)) 1644 return (player role :revision revision)))) 1645 (if tm 1646 (remove-if-not 1647 (lambda (role) 1648 (in-topicmap tm (parent role :revision revision))) 1649 (player-in-roles topic :revision revision)) 1650 (player-in-roles topic :revision revision)))))) 1616 1651 1617 1652 -
TabularUnified branches/new-datamodel/src/rest_interface/read.lisp ¶
r90 r240 68 68 ;check if xtm-id has already been imported or if the entry is older 69 69 ;than the snapshot feed. If so, don't do it again 70 (unless (or ( xtm-id-p xtm-id) (string> (atom:updated entry) (atom:updated imported-snapshot-entry)))70 (unless (or (string> (atom:updated entry) (atom:updated imported-snapshot-entry))) 71 71 (when top 72 72 (mark-as-deleted top :source-locator source-locator :revision revision)) … … 99 99 100 100 (defun most-recent-imported-snapshot (all-snapshot-entries) 101 (let 102 ((all-imported-entries 103 (remove-if-not #'xtm-id-p all-snapshot-entries :key #'atom:id))) 104 (most-recent-entry all-imported-entries))) 101 ; (let 102 ; ((all-imported-entries 103 ; (remove-if-not #'xtm-id-p all-snapshot-entries :key #'atom:id))) 104 ; (most-recent-entry all-imported-entries)) 105 (most-recent-entry all-snapshot-entries)) 105 106 106 107 (defun import-snapshots-feed (snapshot-feed-url &key tm-id) -
TabularUnified branches/new-datamodel/src/xml/rdf/exporter.lisp ¶
r175 r240 217 217 (if (psis topic) 218 218 (cxml:attribute "rdf:resource" 219 (if (reified topic)219 (if (reified-construct topic) 220 220 (let ((psi (get-reifier-psi topic))) 221 221 (if psi … … 593 593 (t-assocs (list-rdf-mapped-associations construct))) 594 594 (if psi 595 (if (reified construct)595 (if (reified-construct construct) 596 596 (let ((reifier-uri (get-reifier-uri construct))) 597 597 (if reifier-uri … … 628 628 (sl (locators construct))) 629 629 (if psi 630 (if (reified construct)630 (if (reified-construct construct) 631 631 (let ((reifier-uri (get-reifier-uri construct))) 632 632 (if reifier-uri -
TabularUnified branches/new-datamodel/src/xml/xtm/importer_xtm1.0.lisp ¶
r172 r240 84 84 parent-construct) 85 85 ((typep parent-construct 'VariantC) 86 ( nameparent-construct))86 (parent parent-construct)) 87 87 (t 88 88 (error "from-variant-elem-xtm1.0: parent-construct is neither NameC nor VariantC")))) … … 395 395 (create-instanceof-association instanceOf-topicRef top start-revision :xtm-id xtm-id 396 396 :tm tm)) 397 (add-to-t opicmaptm top))))397 (add-to-tm tm top)))) 398 398 399 399 … … 421 421 (format t "from-association-elem-xtm1.0: type is missing -> http://www.topicmaps.org/xtm/1.0/core.xtm#association~%") 422 422 (setf type (get-item-by-id "association" :xtm-id "core.xtm"))) 423 (add-to-t opicmaptm423 (add-to-tm tm 424 424 (make-construct 'AssociationC 425 425 :start-revision start-revision -
TabularUnified branches/new-datamodel/src/xml/xtm/importer_xtm2.0.lisp ¶
r173 r240 314 314 :tm tm 315 315 :xtm-id xtm-id)) 316 (add-to-t opicmaptm top)316 (add-to-tm tm top) 317 317 top)))) 318 318 … … 387 387 (reifier-topic (get-reifier-topic assoc-elem))) 388 388 (setf roles (set-standard-role-types roles)); sets standard role types if there are missing some of them 389 (add-to-t opicmap389 (add-to-tm 390 390 tm 391 391 (make-construct 'AssociationC … … 416 416 ((topic-vector (get-topic-elems xtm-dom))) 417 417 (loop for top-elem across topic-vector do 418 (add-to-t opicmap418 (add-to-tm 419 419 tm 420 420 (from-topic-elem-to-stub top-elem revision
Note: See TracChangeset
for help on using the changeset viewer.