Changeset 320 for branches/new-datamodel/src/unit_tests
- Timestamp:
- 10/06/10 21:30:04 (15 years ago)
- Location:
- branches/new-datamodel/src/unit_tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/new-datamodel/src/unit_tests/fixtures.lisp ¶
r298 r320 191 191 (rdf-importer:setup-rdf-module *poems_light.rdf* db-dir :tm-id tm-id 192 192 :document-id document-id) 193 (elephant:open-store (xml-importer:get-store-spec db-dir)) 193 194 ;(elephant:open-store (xml-importer:get-store-spec db-dir)) 194 195 (&body) 195 196 (tear-down-test-db))) -
TabularUnified branches/new-datamodel/src/unit_tests/rdf_importer_test.lisp ¶
r154 r320 1055 1055 (is (= (length (elephant:get-instances-by-class 'd:TopicC)) 20)) 1056 1056 (let ((first-node (get-item-by-id "http://test-tm/first-node" 1057 :xtm-id document-id)) 1057 :xtm-id document-id 1058 :revision 0)) 1058 1059 (first-type (get-item-by-id "http://test-tm/first-type" 1059 :xtm-id document-id))) 1060 :xtm-id document-id 1061 :revision 0))) 1060 1062 (is-true first-node) 1061 1063 (is (= (length (d::versions first-node)) 1)) … … 1067 1069 (is (= (length (d:player-in-roles first-type)) 1)) 1068 1070 (let ((instance-role 1069 (first (d:player-in-roles first-node )))1071 (first (d:player-in-roles first-node :revision 0))) 1070 1072 (type-role 1071 (first (d:player-in-roles first-type )))1073 (first (d:player-in-roles first-type :revision 0))) 1072 1074 (type-assoc 1073 (d:parent (first (d:player-in-roles first-node))))) 1075 (d:parent (first (d:player-in-roles first-node :revision 0)) 1076 :revision 0))) 1074 1077 (is (= (length (d::versions type-assoc)) 1)) 1075 1078 (is (= (d::start-revision (first (d::versions type-assoc))) … … 1081 1084 (is (eql (d:instance-of type-assoc) 1082 1085 (d:get-item-by-psi *type-instance-psi*))) 1083 (is (= (length (d:roles type-assoc )) 2))1086 (is (= (length (d:roles type-assoc :revision 0)) 2)) 1084 1087 (is (= (length (d:psis first-node)) 1)) 1085 1088 (is (= (length (d:psis first-type)) 1)) … … 1096 1099 :document-id document-id)) 1097 1100 (let ((first-node (get-item-by-id "http://test-tm/first-node" 1098 :xtm-id document-id)) 1101 :xtm-id document-id 1102 :revision 0)) 1099 1103 (first-type (get-item-by-id "http://test-tm/first-type" 1100 :xtm-id document-id)) 1104 :xtm-id document-id 1105 :revision 0)) 1101 1106 (second-node (get-item-by-id "second-node" 1102 :xtm-id document-id)) 1107 :xtm-id document-id 1108 :revision 0)) 1103 1109 (second-type (get-item-by-id "http://test-tm/second-type" 1104 :xtm-id document-id)) 1110 :xtm-id document-id 1111 :revision 0)) 1105 1112 (third-node (get-item-by-id "http://test-tm#third-node" 1106 :xtm-id document-id))) 1113 :xtm-id document-id 1114 :revision 0))) 1107 1115 (is-true second-node) 1108 (is-false (d:psis second-node ))1109 (is-false (d:occurrences second-node ))1110 (is-false (d:names second-node ))1116 (is-false (d:psis second-node :revision 0)) 1117 (is-false (d:occurrences second-node :revision 0)) 1118 (is-false (d:names second-node :revision 0)) 1111 1119 (is-true first-node) 1112 1120 (is (= (length (d::versions first-node)) 2)) … … 1120 1128 (d::versions first-node))) 1121 1129 (let ((instance-role 1122 (first (d:player-in-roles first-node )))1130 (first (d:player-in-roles first-node :revision 0))) 1123 1131 (type-role 1124 (first (d:player-in-roles first-type )))1132 (first (d:player-in-roles first-type :revision 0))) 1125 1133 (type-assoc 1126 (d:parent (first (d:player-in-roles first-node)))) 1127 (type-topic (get-item-by-psi *type-psi*)) 1128 (instance-topic (get-item-by-psi *instance-psi*)) 1129 (type-instance-topic (get-item-by-psi *type-instance-psi*)) 1130 (supertype-topic (get-item-by-psi *supertype-psi*)) 1131 (subtype-topic (get-item-by-psi *subtype-psi*)) 1134 (d:parent (first (d:player-in-roles first-node 1135 :revision 0)))) 1136 (type-topic (get-item-by-psi *type-psi* :revision 0)) 1137 (instance-topic (get-item-by-psi *instance-psi* :revision 0)) 1138 (type-instance-topic (get-item-by-psi *type-instance-psi* 1139 :revision 0)) 1140 (supertype-topic (get-item-by-psi *supertype-psi* 1141 :revision 0)) 1142 (subtype-topic (get-item-by-psi *subtype-psi* 1143 :revision 0)) 1132 1144 (supertype-subtype-topic 1133 (get-item-by-psi *supertype-subtype-psi* ))1145 (get-item-by-psi *supertype-subtype-psi* :revision 0)) 1134 1146 (arc2-occurrence (elephant:get-instance-by-value 1135 1147 'd:OccurrenceC 'd:charvalue "arc-2")) … … 1139 1151 "<root><content type=\"anyContent\">content</content></root>")) 1140 1152 (fifth-node (d:get-item-by-id "http://test-tm#fifth-node" 1141 :xtm-id document-id))) 1142 (is (eql (d:instance-of instance-role) 1143 (d:get-item-by-psi *instance-psi*))) 1144 (is (eql (d:instance-of type-role) 1145 (d:get-item-by-psi *type-psi*))) 1146 (is (eql (d:instance-of type-assoc) 1147 (d:get-item-by-psi *type-instance-psi*))) 1148 (is (= (length (d:roles type-assoc)) 2)) 1149 (is (= (length (d:psis first-node)) 1)) 1150 (is (= (length (d:psis first-type)) 1)) 1151 (is (= (length (d::versions type-assoc)) 1)) 1152 (is (= (length (d:player-in-roles second-node)) 2)) 1153 :xtm-id document-id 1154 :revision 0))) 1155 (is (eql (d:instance-of instance-role :revision 0) 1156 (d:get-item-by-psi *instance-psi* :revision 0))) 1157 (is (eql (d:instance-of type-role :revision 0) 1158 (d:get-item-by-psi *type-psi* :revision 0))) 1159 (is (eql (d:instance-of type-assoc :revision 0) 1160 (d:get-item-by-psi *type-instance-psi* :revision 0))) 1161 (is (= (length (d:roles type-assoc :revision 0)) 2)) 1162 (is (= (length (d:psis first-node :revision 0)) 1)) 1163 (is (= (length (d:psis first-type :revision 0)) 1)) 1164 (is (= (length (d::versions type-assoc)) 2)) 1165 (is (= (length (d:player-in-roles second-node :revision 0)) 2)) 1153 1166 (is-true (find-if 1154 1167 #'(lambda(x) … … 1177 1190 (is-true arc2-occurrence) 1178 1191 (is (string= (d:datatype arc2-occurrence) "http://test-tm/dt")) 1179 (is-false (d:psis (d: topicarc2-occurrence)))1180 (is (= (length (d::versions (d: topicarc2-occurrence))) 1))1192 (is-false (d:psis (d:parent arc2-occurrence))) 1193 (is (= (length (d::versions (d:parent arc2-occurrence))) 1)) 1181 1194 (is (= (d::start-revision 1182 (first (d::versions (d: topicarc2-occurrence))))1195 (first (d::versions (d:parent arc2-occurrence)))) 1183 1196 revision-3)) 1184 1197 (is (= (d::end-revision 1185 (first (d::versions (d: topicarc2-occurrence)))) 0))1198 (first (d::versions (d:parent arc2-occurrence)))) 0)) 1186 1199 (is-true arc3-occurrence) 1187 (is (= (length (d:psis (d: topicarc3-occurrence)))))1188 (is (string= (d:uri (first (d:psis (d: topicarc3-occurrence))))1200 (is (= (length (d:psis (d:parent arc3-occurrence))))) 1201 (is (string= (d:uri (first (d:psis (d:parent arc3-occurrence)))) 1189 1202 "http://test-tm/fourth-node")) 1190 1203 (is (string= (d:datatype arc3-occurrence) … … 1593 1606 (string= *xml-string* (d:datatype x)) 1594 1607 (= (length (d:themes x)) 0) 1595 (= (length (d:psis (d: topicx))) 1)1596 (string= (d:uri (first (d:psis (d: topicx))))1608 (= (length (d:psis (d:parent x))) 1) 1609 (string= (d:uri (first (d:psis (d:parent x)))) 1597 1610 goethe))) 1598 1611 occs) … … 1605 1618 (string= *xml-string* (d:datatype x)) 1606 1619 (= (length (d:themes x)) 0) 1607 (= (length (d:psis (d: topicx))) 1)1608 (string= (d:uri (first (d:psis (d: topicx))))1620 (= (length (d:psis (d:parent x))) 1) 1621 (string= (d:uri (first (d:psis (d:parent x)))) 1609 1622 goethe))) 1610 1623 occs) … … 1617 1630 (string= *xml-string* (d:datatype x)) 1618 1631 (= (length (d:themes x)) 0) 1619 (= (length (d:psis (d: topicx))) 1)1620 (string= (d:uri (first (d:psis (d: topicx))))1632 (= (length (d:psis (d:parent x))) 1) 1633 (string= (d:uri (first (d:psis (d:parent x)))) 1621 1634 weimar))) 1622 1635 occs) … … 1629 1642 (string= *xml-string* (d:datatype x)) 1630 1643 (= (length (d:themes x)) 0) 1631 (= (length (d:psis (d: topicx))) 1)1632 (string= (d:uri (first (d:psis (d: topicx))))1644 (= (length (d:psis (d:parent x))) 1) 1645 (string= (d:uri (first (d:psis (d:parent x)))) 1633 1646 frankfurt))) 1634 1647 occs) … … 1642 1655 (= 1 (length (d:themes x))) 1643 1656 (eql (first (d:themes x)) de) 1644 (= (length (d:psis (d: topicx))) 1)1645 (string= (d:uri (first (d:psis (d: topicx))))1657 (= (length (d:psis (d:parent x))) 1) 1658 (string= (d:uri (first (d:psis (d:parent x)))) 1646 1659 germany))) 1647 1660 occs) … … 1656 1669 (= 1 (length (d:themes x))) 1657 1670 (eql (first (d:themes x)) de) 1658 (= (length (d:psis (d: topicx))) 1)1659 (string= (d:uri (first (d:psis (d: topicx))))1671 (= (length (d:psis (d:parent x))) 1) 1672 (string= (d:uri (first (d:psis (d:parent x)))) 1660 1673 zauberlehrling))) 1661 1674 occs) … … 1669 1682 (string= (d:charvalue x) "Prometheus") 1670 1683 (string= *xml-string* (d:datatype x)) 1671 (= (length (d:psis (d: topicx))) 1)1672 (string= (d:uri (first (d:psis (d: topicx))))1684 (= (length (d:psis (d:parent x))) 1) 1685 (string= (d:uri (first (d:psis (d:parent x)))) 1673 1686 prometheus))) 1674 1687 occs) … … 1683 1696 (= 1 (length (d:themes x))) 1684 1697 (eql (first (d:themes x)) de) 1685 (= (length (d:psis (d: topicx))) 1)1686 (string= (d:uri (first (d:psis (d: topicx))))1698 (= (length (d:psis (d:parent x))) 1) 1699 (string= (d:uri (first (d:psis (d:parent x)))) 1687 1700 erlkoenig))) 1688 1701 occs) … … 1697 1710 (= 1 (length (d:themes x))) 1698 1711 (eql (first (d:themes x)) de) 1699 (= (length (d:psis (d: topicx))) 1)1700 (string= (d:uri (first (d:psis (d: topicx))))1712 (= (length (d:psis (d:parent x))) 1) 1713 (string= (d:uri (first (d:psis (d:parent x)))) 1701 1714 zauberlehrling))) 1702 1715 occs) … … 1712 1725 (= 1 (length (d:themes x))) 1713 1726 (eql (first (d:themes x)) de) 1714 (= (length (d:psis (d: topicx))) 1)1715 (string= (d:uri (first (d:psis (d: topicx))))1727 (= (length (d:psis (d:parent x))) 1) 1728 (string= (d:uri (first (d:psis (d:parent x)))) 1716 1729 prometheus))) 1717 1730 occs) … … 1727 1740 (= 1 (length (d:themes x))) 1728 1741 (eql (first (d:themes x)) de) 1729 (= (length (d:psis (d: topicx))) 1)1730 (string= (d:uri (first (d:psis (d: topicx))))1742 (= (length (d:psis (d:parent x))) 1) 1743 (string= (d:uri (first (d:psis (d:parent x)))) 1731 1744 erlkoenig))) 1732 1745 occs) … … 1739 1752 (string= long (d:datatype x)) 1740 1753 (= 0 (length (d:themes x))) 1741 (= (length (d:psis (d: topicx))) 1)1742 (string= (d:uri (first (d:psis (d: topicx))))1754 (= (length (d:psis (d:parent x))) 1) 1755 (string= (d:uri (first (d:psis (d:parent x)))) 1743 1756 weimar))) 1744 1757 occs) … … 1751 1764 (string= long (d:datatype x)) 1752 1765 (= 0 (length (d:themes x))) 1753 (= (length (d:psis (d: topicx))) 1)1754 (string= (d:uri (first (d:psis (d: topicx))))1766 (= (length (d:psis (d:parent x))) 1) 1767 (string= (d:uri (first (d:psis (d:parent x)))) 1755 1768 frankfurt))) 1756 1769 occs) … … 1763 1776 (string= long (d:datatype x)) 1764 1777 (= 0 (length (d:themes x))) 1765 (= (length (d:psis (d: topicx))) 1)1766 (string= (d:uri (first (d:psis (d: topicx))))1778 (= (length (d:psis (d:parent x))) 1) 1779 (string= (d:uri (first (d:psis (d:parent x)))) 1767 1780 berlin))) 1768 1781 occs) … … 1775 1788 (string= long (d:datatype x)) 1776 1789 (= 0 (length (d:themes x))) 1777 (= (length (d:psis (d: topicx))) 1)1778 (string= (d:uri (first (d:psis (d: topicx))))1790 (= (length (d:psis (d:parent x))) 1) 1791 (string= (d:uri (first (d:psis (d:parent x)))) 1779 1792 germany))) 1780 1793 occs) … … 1787 1800 (string= date (d:datatype x)) 1788 1801 (= 0 (length (d:themes x))) 1789 (= (length (d:psis (d: topicx))) 0)))1802 (= (length (d:psis (d:parent x))) 0))) 1790 1803 occs) 1791 1804 2)) … … 1798 1811 (= 1 (length (d:themes x))) 1799 1812 (eql (first (d:themes x)) de) 1800 (= (length (d:psis (d: topicx))) 0)))1813 (= (length (d:psis (d:parent x))) 0))) 1801 1814 1802 1815 occs) … … 1809 1822 (string= date (d:datatype x)) 1810 1823 (= 0 (length (d:themes x))) 1811 (= (length (d:psis (d: topicx))) 0)))1824 (= (length (d:psis (d:parent x))) 0))) 1812 1825 1813 1826 occs) … … 1821 1834 (= 1 (length (d:themes x))) 1822 1835 (eql (first (d:themes x)) de) 1823 (= (length (d:psis (d: topicx))) 0)))1836 (= (length (d:psis (d:parent x))) 0))) 1824 1837 occs) 1825 1838 1)) … … 1831 1844 (string= date (d:datatype x)) 1832 1845 (= 0 (length (d:themes x))) 1833 (= (length (d:psis (d: topicx))) 0)))1846 (= (length (d:psis (d:parent x))) 0))) 1834 1847 occs) 1835 1848 2))))) … … 2854 2867 :tm-id tm-id 2855 2868 :document-id document-id) 2856 (elephant:open-store (xml-importer:get-store-spec dir))2869 ;(elephant:open-store (xml-importer:get-store-spec dir)) 2857 2870 (is (= (length (elephant:get-instances-by-class 'd:TopicC)) 15)) 2858 2871 (is (= (length (elephant:get-instances-by-class 'd:AssociationC)) 1)) … … 2938 2951 (is (string= (d:charvalue marge-fn) "Marjorie")) 2939 2952 (is (string= (d:charvalue marge-ln) "Simpson")) 2940 (is (= (length (d:variants marge-fn)) 1)) 2941 (is (= (length (d:themes (first (d:variants marge-fn)))) 1)) 2942 (is (eql (first (d:themes (first (d:variants marge-fn)))) display)) 2943 (is (string= (d:charvalue (first (d:variants marge-fn))) "Marge")) 2944 (is (string= (d:datatype (first (d:variants marge-fn))) *xml-string*)) 2953 (is (= (length (d:variants marge-fn :revision 0)) 1)) 2954 (is (= (length (d:themes (first (d:variants marge-fn :revision 0)) 2955 :revision 0)) 1)) 2956 (is (eql (first (d:themes (first (d:variants marge-fn :revision 0)) 2957 :revision 0)) display)) 2958 (is (string= (d:charvalue (first (d:variants marge-fn :revision 0))) "Marge")) 2959 (is (string= (d:datatype (first (d:variants marge-fn :revision 0))) *xml-string*)) 2945 2960 (is-true marge-occ) 2946 2961 (is (string= (d:charvalue marge-occ) "Housewife")) 2947 2962 (is (string= (d:datatype marge-occ) *xml-string*)) 2948 (is (= (length (d:themes marge-occ )) 0))2949 (is (= (length (d:psis marge )) 2))))))2963 (is (= (length (d:themes marge-occ :revision 0)) 0)) 2964 (is (= (length (d:psis marge :revision 0)) 2)))))) 2950 2965 2951 2966
Note: See TracChangeset
for help on using the changeset viewer.