terminusdb / terminusdb-client-python

@@ -158,7 +158,7 @@
Loading
158 158
                setattr(obj, key, value)
159 159
            if kwargs.get("_id"):
160 160
                obj._id = kwargs.get("_id")
161 -
            elif hasattr(obj.__class__, "_subdocument"):
161 +
            elif hasattr(obj, "_subdocument"):
162 162
                pass
163 163
            elif hasattr(obj, "_key") and hasattr(obj._key, "idgen"):
164 164
                obj._id = obj._key.idgen(obj)

@@ -3,7 +3,6 @@
Loading
3 3
4 4
# import pprint
5 5
import re
6 -
import warnings
7 6
8 7
from .woql_core import _copy_dict, _path_tokenize, _path_tokens_to_json
9 8
@@ -77,9 +76,9 @@
Loading
77 76
        self.subsumption = self.sub
78 77
        self.equals = self.eq
79 78
        self.substring = self.substr
80 -
        self.update = self.update_document  # self.update_object
81 -
        self.delete = self.delete_document  # self.delete_object
82 -
        self.read = self.read_document  # self.read_object
79 +
        self.update = self.update_object
80 +
        self.delete = self.delete_object
81 +
        self.read = self.read_object
83 82
        self.optional = self.opt
84 83
        self.idgenerator = self.idgen
85 84
        self.concatenate = self.concat
@@ -1164,99 +1163,35 @@
Loading
1164 1163
        return self
1165 1164
1166 1165
    def update_object(self, docjson):
1167 -
        warnings.warn(
1168 -
            "update_object() is deprecated; use update_document()",
1169 -
            warnings.DeprecationWarning,
1170 -
        )
1171 -
        return self.update_document(docjson)
1172 -
        # if docjson and docjson == "args":
1173 -
        #     return ["document"]
1174 -
        # if self._cursor.get("@type"):
1175 -
        #     self._wrap_cursor_with_and()
1176 -
        # self._cursor["@type"] = "UpdateObject"
1177 -
        # if isinstance(docjson, str):
1178 -
        #     doc = self._expand_data_value(docjson)
1179 -
        # else:
1180 -
        #     doc = docjson
1181 -
        # self._cursor["document"] = doc
1182 -
        # return self._updated()
1183 -
1184 -
    def update_document(self, docjson, json_or_iri=None):
1185 1166
        if docjson and docjson == "args":
1186 1167
            return ["document"]
1187 1168
        if self._cursor.get("@type"):
1188 1169
            self._wrap_cursor_with_and()
1189 -
        self._cursor["@type"] = "UpdateDocument"
1170 +
        self._cursor["@type"] = "UpdateObject"
1190 1171
        if isinstance(docjson, str):
1191 -
            doc = self._expand_value_variable(docjson)
1172 +
            doc = self._expand_data_value(docjson)
1192 1173
        else:
1193 1174
            doc = docjson
1194 1175
        self._cursor["document"] = doc
1195 -
        if json_or_iri is not None:
1196 -
            self._cursor["identifier"] = self._clean_node_value(json_or_iri)
1197 -
        return self._updated()
1198 -
1199 -
    def insert_document(self, docjson, json_or_iri=None):
1200 -
        if docjson and docjson == "args":
1201 -
            return ["document"]
1202 -
        if self._cursor.get("@type"):
1203 -
            self._wrap_cursor_with_and()
1204 -
        self._cursor["@type"] = "InsertDocument"
1205 -
        if isinstance(docjson, str):
1206 -
            doc = self._expand_value_variable(docjson)
1207 -
        else:
1208 -
            doc = docjson
1209 -
        self._cursor["document"] = doc
1210 -
        if json_or_iri is not None:
1211 -
            self._cursor["identifier"] = self._clean_node_value(json_or_iri)
1212 1176
        return self._updated()
1213 1177
1214 1178
    def delete_object(self, json_or_iri):
1215 -
        warnings.warn(
1216 -
            "delete_object() is deprecated; use delete_document()",
1217 -
            warnings.DeprecationWarning,
1218 -
        )
1219 -
        return self.delete_document(json_or_iri)
1220 -
        # if json_or_iri and json_or_iri == "args":
1221 -
        #     return ["document"]
1222 -
        # if self._cursor.get("@type"):
1223 -
        #     self._wrap_cursor_with_and()
1224 -
        # self._cursor["@type"] = "DeleteObject"
1225 -
        # self._cursor["document_uri"] = self._clean_node_value(json_or_iri)
1226 -
        # return self._updated()
1227 -
1228 -
    def delete_document(self, json_or_iri):
1229 1179
        if json_or_iri and json_or_iri == "args":
1230 1180
            return ["document"]
1231 1181
        if self._cursor.get("@type"):
1232 1182
            self._wrap_cursor_with_and()
1233 -
        self._cursor["@type"] = "DeleteDocument"
1234 -
        self._cursor["identifier"] = self._clean_node_value(json_or_iri)
1183 +
        self._cursor["@type"] = "DeleteObject"
1184 +
        self._cursor["document_uri"] = self._clean_node_value(json_or_iri)
1235 1185
        return self._updated()
1236 1186
1237 1187
    def read_object(self, iri, output_var):
1238 -
        warnings.warn(
1239 -
            "read_object() is deprecated; use read_document()",
1240 -
            warnings.DeprecationWarning,
1241 -
        )
1242 -
        return self.read_document(iri, output_var)
1243 -
        # if iri and iri == "args":
1244 -
        #     return ["document"]
1245 -
        # if self._cursor.get("@type"):
1246 -
        #     self._wrap_cursor_with_and()
1247 -
        # self._cursor["@type"] = "ReadObject"
1248 -
        # self._cursor["document_uri"] = iri
1249 -
        # self._cursor["document"] = self._expand_data_variable(output_var)
1250 -
        # return self
1251 -
1252 -
    def read_document(self, iri, output_var):
1253 1188
        if iri and iri == "args":
1254 1189
            return ["document"]
1255 1190
        if self._cursor.get("@type"):
1256 1191
            self._wrap_cursor_with_and()
1257 -
        self._cursor["@type"] = "ReadDocument"
1258 -
        self._cursor["identifier"] = self._clean_node_value(iri)
1259 -
        self._cursor["document"] = self._expand_value_variable(output_var)
1192 +
        self._cursor["@type"] = "ReadObject"
1193 +
        self._cursor["document_uri"] = iri
1194 +
        self._cursor["document"] = self._expand_data_variable(output_var)
1260 1195
        return self
1261 1196
1262 1197
    def get(self, as_vars, query_resource=None):
Files Coverage
terminusdb_client 64.33%
Project Totals (11 files) 64.33%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading