[isidorus-cvs] r238 - in branches/new-datamodel/src: json model unit_tests xml/xtm
Lukas Giessmann
lgiessmann at common-lisp.net
Sun Mar 21 16:53:44 UTC 2010
Author: lgiessmann
Date: Sun Mar 21 12:53:44 2010
New Revision: 238
Log:
new-datamodel: changed some sections that causes errors with other packages
Modified:
branches/new-datamodel/src/json/json_exporter.lisp
branches/new-datamodel/src/model/datamodel.lisp
branches/new-datamodel/src/unit_tests/importer_test.lisp
branches/new-datamodel/src/unit_tests/json_test.lisp
branches/new-datamodel/src/xml/xtm/exporter_xtm1.0.lisp
branches/new-datamodel/src/xml/xtm/exporter_xtm2.0.lisp
Modified: branches/new-datamodel/src/json/json_exporter.lisp
==============================================================================
--- branches/new-datamodel/src/json/json_exporter.lisp (original)
+++ branches/new-datamodel/src/json/json_exporter.lisp Sun Mar 21 12:53:44 2010
@@ -46,7 +46,7 @@
(eql (elt value 0) #\#))
(get-item-by-id (subseq value 1) :xtm-id xtm-id))))
(if ref-topic
- (concatenate 'string "#" (topicid ref-topic))
+ (concatenate 'string "#" (topic-id ref-topic))
value))))
(json:encode-json-to-string inner-value))
",\"resourceData\":null")
@@ -147,7 +147,7 @@
(defmethod to-json-string ((instance TopicC) &key (xtm-id d:*current-xtm*))
"transforms an TopicC object to a json string"
(let ((id
- (concatenate 'string "\"id\":" (json:encode-json-to-string (topicid instance))))
+ (concatenate 'string "\"id\":" (json:encode-json-to-string (topic-id instance))))
(itemIdentity
(concatenate 'string "\"itemIdentities\":"
(identifiers-to-json-string instance :what 'item-identifiers)))
@@ -188,7 +188,7 @@
subjectIdentifiers"
(when topic
(let ((id
- (concatenate 'string "\"id\":" (json:encode-json-to-string (topicid topic))))
+ (concatenate 'string "\"id\":" (json:encode-json-to-string (topic-id topic))))
(itemIdentity
(concatenate 'string "\"itemIdentities\":"
(identifiers-to-json-string topic :what 'item-identifiers)))
@@ -310,7 +310,7 @@
*occurrences (jonly the resourceRef and resourceData elements)"
(declare (TopicC topic))
(let ((id
- (concatenate 'string "\"id\":\"" (topicid topic) "\""))
+ (concatenate 'string "\"id\":\"" (topic-id topic) "\""))
(itemIdentity
(concatenate 'string "\"itemIdentities\":"
(identifiers-to-json-string topic :what 'item-identifiers)))
Modified: branches/new-datamodel/src/model/datamodel.lisp
==============================================================================
--- branches/new-datamodel/src/model/datamodel.lisp (original)
+++ branches/new-datamodel/src/model/datamodel.lisp Sun Mar 21 12:53:44 2010
@@ -12,11 +12,14 @@
(:nicknames :d)
(:import-from :exceptions
duplicate-identifier-error)
+ (:import-from :exceptions
+ object-not-found-error)
(:import-from :constants
*xml-string*)
(:import-from :constants
*instance-psi*)
(:export ;;classes
+ :TopicMapConstructC
:TopicMapC
:AssociationC
:RoleC
@@ -28,6 +31,7 @@
:SubjectLocatorC
:TopicIdentificationC
:TopicC
+ :FragmentC
;;methods, functions and macros
:xtm-id
@@ -40,6 +44,7 @@
:add-reifier
:delete-reifier
:find-item-by-revision
+ :find-most-recent-revision
:themes
:add-theme
:delete-theme
@@ -68,6 +73,7 @@
:topic-identifiers
:add-topic-identifier
:delete-topic-identifier
+ :topic-id
:locators
:add-locator
:delete-locator
@@ -92,6 +98,7 @@
:get-item-by-psi
:get-item-by-item-identifier
:get-item-by-locator
+ :get-item-by-content
:string-integer-p
:with-revision
:get-latest-fragment-of-topic
@@ -118,7 +125,18 @@
:make-construct
:list-instanceOf
:in-topicmap
- :string-start-with
+ :string-starts-with
+ :get-fragments
+ :get-fragment
+ :get-all-revisions
+ :unique-id
+ :topic
+ :revision
+ :get-all-revisions-for-tm
+ :add-source-locator
+ :changed-p
+ :check-for-duplicate-identifiers
+ :find-item-by-content
;;globals
:*TM-REVISION*
@@ -596,6 +614,19 @@
;;; some helpers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun get-item-by-content (content &key (revision *TM-REVISION*))
+ "Finds characteristics by their (atomic) content."
+ (flet
+ ((get-existing-instances (class-symbol)
+ (delete-if-not
+ #'(lambda (constr)
+ (find-item-by-revision constr revision))
+ (elephant:get-instances-by-value class-symbol 'charvalue content))))
+ (nconc (get-existing-instances 'OccurenceC)
+ (get-existing-instances 'NameC)
+ (get-existing-instances 'VariantC))))
+
+
(defmacro with-revision (revision &rest body)
`(let
((*TM-REVISION* ,revision))
@@ -698,6 +729,11 @@
;;; generic definitions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defgeneric check-for-duplicate-identifiers (construct)
+ (:documentation "Check for possibly duplicate identifiers and signal an
+ duplicate-identifier-error is such duplicates are found"))
+
+
(defgeneric get-all-identifiers-of-construct (construct &key revision)
(:documentation "Get all identifiers that a given construct has"))
@@ -855,6 +891,12 @@
;;; TopicMapconstructC
+(defmethod check-for-duplicate-identifiers ((construct TopicMapConstructC))
+ (declare (ignore construct))
+ ;do nothing
+ )
+
+
(defmethod get-all-characteristics ((parent-construct TopicC)
(characteristic-symbol symbol))
(cond ((OccurrenceC-p characteristic-symbol)
@@ -1109,6 +1151,30 @@
t))
+(defgeneric topic-id (construct &optional revision xtm-id)
+ (:documentation "Returns the primary id of this item
+ (= essentially the OID). If xtm-id is explicitly given,
+ returns one of the topic-ids in that TM
+ (which must then exist).")
+ (:method ((construct TopicC) &optional (xtm-id nil) (revision 0))
+ (declare (type (or null string) xtm-id) (integer revision))
+ (if xtm-id
+ (let ((possible-identifiers
+ (remove-if-not
+ #'(lambda(top-id)
+ (string= (xtm-id top-id) xtm-id))
+ (topic-identifiers construct :revision revision))))
+ (unless possible-identifiers
+ (error (make-condition
+ 'object-not-found-error
+ :message
+ (format nil "Could not find an object ~a in xtm-id ~a"
+ construct xtm-id))))
+ (uri (first possible-identifiers)))
+ (concatenate 'string "t" (write-to-string (internal-id construct))))))
+
+
+
(defgeneric topic-identifiers (construct &key revision)
(:documentation "Returns the TopicIdentificationC-objects that correspond
with the passed construct and the passed version.")
@@ -2014,6 +2080,22 @@
;;; ReifiableConstructC
+(defmethod check-for-duplicate-identifiers ((construct ReifiableConstructC))
+ (dolist (id (get-all-identifiers-of-construct construct))
+ (when (>
+ (length
+ (union
+ (elephant:get-instances-by-value 'ItemIdentifierC 'uri (uri id))
+ (union
+ (elephant:get-instances-by-value 'PersistentIdC 'uri (uri id))
+ (elephant:get-instances-by-value 'SubjectLocatorC 'uri (uri id)))))
+ 1)
+ (error
+ (make-condition 'duplicate-identifier-error
+ :message (format nil "Duplicate Identifier ~a has been found" (uri id))
+ :uri (uri id))))))
+
+
(defgeneric ReifiableConstructC-p (class-symbol)
(:documentation "Returns t if the passed symbol is equal to ReifiableConstructC
or one of its subtypes.")
Modified: branches/new-datamodel/src/unit_tests/importer_test.lisp
==============================================================================
--- branches/new-datamodel/src/unit_tests/importer_test.lisp (original)
+++ branches/new-datamodel/src/unit_tests/importer_test.lisp Sun Mar 21 12:53:44 2010
@@ -98,7 +98,7 @@
(is (= 1 (length t101-themes)))
(is
(string=
- (topicid (first t101-themes) *TEST-TM*)
+ (topic-id (first t101-themes) *TEST-TM*)
"t50a"))))))
(test test-from-name-elem
@@ -129,7 +129,7 @@
"http://psi.egovpt.org/types/long-name"))
(is (themes t101-longname))
(is (string=
- (topicid (first (themes t101-longname)) *TEST-TM*)
+ (topic-id (first (themes t101-longname)) *TEST-TM*)
"t50a"))
(is (eq t1-name t1-name-copy)) ;must be merged
))))
@@ -233,10 +233,10 @@
((12th-role
(from-role-elem (nth 11 role-elems) revision)))
(is (string= "t101"
- (topicid
+ (topic-id
(getf 12th-role :player) *TEST-TM*)))
(is (string= "t62"
- (topicid
+ (topic-id
(getf 12th-role :instance-of) *TEST-TM*)))))))
(test test-from-association-elem
@@ -261,12 +261,12 @@
(is (= 2 (length (roles last-assoc))))
(is (= 1 (length (item-identifiers last-assoc))))
(is (string= "t300"
- (topicid (player (first (roles 6th-assoc))) *TEST-TM*)))
+ (topic-id (player (first (roles 6th-assoc))) *TEST-TM*)))
(is (string= "t63"
- (topicid (instance-of (first (roles 6th-assoc)))
+ (topic-id (instance-of (first (roles 6th-assoc)))
*TEST-TM*)))
(is (string= "t301"
- (topicid (player (first (roles last-assoc)))
+ (topic-id (player (first (roles last-assoc)))
*TEST-TM*))))
;(untrace datamodel:item-identifiers datamodel::filter-slot-value-by-revision))
)
@@ -302,8 +302,8 @@
(is
(typep io-assoc
'AssociationC))
- (is (string= (topicid topic)
- (topicid (player (second (roles io-assoc))))))))))
+ (is (string= (topic-id topic)
+ (topic-id (player (second (roles io-assoc))))))))))
(let*
((t101-top (get-item-by-id "t101"))
@@ -329,9 +329,9 @@
(is (= 1 (length role-101)))
;(is (= 1 (length (d::versions role-101))))
(is (string= "t3a"
- (topicid (player (first (roles (parent (first role-101))))) *TEST-TM*)))
+ (topic-id (player (first (roles (parent (first role-101))))) *TEST-TM*)))
(is (string= "type-instance"
- (topicid (instance-of
+ (topic-id (instance-of
(parent (first role-101))) "core.xtm")))
))))
Modified: branches/new-datamodel/src/unit_tests/json_test.lisp
==============================================================================
--- branches/new-datamodel/src/unit_tests/json_test.lisp (original)
+++ branches/new-datamodel/src/unit_tests/json_test.lisp Sun Mar 21 12:53:44 2010
@@ -70,27 +70,27 @@
(let ((t50a (get-item-by-id "t50a")))
(let ((t50a-string (to-json-string t50a))
(json-string
- (concatenate 'string "{\"id\":\"" (topicid t50a) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t50a\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/long-name\"],\"instanceOfs\":[[\"http:\\/\\/www.networkedplanet.com\\/psi\\/npcl\\/meta-types\\/occurrence-type\"]],\"names\":[{\"itemIdentities\":null,\"type\":null,\"scopes\":null,\"value\":\"long version of a name\",\"variants\":[{\"itemIdentities\":null,\"scopes\":[[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#sort\"]],\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"Long-Version\"}}]}],\"occurrences\":null}" )))
+ (concatenate 'string "{\"id\":\"" (topic-id t50a) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t50a\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/long-name\"],\"instanceOfs\":[[\"http:\\/\\/www.networkedplanet.com\\/psi\\/npcl\\/meta-types\\/occurrence-type\"]],\"names\":[{\"itemIdentities\":null,\"type\":null,\"scopes\":null,\"value\":\"long version of a name\",\"variants\":[{\"itemIdentities\":null,\"scopes\":[[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#sort\"]],\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"Long-Version\"}}]}],\"occurrences\":null}" )))
(is (string= t50a-string json-string)))
(let ((t8 (get-item-by-id "t8")))
(let ((t8-string (to-json-string t8))
(json-string
- (concatenate 'string "{\"id\":\"" (topicid t8) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t8\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/www.networkedplanet.com\\/psi\\/npcl\\/meta-types\\/association-role-type\"],\"instanceOfs\":[[\"http:\\/\\/www.networkedplanet.com\\/psi\\/npcl\\/meta-types\\/topic-type\"]],\"names\":[{\"itemIdentities\":null,\"type\":null,\"scopes\":null,\"value\":\"Association Role Type\",\"variants\":null}],\"occurrences\":null}")))
+ (concatenate 'string "{\"id\":\"" (topic-id t8) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t8\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/www.networkedplanet.com\\/psi\\/npcl\\/meta-types\\/association-role-type\"],\"instanceOfs\":[[\"http:\\/\\/www.networkedplanet.com\\/psi\\/npcl\\/meta-types\\/topic-type\"]],\"names\":[{\"itemIdentities\":null,\"type\":null,\"scopes\":null,\"value\":\"Association Role Type\",\"variants\":null}],\"occurrences\":null}")))
(is (string= t8-string json-string))))
(let ((t-topic (get-item-by-id "topic" :xtm-id "core.xtm")))
(let ((t-topic-string (to-json-string t-topic))
(json-string
- (concatenate 'string "{\"id\":\"" (topicid t-topic) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#topic\"],\"instanceOfs\":null,\"names\":null,\"occurrences\":null}")))
+ (concatenate 'string "{\"id\":\"" (topic-id t-topic) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#topic\"],\"instanceOfs\":null,\"names\":null,\"occurrences\":null}")))
(is (string= t-topic-string json-string))))
(let ((t301 (get-item-by-id "t301")))
(let ((t301-string (to-json-string t301))
(json-string
- (concatenate 'string "{\"id\":\"" (topicid t301) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/service\\/Google+Maps\",\"http:\\/\\/maps.google.com\"],\"instanceOfs\":[[\"http:\\/\\/psi.egovpt.org\\/types\\/service\"]],\"names\":[{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/topic\\/t301a_n1\"],\"type\":null,\"scopes\":[[\"http:\\/\\/psi.egovpt.org\\/types\\/long-name\"]],\"value\":\"Google Maps\",\"variants\":null},{\"itemIdentities\":null,\"type\":null,\"scopes\":[[\"http:\\/\\/psi.egovpt.org\\/types\\/long-name\"]],\"value\":\"Google Maps Application\",\"variants\":null}],\"occurrences\":[{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/description\"],\"scopes\":null,\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"a popular geodata service that is widely used for mashups with geodataProbably not really conformant to ISO 19115, but who cares in this context.\"}},{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/links\"],\"scopes\":null,\"resourceRef\":\"http:\\/\\/maps.google.com\",\"resourceData\":null},{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/links\"],\"scopes\":null,\"resourceRef\":\"http:\\/\\/maps.google.de\",\"resourceData\":null}]}")))
+ (concatenate 'string "{\"id\":\"" (topic-id t301) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/service\\/Google+Maps\",\"http:\\/\\/maps.google.com\"],\"instanceOfs\":[[\"http:\\/\\/psi.egovpt.org\\/types\\/service\"]],\"names\":[{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/topic\\/t301a_n1\"],\"type\":null,\"scopes\":[[\"http:\\/\\/psi.egovpt.org\\/types\\/long-name\"]],\"value\":\"Google Maps\",\"variants\":null},{\"itemIdentities\":null,\"type\":null,\"scopes\":[[\"http:\\/\\/psi.egovpt.org\\/types\\/long-name\"]],\"value\":\"Google Maps Application\",\"variants\":null}],\"occurrences\":[{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/description\"],\"scopes\":null,\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"a popular geodata service that is widely used for mashups with geodataProbably not really conformant to ISO 19115, but who cares in this context.\"}},{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/links\"],\"scopes\":null,\"resourceRef\":\"http:\\/\\/maps.google.com\",\"resourceData\":null},{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/links\"],\"scopes\":null,\"resourceRef\":\"http:\\/\\/maps.google.de\",\"resourceData\":null}]}")))
(is (string= t301-string json-string))))
(let ((t100 (get-item-by-id "t100")))
(let ((t100-string (to-json-string t100))
(json-string
- (concatenate 'string "{\"id\":\"" (topicid t100) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/standard\\/ISO+19115%3A+Geographic+Information+-+Metadata\"],\"instanceOfs\":[[\"http:\\/\\/psi.egovpt.org\\/types\\/semanticstandard\"]],\"names\":[{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_n1\"],\"type\":null,\"scopes\":null,\"value\":\"ISO 19115\",\"variants\":[{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_n1_v1\"],\"scopes\":[[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#display\"]],\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"Geographic Information - Metadata\"}},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_n1_v2\"],\"scopes\":[[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#sort\"]],\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"ISO-19115\"}}]}],\"occurrences\":[{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o1\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardHasStatus\"],\"scopes\":null,\"resourceRef\":\"http:\\/\\/www.budabe.de\\/\",\"resourceData\":null},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o2\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/description\"],\"scopes\":null,\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"The ISO 19115 standard ...\"}},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o3\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardValidFromDate\"],\"scopes\":null,\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#date\",\"value\":\"2003-01-01\"}},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o4\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/links\"],\"scopes\":null,\"resourceRef\":\"http:\\/\\/www.editeur.org\\/standards\\/ISO19115.pdf\",\"resourceData\":null}]}")))
+ (concatenate 'string "{\"id\":\"" (topic-id t100) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/standard\\/ISO+19115%3A+Geographic+Information+-+Metadata\"],\"instanceOfs\":[[\"http:\\/\\/psi.egovpt.org\\/types\\/semanticstandard\"]],\"names\":[{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_n1\"],\"type\":null,\"scopes\":null,\"value\":\"ISO 19115\",\"variants\":[{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_n1_v1\"],\"scopes\":[[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#display\"]],\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"Geographic Information - Metadata\"}},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_n1_v2\"],\"scopes\":[[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#sort\"]],\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"ISO-19115\"}}]}],\"occurrences\":[{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o1\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardHasStatus\"],\"scopes\":null,\"resourceRef\":\"http:\\/\\/www.budabe.de\\/\",\"resourceData\":null},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o2\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/description\"],\"scopes\":null,\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"The ISO 19115 standard ...\"}},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o3\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardValidFromDate\"],\"scopes\":null,\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#date\",\"value\":\"2003-01-01\"}},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o4\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/links\"],\"scopes\":null,\"resourceRef\":\"http:\\/\\/www.editeur.org\\/standards\\/ISO19115.pdf\",\"resourceData\":null}]}")))
(is (string= t100-string json-string))))))))
@@ -156,9 +156,9 @@
(frag-topic
(create-latest-fragment-of-topic "http://www.topicmaps.org/xtm/1.0/core.xtm#topic")))
(let ((frag-t100-string
- (concatenate 'string "{\"topic\":{\"id\":\"" (d:topicid (d:topic frag-t100)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/standard\\/ISO+19115%3A+Geographic+Information+-+Metadata\"],\"instanceOfs\":[[\"http:\\/\\/psi.egovpt.org\\/types\\/semanticstandard\"]],\"names\":[{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_n1\"],\"type\":null,\"scopes\":null,\"value\":\"ISO 19115\",\"variants\":[{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_n1_v1\"],\"scopes\":[[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#display\"]],\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"Geographic Information - Metadata\"}},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_n1_v2\"],\"scopes\":[[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#sort\"]],\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"ISO-19115\"}}]}],\"occurrences\":[{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o1\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardHasStatus\"],\"scopes\":null,\"resourceRef\":\"http:\\/\\/www.budabe.de\\/\",\"resourceData\":null},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o2\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/description\"],\"scopes\":null,\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"The ISO 19115 standard ...\"}},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o3\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardValidFromDate\"],\"scopes\":null,\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#date\",\"value\":\"2003-01-01\"}},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o4\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/links\"],\"scopes\":null,\"resourceRef\":\"http:\\/\\/www.editeur.org\\/standards\\/ISO19115.pdf\",\"resourceData\":null}]},\"topicStubs\":[{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 0)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t3a\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/semanticstandard\"]},{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 1)) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#display\"]},{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 2)) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#sort\"]},{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 3)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t51\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardHasStatus\"]},{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 4)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t53\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/description\"]},{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 5)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t54\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardValidFromDate\"]},{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 6)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t55\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/links\"]},{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 7)) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/subject\\/GeoData\"]},{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 8)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t60\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardIsAboutSubject\"]},{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 9)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t61\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/SubjectRoleType\"]},{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 10)) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/subject\\/Semantic+Description\"]},{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 11)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t64\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/serviceUsesStandard\"]},{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 12)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t63\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/ServiceRoleType\"]},{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 13)) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/service\\/Google+Maps\",\"http:\\/\\/maps.google.com\"]},{\"id\":\"" (topicid (elt (referenced-topics frag-t100) 14)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t62\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/StandardRoleType\"]}],\"associations\":[{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardIsAboutSubject\"],\"scopes\":null,\"roles\":[{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/StandardRoleType\"],\"topicRef\":[\"http:\\/\\/psi.egovpt.org\\/standard\\/ISO+19115%3A+Geographic+Information+-+Metadata\"]},{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/SubjectRoleType\"],\"topicRef\":[\"http:\\/\\/psi.egovpt.org\\/subject\\/GeoData\"]}]},{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardIsAboutSubject\"],\"scopes\":null,\"roles\":[{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/StandardRoleType\"],\"topicRef\":[\"http:\\/\\/psi.egovpt.org\\/standard\\/ISO+19115%3A+Geographic+Information+-+Metadata\"]},{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/SubjectRoleType\"],\"topicRef\":[\"http:\\/\\/psi.egovpt.org\\/subject\\/Semantic+Description\"]}]},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#assoc_7\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/serviceUsesStandard\"],\"scopes\":null,\"roles\":[{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/ServiceRoleType\"],\"topicRef\":[\"http:\\/\\/psi.egovpt.org\\/service\\/Google+Maps\",\"http:\\/\\/maps.google.com\"]},{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/StandardRoleType\"],\"topicRef\":[\"http:\\/\\/psi.egovpt.org\\/standard\\/ISO+19115%3A+Geographic+Information+-+Metadata\"]}]}],\"tmIds\":[\"http:\\/\\/www.isidor.us\\/unittests\\/testtm\"]}"))
+ (concatenate 'string "{\"topic\":{\"id\":\"" (d:topic-id (d:topic frag-t100)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/standard\\/ISO+19115%3A+Geographic+Information+-+Metadata\"],\"instanceOfs\":[[\"http:\\/\\/psi.egovpt.org\\/types\\/semanticstandard\"]],\"names\":[{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_n1\"],\"type\":null,\"scopes\":null,\"value\":\"ISO 19115\",\"variants\":[{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_n1_v1\"],\"scopes\":[[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#display\"]],\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"Geographic Information - Metadata\"}},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_n1_v2\"],\"scopes\":[[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#sort\"]],\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"ISO-19115\"}}]}],\"occurrences\":[{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o1\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardHasStatus\"],\"scopes\":null,\"resourceRef\":\"http:\\/\\/www.budabe.de\\/\",\"resourceData\":null},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o2\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/description\"],\"scopes\":null,\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#string\",\"value\":\"The ISO 19115 standard ...\"}},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o3\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardValidFromDate\"],\"scopes\":null,\"resourceRef\":null,\"resourceData\":{\"datatype\":\"http:\\/\\/www.w3.org\\/2001\\/XMLSchema#date\",\"value\":\"2003-01-01\"}},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t100_o4\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/links\"],\"scopes\":null,\"resourceRef\":\"http:\\/\\/www.editeur.org\\/standards\\/ISO19115.pdf\",\"resourceData\":null}]},\"topicStubs\":[{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 0)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t3a\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/semanticstandard\"]},{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 1)) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#display\"]},{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 2)) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#sort\"]},{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 3)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t51\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardHasStatus\"]},{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 4)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t53\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/description\"]},{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 5)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t54\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardValidFromDate\"]},{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 6)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t55\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/links\"]},{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 7)) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/subject\\/GeoData\"]},{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 8)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t60\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardIsAboutSubject\"]},{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 9)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t61\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/SubjectRoleType\"]},{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 10)) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/subject\\/Semantic+Description\"]},{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 11)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t64\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/serviceUsesStandard\"]},{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 12)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t63\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/ServiceRoleType\"]},{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 13)) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/service\\/Google+Maps\",\"http:\\/\\/maps.google.com\"]},{\"id\":\"" (topic-id (elt (referenced-topics frag-t100) 14)) "\",\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#t62\"],\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/psi.egovpt.org\\/types\\/StandardRoleType\"]}],\"associations\":[{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardIsAboutSubject\"],\"scopes\":null,\"roles\":[{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/StandardRoleType\"],\"topicRef\":[\"http:\\/\\/psi.egovpt.org\\/standard\\/ISO+19115%3A+Geographic+Information+-+Metadata\"]},{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/SubjectRoleType\"],\"topicRef\":[\"http:\\/\\/psi.egovpt.org\\/subject\\/GeoData\"]}]},{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/standardIsAboutSubject\"],\"scopes\":null,\"roles\":[{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/StandardRoleType\"],\"topicRef\":[\"http:\\/\\/psi.egovpt.org\\/standard\\/ISO+19115%3A+Geographic+Information+-+Metadata\"]},{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/SubjectRoleType\"],\"topicRef\":[\"http:\\/\\/psi.egovpt.org\\/subject\\/Semantic+Description\"]}]},{\"itemIdentities\":[\"http:\\/\\/psi.egovpt.org\\/itemIdentifiers#assoc_7\"],\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/serviceUsesStandard\"],\"scopes\":null,\"roles\":[{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/ServiceRoleType\"],\"topicRef\":[\"http:\\/\\/psi.egovpt.org\\/service\\/Google+Maps\",\"http:\\/\\/maps.google.com\"]},{\"itemIdentities\":null,\"type\":[\"http:\\/\\/psi.egovpt.org\\/types\\/StandardRoleType\"],\"topicRef\":[\"http:\\/\\/psi.egovpt.org\\/standard\\/ISO+19115%3A+Geographic+Information+-+Metadata\"]}]}],\"tmIds\":[\"http:\\/\\/www.isidor.us\\/unittests\\/testtm\"]}"))
(frag-topic-string
- (concatenate 'string "{\"topic\":{\"id\":\"" (topicid (topic frag-topic)) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#topic\"],\"instanceOfs\":null,\"names\":null,\"occurrences\":null},\"topicStubs\":null,\"associations\":null,\"tmIds\":[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm\"]}")))
+ (concatenate 'string "{\"topic\":{\"id\":\"" (topic-id (topic frag-topic)) "\",\"itemIdentities\":null,\"subjectLocators\":null,\"subjectIdentifiers\":[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm#topic\"],\"instanceOfs\":null,\"names\":null,\"occurrences\":null},\"topicStubs\":null,\"associations\":null,\"tmIds\":[\"http:\\/\\/www.topicmaps.org\\/xtm\\/1.0\\/core.xtm\"]}")))
(is (string= frag-t100-string (to-json-string frag-t100)))
(is (string= frag-topic-string (to-json-string frag-topic))))))))
@@ -181,7 +181,7 @@
(json:decode-json-from-string json-fragment))))
(let ((topic (getf fragment-list :topic)))
(is (string= (getf topic :ID)
- (d:topicid
+ (d:topic-id
(d:identified-construct (elephant:get-instance-by-value 'd:PersistentIdC 'd:uri
"http://psi.egovpt.org/standard/Topic+Maps+2002")))))
(is-false (getf topic :itemIdentities))
@@ -294,7 +294,7 @@
"http://psi.egovpt.org/types/standardHasStatus"))
(is-false (getf occurrence-1 :scopes))
(is (string= (getf occurrence-1 :resourceRef)
- (concatenate 'string "#" (d:topicid ref-topic))))
+ (concatenate 'string "#" (d:topic-id ref-topic))))
(is-false (getf occurrence-1 :resourceData))
(is-false (getf occurrence-2 :itemIdentities))
(is (= (length (getf occurrence-2 :type)) 1))
@@ -357,7 +357,7 @@
subjectIdentifier))))
(is-true topic)
(is-false subjectLocators)
- (is (string= (d:topicid topic) id))
+ (is (string= (d:topic-id topic) id))
(cond
((string= subjectIdentifier "http://psi.egovpt.org/types/semanticstandard")
(is (= (length itemIdentities) 1))
Modified: branches/new-datamodel/src/xml/xtm/exporter_xtm1.0.lisp
==============================================================================
--- branches/new-datamodel/src/xml/xtm/exporter_xtm1.0.lisp (original)
+++ branches/new-datamodel/src/xml/xtm/exporter_xtm1.0.lisp Sun Mar 21 12:53:44 2010
@@ -31,7 +31,7 @@
(defun to-topicRef-elem-xtm1.0 (topic)
(declare (TopicC topic))
(cxml:with-element "t:topicRef"
- (cxml:attribute "xlink:href" (format nil "#~a" (topicid topic)))))
+ (cxml:attribute "xlink:href" (format nil "#~a" (topic-id topic)))))
(defun to-reifier-elem-xtm1.0 (reifiable-construct)
@@ -67,7 +67,7 @@
(let ((ref-topic (when (and (> (length characteristic-value) 0)
(eql (elt characteristic-value 0) #\#))
(get-item-by-id (subseq characteristic-value 1)))))
- (if ref-topic (concatenate 'string "#" (topicid ref-topic)) characteristic-value))))
+ (if ref-topic (concatenate 'string "#" (topic-id ref-topic)) characteristic-value))))
(cxml:with-element "t:resourceData"
(cxml:text characteristic-value)))))
@@ -83,7 +83,7 @@
(declare (TopicC topic))
(cxml:with-element "t:instanceOf"
(cxml:with-element "t:topicRef"
- (cxml:attribute "xlink:href" (concatenate 'string "#" (topicid topic))))))
+ (cxml:attribute "xlink:href" (concatenate 'string "#" (topic-id topic))))))
(defun to-subjectIdentity-elem-xtm1.0 (psis locator)
@@ -145,7 +145,7 @@
"topic = element topic { id, instanceOf*, subjectIdentity,
(baseName | occurrence)* }"
(cxml:with-element "t:topic"
- (cxml:attribute "id" (topicid topic))
+ (cxml:attribute "id" (topic-id topic))
(when (list-instanceOf topic :tm *export-tm*)
(map 'list #'to-instanceOf-elem-xtm1.0 (list-instanceOf topic :tm *export-tm*)))
(when (or (psis topic) (locators topic))
@@ -188,7 +188,7 @@
with a topicid, psis and subjectLocators"
(declare (TopicC topic))
(cxml:with-element "t:topic"
- (cxml:attribute "id" (topicid topic))
+ (cxml:attribute "id" (topic-id topic))
(to-subjectIdentity-elem-xtm1.0 (psis topic) (first (locators topic)))))
Modified: branches/new-datamodel/src/xml/xtm/exporter_xtm2.0.lisp
==============================================================================
--- branches/new-datamodel/src/xml/xtm/exporter_xtm2.0.lisp (original)
+++ branches/new-datamodel/src/xml/xtm/exporter_xtm2.0.lisp Sun Mar 21 12:53:44 2010
@@ -25,7 +25,7 @@
;;TODO: this is pretty much of a hack that works only for local
;;references
(cxml:attribute "href"
- (format nil "#~a" (topicid topic)))))
+ (format nil "#~a" (topic-id topic)))))
(defgeneric to-elem (instance)
(:documentation "converts the Topic Maps construct instance to an XTM 2.0 element"))
@@ -74,7 +74,7 @@
(get-item-by-id (subseq characteristic-value 1)))))
(cxml:attribute "href"
(if ref-topic
- (concatenate 'string "#" (topicid ref-topic))
+ (concatenate 'string "#" (topic-id ref-topic))
characteristic-value))))
(cxml:with-element "t:resourceData"
(when (slot-boundp characteristic 'datatype)
@@ -124,7 +124,7 @@
(itemIdentity | subjectLocator | subjectIdentifier)*,
instanceOf?, (name | occurrence)* }"
(cxml:with-element "t:topic"
- (cxml:attribute "id" (topicid topic))
+ (cxml:attribute "id" (topic-id topic))
(map 'list #'to-elem (item-identifiers topic))
(map 'list #'to-elem (locators topic))
(map 'list #'to-elem (psis topic))
@@ -132,7 +132,7 @@
(cxml:with-element "t:instanceOf"
(loop for item in (list-instanceOf topic :tm *export-tm*)
do (cxml:with-element "t:topicRef"
- (cxml:attribute "href" (concatenate 'string "#" (topicid item)))))))
+ (cxml:attribute "href" (concatenate 'string "#" (topic-id item)))))))
(map 'list #'to-elem (names topic))
(map 'list #'to-elem (occurrences topic))))
@@ -142,7 +142,7 @@
with a topicid, a subjectLocator and an itemIdentity element"
(declare (TopicC topic))
(cxml:with-element "t:topic"
- (cxml:attribute "id" (topicid topic))
+ (cxml:attribute "id" (topic-id topic))
(map 'list #'to-elem (psis topic))
(map 'list #'to-elem (item-identifiers topic))
(map 'list #'to-elem (locators topic))))
More information about the Isidorus-cvs
mailing list