
Author: lgiessmann Date: Fri Oct 8 06:12:59 2010 New Revision: 322 Log: new-datamodel: fixed ticket #72 -> http://trac.common-lisp.net/isidorus/ticket/72 Modified: branches/new-datamodel/src/unit_tests/exporter_xtm2.0_test.lisp branches/new-datamodel/src/unit_tests/fixtures.lisp branches/new-datamodel/src/unit_tests/importer_test.lisp branches/new-datamodel/src/unit_tests/json_test.lisp branches/new-datamodel/src/unit_tests/rdf_importer_test.lisp branches/new-datamodel/src/xml/rdf/importer.lisp branches/new-datamodel/src/xml/xtm/setup.lisp Modified: branches/new-datamodel/src/unit_tests/exporter_xtm2.0_test.lisp ============================================================================== --- branches/new-datamodel/src/unit_tests/exporter_xtm2.0_test.lisp (original) +++ branches/new-datamodel/src/unit_tests/exporter_xtm2.0_test.lisp Fri Oct 8 06:12:59 2010 @@ -71,8 +71,8 @@ (handler-case (delete-file *out-xtm1.0-file*) (error () )) ;do nothing (setup-repository *sample_objects_2_0.xtm* "data_base" :xtm-id "test-tm" - :tm-id "http://isidorus.org/test-tm")) - ;(elephant:open-store (get-store-spec "data_base"))) + :tm-id "http://isidorus.org/test-tm") + (elephant:open-store (get-store-spec "data_base"))) (def-fixture refill-test-db () Modified: branches/new-datamodel/src/unit_tests/fixtures.lisp ============================================================================== --- branches/new-datamodel/src/unit_tests/fixtures.lisp (original) +++ branches/new-datamodel/src/unit_tests/fixtures.lisp Fri Oct 8 06:12:59 2010 @@ -190,8 +190,7 @@ (setf d:*current-xtm* document-id) (rdf-importer:setup-rdf-module *poems_light.rdf* db-dir :tm-id tm-id :document-id document-id) - - ;(elephant:open-store (xml-importer:get-store-spec db-dir)) + (elephant:open-store (xml-importer:get-store-spec db-dir)) (&body) (tear-down-test-db))) @@ -207,7 +206,7 @@ (setf d:*current-xtm* document-id) (setup-repository *poems_light.xtm* db-dir :tm-id tm-id :xtm-id document-id) - ;(elephant:open-store (xml-importer:get-store-spec db-dir)) + (elephant:open-store (xml-importer:get-store-spec db-dir)) (rdf-exporter:export-rdf exported-file-path :tm-id tm-id) (&body) (handler-case (delete-file exported-file-path) 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 Fri Oct 8 06:12:59 2010 @@ -440,7 +440,7 @@ :tm-id "http://www.isidor.us/unittests/xtm1.0-tests" :xtm-id *TEST-TM* :xtm-format '1.0) (setf *TM-REVISION* 0) - ;(elephant:open-store (xml-importer:get-store-spec dir)) + (elephant:open-store (xml-importer:get-store-spec dir)) ;13 + (23 core topics) (is (= 36 (length (elephant:get-instances-by-class 'TopicC)))) ;2 + (11 instanceOf) @@ -603,7 +603,7 @@ (xml-importer:setup-repository *sample_objects.xtm* dir :xtm-id *TEST-TM* :xtm-format '1.0 :tm-id "http://isidorus.org/test-tm") - ;(elephant:open-store (xml-importer:get-store-spec dir)) + (elephant:open-store (xml-importer:get-store-spec dir)) (is (= (length (elephant:get-instances-by-class 'VariantC)) 5)) (let ((t-2526 (get-item-by-id "t-2526"))) (loop for baseName in (names t-2526) 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 Fri Oct 8 06:12:59 2010 @@ -64,8 +64,7 @@ (with-fixture initialize-destination-db (dir) (xml-importer:setup-repository *notificationbase.xtm* dir :tm-id "http://www.isidor.us/unittests/testtm" - :xtm-id *TEST-TM*) - + :xtm-id *TEST-TM*) (elephant:open-store (xml-importer:get-store-spec dir)) (let ((t50a (get-item-by-id "t50a" :xtm-id *TEST-TM* :revision rev-0))) (let ((t50a-string (to-json-string t50a :revision 0)) @@ -102,6 +101,7 @@ (xml-importer:setup-repository *notificationbase.xtm* dir :tm-id "http://www.isidor.us/unittests/testtm" :xtm-id *TEST-TM*) + (elephant:open-store (xml-importer:get-store-spec dir)) (let ((t57 (get-item-by-id "t57" :revision rev-0 :xtm-id *TEST-TM*)) (t59 (get-item-by-id "t59" :revision rev-0 :xtm-id *TEST-TM*)) (t202 (get-item-by-id "t202" :revision rev-0 :xtm-id *TEST-TM*)) @@ -165,6 +165,7 @@ (xml-importer:setup-repository *notificationbase.xtm* dir :tm-id "http://www.isidor.us/unittests/testtm" :xtm-id *TEST-TM*) + (elephant:open-store (xml-importer:get-store-spec dir)) (let ((frag-t100 (create-latest-fragment-of-topic "http://psi.egovpt.org/standard/ISO+19115%3A+Geographic+Information+-+Metadat...")) @@ -189,6 +190,7 @@ (xml-importer:setup-repository *notificationbase.xtm* dir :tm-id "http://www.isidor.us/unittests/testtm" :xtm-id *TEST-TM*) + (elephant:open-store (xml-importer:get-store-spec dir)) (let ((json-fragment (let ((fragment-obj (create-latest-fragment-of-topic "http://psi.egovpt.org/standard/Topic+Maps+2002"))) @@ -222,6 +224,7 @@ (xml-importer:setup-repository *notificationbase.xtm* dir :tm-id "http://www.isidor.us/unittests/testtm" :xtm-id *TEST-TM*) + (elephant:open-store (xml-importer:get-store-spec dir)) (let ((json-fragment (let ((fragment-obj (create-latest-fragment-of-topic "http://psi.egovpt.org/standard/Topic+Maps+2002"))) @@ -287,6 +290,7 @@ (xml-importer:setup-repository *notificationbase.xtm* dir :tm-id "http://www.isidor.us/unittests/testtm" :xtm-id *TEST-TM*) + (elephant:open-store (xml-importer:get-store-spec dir)) (let ((json-fragment (let ((fragment-obj (create-latest-fragment-of-topic "http://psi.egovpt.org/standard/Topic+Maps+2002"))) @@ -348,6 +352,7 @@ (xml-importer:setup-repository *notificationbase.xtm* dir :tm-id "http://www.isidor.us/unittests/testtm" :xtm-id *TEST-TM*) + (elephant:open-store (xml-importer:get-store-spec dir)) (let ((json-fragment (let ((fragment-obj (create-latest-fragment-of-topic "http://psi.egovpt.org/standard/Topic+Maps+2002"))) @@ -453,6 +458,7 @@ (xml-importer:setup-repository *notificationbase.xtm* dir :tm-id "http://www.isidor.us/unittests/testtm" :xtm-id *TEST-TM*) + (elephant:open-store (xml-importer:get-store-spec dir)) (let ((json-fragment (let ((fragment-obj (create-latest-fragment-of-topic "http://psi.egovpt.org/standard/Topic+Maps+2002"))) @@ -1324,6 +1330,7 @@ (xml-importer:setup-repository *notificationbase.xtm* dir :tm-id "http://www.isidor.us/unittests/testtm" :xtm-id *TEST-TM*) + (elephant:open-store (xml-importer:get-store-spec dir)) (let ((json-psis (json:decode-json-from-string (get-all-topic-psis :revision rev-0)))) (is (= (length json-psis) Modified: branches/new-datamodel/src/unit_tests/rdf_importer_test.lisp ============================================================================== --- branches/new-datamodel/src/unit_tests/rdf_importer_test.lisp (original) +++ branches/new-datamodel/src/unit_tests/rdf_importer_test.lisp Fri Oct 8 06:12:59 2010 @@ -2866,7 +2866,7 @@ (rdf-importer:rdf-importer rdf-file dir :tm-id tm-id :document-id document-id) - ;(elephant:open-store (xml-importer:get-store-spec dir)) + (elephant:open-store (xml-importer:get-store-spec dir)) (is (= (length (elephant:get-instances-by-class 'd:TopicC)) 15)) (is (= (length (elephant:get-instances-by-class 'd:AssociationC)) 1)) (is (= (length (elephant:get-instances-by-class 'd:NameC)) 4)) Modified: branches/new-datamodel/src/xml/rdf/importer.lisp ============================================================================== --- branches/new-datamodel/src/xml/rdf/importer.lisp (original) +++ branches/new-datamodel/src/xml/rdf/importer.lisp Fri Oct 8 06:12:59 2010 @@ -20,9 +20,9 @@ (xml-importer:init-isidorus) (init-rdf-module) (rdf-importer rdf-xml-path repository-path :tm-id tm-id - :document-id document-id)) -; (when elephant:*store-controller* -; (elephant:close-store))) + :document-id document-id) + (when elephant:*store-controller* + (elephant:close-store))) (defun rdf-importer (rdf-xml-path repository-path @@ -46,7 +46,7 @@ (format t "#Objects in the store: Topics: ~a, Associations: ~a~%" (length (elephant:get-instances-by-class 'TopicC)) (length (elephant:get-instances-by-class 'AssociationC))) -; (elephant:close-store) + (elephant:close-store) (setf *_n-map* nil))) Modified: branches/new-datamodel/src/xml/xtm/setup.lisp ============================================================================== --- branches/new-datamodel/src/xml/xtm/setup.lisp (original) +++ branches/new-datamodel/src/xml/xtm/setup.lisp Fri Oct 8 06:12:59 2010 @@ -50,6 +50,6 @@ (elephant:open-store (get-store-spec repository-path))) (init-isidorus) - (import-xtm xtm-path repository-path :tm-id tm-id :xtm-id xtm-id :xtm-format xtm-format)) -; (when elephant:*store-controller* -; (elephant:close-store))) \ No newline at end of file + (import-xtm xtm-path repository-path :tm-id tm-id :xtm-id xtm-id :xtm-format xtm-format) + (when elephant:*store-controller* + (elephant:close-store))) \ No newline at end of file