diff --git a/CHANGELOG b/CHANGELOG index 5663ab01..43742eef 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,2 +1,3 @@ [#214] Added type alias for atom handle [#216] Removed cursor from api of get_matched*() and get_incoming_links() +[das/#106] Change patterns and templates indexes to store handles only rather than handles+targets diff --git a/hyperon_das_atomdb/__init__.py b/hyperon_das_atomdb/__init__.py index a22d82fb..24aea8f1 100644 --- a/hyperon_das_atomdb/__init__.py +++ b/hyperon_das_atomdb/__init__.py @@ -7,13 +7,12 @@ if sys.version_info < (3, 10): raise RuntimeError("hyperon-das-atomdb requires Python 3.10 or higher") -from .database import UNORDERED_LINK_TYPES, WILDCARD, AtomDB +from .database import WILDCARD, AtomDB from .exceptions import AtomDoesNotExist __all__ = [ "AtomDB", "WILDCARD", - "UNORDERED_LINK_TYPES", "AtomDoesNotExist", ] diff --git a/hyperon_das_atomdb/adapters/ram_only.py b/hyperon_das_atomdb/adapters/ram_only.py index 1dde90f2..80f67fc4 100644 --- a/hyperon_das_atomdb/adapters/ram_only.py +++ b/hyperon_das_atomdb/adapters/ram_only.py @@ -15,22 +15,19 @@ from typing import Any, Iterable from hyperon_das_atomdb.database import ( - UNORDERED_LINK_TYPES, WILDCARD, AtomDB, AtomT, FieldIndexType, FieldNames, + HandleListT, IncomingLinksT, LinkParamsT, LinkT, - MatchedLinksResultT, - MatchedTargetsListT, - MatchedTypesResultT, NodeParamsT, NodeT, ) -from hyperon_das_atomdb.exceptions import AtomDoesNotExist, InvalidOperationException +from hyperon_das_atomdb.exceptions import AtomDoesNotExist from hyperon_das_atomdb.logger import logger from hyperon_das_atomdb.utils.expression_hasher import ExpressionHasher from hyperon_das_atomdb.utils.patterns import build_pattern_keys @@ -43,10 +40,10 @@ class Database: atom_type: dict[str, Any] = dc_field(default_factory=dict) node: dict[str, AtomT] = dc_field(default_factory=dict) link: dict[str, AtomT] = dc_field(default_factory=dict) - outgoing_set: dict[str, Any] = dc_field(default_factory=dict) + outgoing_set: dict[str, set[str]] = dc_field(default_factory=dict) incoming_set: dict[str, set[str]] = dc_field(default_factory=dict) - patterns: dict[str, set[tuple[str, tuple[str, ...]]]] = dc_field(default_factory=dict) - templates: dict[str, set[tuple[str, tuple[str, ...]]]] = dc_field(default_factory=dict) + patterns: dict[str, set[str]] = dc_field(default_factory=dict) + templates: dict[str, set[str]] = dc_field(default_factory=dict) class InMemoryDB(AtomDB): @@ -225,7 +222,6 @@ def _add_templates( composite_type_hash: str, named_type_hash: str, key: str, - targets_hash: list[str], ) -> None: """ Add templates to the database. @@ -234,38 +230,36 @@ def _add_templates( composite_type_hash (str): The hash of the composite type. named_type_hash (str): The hash of the named type. key (str): The key for the template. - targets_hash (list[str]): A list of target hashes to be added to the template. """ template_composite_type_hash = self.db.templates.get(composite_type_hash) template_named_type_hash = self.db.templates.get(named_type_hash) if template_composite_type_hash is not None: - template_composite_type_hash.add((key, tuple(targets_hash))) + template_composite_type_hash.add(key) else: - self.db.templates[composite_type_hash] = {(key, tuple(targets_hash))} + self.db.templates[composite_type_hash] = {key} if template_named_type_hash is not None: - template_named_type_hash.add((key, tuple(targets_hash))) + template_named_type_hash.add(key) else: - self.db.templates[named_type_hash] = {(key, tuple(targets_hash))} + self.db.templates[named_type_hash] = {key} - def _delete_templates(self, link_document: dict, targets_hash: list[str]) -> None: + def _delete_templates(self, link_document: dict) -> None: """ Delete templates from the database. Args: link_document (dict): The document of the link whose templates are to be deleted. - targets_hash (list[str]): A list of target hashes associated with the link. """ template_composite_type = self.db.templates.get( link_document[FieldNames.COMPOSITE_TYPE_HASH], set() ) if len(template_composite_type) > 0: - template_composite_type.remove((link_document[FieldNames.ID_HASH], tuple(targets_hash))) + template_composite_type.remove(link_document[FieldNames.ID_HASH]) template_named_type = self.db.templates.get(link_document[FieldNames.TYPE_NAME_HASH], set()) if len(template_named_type) > 0: - template_named_type.remove((link_document[FieldNames.ID_HASH], tuple(targets_hash))) + template_named_type.remove(link_document[FieldNames.ID_HASH]) def _add_patterns(self, named_type_hash: str, key: str, targets_hash: list[str]) -> None: """ @@ -282,7 +276,7 @@ def _add_patterns(self, named_type_hash: str, key: str, targets_hash: list[str]) self.db.patterns.setdefault( pattern_key, set(), - ).add((key, tuple(targets_hash))) + ).add(key) def _delete_patterns(self, link_document: dict, targets_hash: list[str]) -> None: """ @@ -295,7 +289,7 @@ def _delete_patterns(self, link_document: dict, targets_hash: list[str]) -> None pattern_keys = build_pattern_keys([link_document[FieldNames.TYPE_NAME_HASH], *targets_hash]) for pattern_key in pattern_keys: if pattern := self.db.patterns.get(pattern_key): - pattern.remove((link_document[FieldNames.ID_HASH], tuple(targets_hash))) + pattern.remove(link_document[FieldNames.ID_HASH]) def _delete_link_and_update_index(self, link_handle: str) -> None: """ @@ -307,22 +301,21 @@ def _delete_link_and_update_index(self, link_handle: str) -> None: if link_document := self._get_and_delete_link(link_handle): self._update_index(atom=link_document, delete_atom=True) - def _filter_non_toplevel(self, matches: MatchedTargetsListT) -> MatchedTargetsListT: + def _filter_non_toplevel(self, matches: HandleListT) -> HandleListT: """ Filter out non-toplevel matches from the provided list. Args: - matches (MatchedTargetsListT): A list of matches, where each match is a tuple - containing a link handle and a tuple of target handles. + matches (HandleListT): A list of matches Returns: - MatchedTargetsListT: A list of matches that are toplevel only. + HandleListT: Filtered matches """ if not self.db.link: return matches return [ - (link_handle, matched_targets) - for link_handle, matched_targets in matches + link_handle + for link_handle in matches if (link := self.db.link.get(link_handle)) and link.get(FieldNames.IS_TOPLEVEL) ] @@ -378,9 +371,7 @@ def _delete_atom_index(self, atom: AtomT) -> None: self._delete_incoming_set(link_handle, outgoing_atoms) targets_hash = self._build_targets_list(atom) - - self._delete_templates(atom, targets_hash) - + self._delete_templates(atom) self._delete_patterns(atom, targets_hash) def _add_atom_index(self, atom: AtomT) -> None: @@ -398,20 +389,14 @@ def _add_atom_index(self, atom: AtomT) -> None: if FieldNames.NODE_NAME not in atom: handle = atom[FieldNames.ID_HASH] targets_hash = self._build_targets_list(atom) - # self._add_atom_type(atom_type_name=atom_type_name) # see 4 ln above - duplicate? self._add_outgoing_set(handle, targets_hash) self._add_incoming_set(handle, targets_hash) self._add_templates( atom[FieldNames.COMPOSITE_TYPE_HASH], atom[FieldNames.TYPE_NAME_HASH], handle, - targets_hash, - ) - self._add_patterns( - atom[FieldNames.TYPE_NAME_HASH], - handle, - targets_hash, ) + self._add_patterns(atom[FieldNames.TYPE_NAME_HASH], handle, targets_hash) def _update_index(self, atom: AtomT, **kwargs) -> None: """ @@ -536,22 +521,7 @@ def get_link_targets(self, link_handle: str) -> list[str]: details=f"link_handle: {link_handle}", ) - def is_ordered(self, link_handle: str) -> bool: - link = self._get_link(link_handle) - if link is not None: - return True - logger().error( - f"Failed to retrieve document for link handle: {link_handle}. " - f"The link may not exist." - ) - raise AtomDoesNotExist( - message="Nonexistent atom", - details=f"link_handle: {link_handle}", - ) - - def get_matched_links( - self, link_type: str, target_handles: list[str], **kwargs - ) -> MatchedLinksResultT: + def get_matched_links(self, link_type: str, target_handles: list[str], **kwargs) -> HandleListT: if link_type != WILDCARD and WILDCARD not in target_handles: try: answer = [self.get_link_handle(link_type, target_handles)] @@ -562,16 +532,6 @@ def get_matched_links( link_type_hash = ( WILDCARD if link_type == WILDCARD else ExpressionHasher.named_type_hash(link_type) ) - # NOTE unreachable - if link_type in UNORDERED_LINK_TYPES: # pragma: no cover - logger().error( - "Failed to get matched links: Queries with unordered links are not implemented. " - f"link_type: {link_type}" - ) - raise InvalidOperationException( - message="Queries with unordered links are not implemented", - details=f"link_type: {link_type}", - ) pattern_hash = ExpressionHasher.composite_hash([link_type_hash, *target_handles]) @@ -588,7 +548,7 @@ def get_incoming_links(self, atom_handle: str, **kwargs) -> IncomingLinksT: return list(links) return [self.get_atom(handle, **kwargs) for handle in links] - def get_matched_type_template(self, template: list[Any], **kwargs) -> MatchedTypesResultT: + def get_matched_type_template(self, template: list[Any], **kwargs) -> HandleListT: hash_base = self._build_named_type_hash_template(template) template_hash = ExpressionHasher.composite_hash(hash_base) templates_matched = list(self.db.templates.get(template_hash, set())) @@ -596,7 +556,7 @@ def get_matched_type_template(self, template: list[Any], **kwargs) -> MatchedTyp return self._filter_non_toplevel(templates_matched) return templates_matched - def get_matched_type(self, link_type: str, **kwargs) -> MatchedTypesResultT: + def get_matched_type(self, link_type: str, **kwargs) -> HandleListT: link_type_hash = ExpressionHasher.named_type_hash(link_type) templates_matched = list(self.db.templates.get(link_type_hash, set())) if kwargs.get("toplevel_only", False): diff --git a/hyperon_das_atomdb/adapters/redis_mongo_db.py b/hyperon_das_atomdb/adapters/redis_mongo_db.py index eea80122..dd474ffc 100644 --- a/hyperon_das_atomdb/adapters/redis_mongo_db.py +++ b/hyperon_das_atomdb/adapters/redis_mongo_db.py @@ -23,18 +23,15 @@ from redis.cluster import RedisCluster from hyperon_das_atomdb.database import ( - UNORDERED_LINK_TYPES, WILDCARD, AtomDB, AtomT, FieldIndexType, FieldNames, + HandleListT, IncomingLinksT, LinkParamsT, LinkT, - MatchedLinksResultT, - MatchedTargetsListT, - MatchedTypesResultT, NodeParamsT, NodeT, ) @@ -490,7 +487,7 @@ def _get_document_keys(document: dict[str, Any]) -> list[str]: index += 1 return answer - def _filter_non_toplevel(self, matches: MatchedTargetsListT) -> MatchedTargetsListT: + def _filter_non_toplevel(self, matches: HandleListT) -> HandleListT: """ Filter out non-toplevel links from the given list of matches. @@ -499,14 +496,14 @@ def _filter_non_toplevel(self, matches: MatchedTargetsListT) -> MatchedTargetsLi are included in the returned list. Args: - matches (MatchedTargetsListT): A list of link handles to be filtered. + matches (HandleListT): A list of link handles to be filtered. Returns: - MatchedTargetsListT: A list of handles corresponding to toplevel links. + HandleListT: A list of handles corresponding to toplevel links. """ return [ - (link_handle, matched_targets) - for link_handle, matched_targets in matches + link_handle + for link_handle in matches if (link := self._retrieve_document(link_handle)) and link.get(FieldNames.IS_TOPLEVEL) ] @@ -663,19 +660,7 @@ def get_link_targets(self, link_handle: str) -> list[str]: raise ValueError(f"Invalid handle: {link_handle}") return answer - def is_ordered(self, link_handle: str) -> bool: - document = self._retrieve_document(link_handle) - if document is None: - logger().error( - "Failed to retrieve document for link handle: {link_handle}. " - "The handle may be invalid or the corresponding link does not exist." - ) - raise ValueError(f"Invalid handle: {link_handle}") - return True - - def get_matched_links( - self, link_type: str, target_handles: list[str], **kwargs - ) -> MatchedLinksResultT: + def get_matched_links(self, link_type: str, target_handles: list[str], **kwargs) -> HandleListT: if link_type != WILDCARD and WILDCARD not in target_handles: try: link_handle = self.get_link_handle(link_type, target_handles) @@ -687,10 +672,6 @@ def get_matched_links( WILDCARD if link_type == WILDCARD else ExpressionHasher.named_type_hash(link_type) ) - # NOTE unreachable - if link_type in UNORDERED_LINK_TYPES: - target_handles = sorted(target_handles) - pattern_hash = ExpressionHasher.composite_hash([link_type_hash, *target_handles]) patterns_matched = self._retrieve_hash_targets_value( KeyPrefix.PATTERNS, pattern_hash, **kwargs @@ -708,7 +689,7 @@ def get_incoming_links(self, atom_handle: str, **kwargs) -> IncomingLinksT: else: return [self.get_atom(handle, **kwargs) for handle in links] - def get_matched_type_template(self, template: list[Any], **kwargs) -> MatchedTypesResultT: + def get_matched_type_template(self, template: list[Any], **kwargs) -> HandleListT: try: hash_base: list[str] = self._build_named_type_hash_template(template) # type: ignore template_hash = ExpressionHasher.composite_hash(hash_base) @@ -723,7 +704,7 @@ def get_matched_type_template(self, template: list[Any], **kwargs) -> MatchedTyp logger().error(f"Failed to get matched type template - Details: {str(exception)}") raise ValueError(str(exception)) - def get_matched_type(self, link_type: str, **kwargs) -> MatchedTypesResultT: + def get_matched_type(self, link_type: str, **kwargs) -> HandleListT: named_type_hash = ExpressionHasher.named_type_hash(link_type) templates_matched = self._retrieve_hash_targets_value( KeyPrefix.TEMPLATES, named_type_hash, **kwargs @@ -877,7 +858,7 @@ def _apply_index_template( key.append(WILDCARD if cursor in target_selected_pos else targets[cursor]) return _build_redis_key(KeyPrefix.PATTERNS, ExpressionHasher.composite_hash(key)) - def _retrieve_incoming_set(self, handle: str, **kwargs) -> MatchedTargetsListT: + def _retrieve_incoming_set(self, handle: str, **kwargs) -> HandleListT: """ Retrieve the incoming set for the given handle from Redis. @@ -889,7 +870,7 @@ def _retrieve_incoming_set(self, handle: str, **kwargs) -> MatchedTargetsListT: **kwargs: Additional keyword arguments. Returns: - tuple[int | None, list[str]]: List of members for the given key + HandleListT: List of members for the given key """ key = _build_redis_key(KeyPrefix.INCOMING_SET, handle) return list(self._get_redis_members(key, **kwargs)) @@ -981,17 +962,13 @@ def _retrieve_name(self, handle: str) -> str | None: else: return None - def _retrieve_hash_targets_value( - self, key_prefix: str, handle: str, **kwargs - ) -> MatchedTargetsListT: + def _retrieve_hash_targets_value(self, key_prefix: str, handle: str, **kwargs) -> HandleListT: """ Retrieve the hash targets value for the given handle from Redis. This method constructs a Redis key using the provided key prefix and handle, and retrieves - the members associated with that key. It supports additional keyword arguments for - cursor-based pagination. If the members are not found, it returns an empty list. Otherwise, - it calculates the number of targets based on the length of the first member and returns - the cursor position and a list of members. + the members associated with that key. + If the members are not found, it returns an empty list. Args: key_prefix (str): The prefix to be used in the Redis key. @@ -1000,28 +977,10 @@ def _retrieve_hash_targets_value( **kwargs: Additional keyword arguments Returns: - MatchedTargetsListT: List of members in the hash targets value. + HandleListT: List of members in the hash targets value. """ key = _build_redis_key(key_prefix, handle) - members = self._get_redis_members(key, **kwargs) - if len(members) == 0: - return [] - else: - n = len(next(iter(members))) // self.hash_length - return [ - ( - member[0 : self.hash_length], # noqa: E203 - tuple( - member[ - (offset * self.hash_length) : ( # noqa: E203 - (offset + 1) * self.hash_length - ) - ] - for offset in range(1, n) - ), - ) - for member in members - ] + return list(self._get_redis_members(key, **kwargs)) def _delete_smember_template(self, handle: str, smember: str) -> None: """ @@ -1081,7 +1040,7 @@ def _retrieve_custom_index(self, index_id: str) -> dict[str, Any] | None: logger().error(f"Unexpected error retrieving custom index with ID {index_id}: {e}") raise e - def _get_redis_members(self, key: str, **kwargs) -> MatchedTargetsListT: + def _get_redis_members(self, key: str, **kwargs) -> HandleListT: """ Retrieve members from a Redis set. @@ -1089,7 +1048,7 @@ def _get_redis_members(self, key: str, **kwargs) -> MatchedTargetsListT: key (str): The key of the set in Redis. Returns: - MatchedTargetsListT: List of members retrieved from Redis. + HandleListT: List of members retrieved from Redis. """ return list(self.redis.smembers(key)) # type: ignore @@ -1157,7 +1116,6 @@ def _update_link_index(self, document: dict[str, Any], **kwargs) -> None: arity: int = len(targets) named_type: str = document[FieldNames.TYPE_NAME] named_type_hash: str = document[FieldNames.TYPE_NAME_HASH] - value: str = f"{handle}{targets_str}" index_templates: list[dict[str, Any]] if self.pattern_index_templates: @@ -1182,11 +1140,11 @@ def _update_link_index(self, document: dict[str, Any], **kwargs) -> None: FieldNames.COMPOSITE_TYPE_HASH, FieldNames.TYPE_NAME_HASH, ]: - self._delete_smember_template(document[type_hash], value) + self._delete_smember_template(document[type_hash], handle) for template in index_templates: key = self._apply_index_template(template, named_type_hash, targets, arity) - self.redis.srem(key, value) + self.redis.srem(key, handle) else: incoming_buffer: dict[str, list[str]] = {} key = _build_redis_key(KeyPrefix.OUTGOING_SET, handle) @@ -1204,11 +1162,11 @@ def _update_link_index(self, document: dict[str, Any], **kwargs) -> None: FieldNames.TYPE_NAME_HASH, ]: key = _build_redis_key(KeyPrefix.TEMPLATES, document[type_hash]) - self.redis.sadd(key, value) + self.redis.sadd(key, handle) for template in index_templates: key = self._apply_index_template(template, named_type_hash, targets, arity) - self.redis.sadd(key, value) + self.redis.sadd(key, handle) for handle in incoming_buffer: key = _build_redis_key(KeyPrefix.INCOMING_SET, handle) diff --git a/hyperon_das_atomdb/database.py b/hyperon_das_atomdb/database.py index 744cf861..783cf5fc 100644 --- a/hyperon_das_atomdb/database.py +++ b/hyperon_das_atomdb/database.py @@ -14,7 +14,6 @@ Constants: WILDCARD: A constant representing a wildcard character. - UNORDERED_LINK_TYPES: A list of unordered link types. Type Aliases: IncomingLinksT: A type alias for incoming links. @@ -31,7 +30,6 @@ from hyperon_das_atomdb.utils.expression_hasher import ExpressionHasher WILDCARD = "*" -UNORDERED_LINK_TYPES: list[Any] = [] # pylint: disable=invalid-name @@ -51,12 +49,6 @@ IncomingLinksT: TypeAlias = HandleListT | list[AtomT] -MatchedTargetsListT: TypeAlias = list[tuple[HandleT, tuple[HandleT, ...]]] - -MatchedLinksResultT: TypeAlias = HandleListT | MatchedTargetsListT - -MatchedTypesResultT: TypeAlias = MatchedTargetsListT - # pylint: enable=invalid-name @@ -527,18 +519,6 @@ def get_link_targets(self, link_handle: str) -> list[str]: list[str]: A list of target identifiers of the link. """ - @abstractmethod - def is_ordered(self, link_handle: str) -> bool: - """ - Check if a link specified by its handle is ordered. - - Args: - link_handle (str): The link handle. - - Returns: - bool: True if the link is ordered, False otherwise. - """ - @abstractmethod def get_incoming_links(self, atom_handle: str, **kwargs) -> IncomingLinksT: """ @@ -553,9 +533,7 @@ def get_incoming_links(self, atom_handle: str, **kwargs) -> IncomingLinksT: """ @abstractmethod - def get_matched_links( - self, link_type: str, target_handles: list[str], **kwargs - ) -> MatchedLinksResultT: + def get_matched_links(self, link_type: str, target_handles: list[str], **kwargs) -> HandleListT: """ Retrieve links that match a specified link type and target handles. @@ -566,7 +544,7 @@ def get_matched_links( purposes. Returns: - MatchedLinksResultT: List of matching link handles. + HandleListT: List of matching link handles. """ @abstractmethod diff --git a/tests/integration/adapters/test_redis_mongo.py b/tests/integration/adapters/test_redis_mongo.py index 30c7bac6..306a574b 100644 --- a/tests/integration/adapters/test_redis_mongo.py +++ b/tests/integration/adapters/test_redis_mongo.py @@ -57,25 +57,31 @@ def _check_basic_patterns(self, db, toplevel_only=False): [WILDCARD, db.node_handle("Concept", "mammal")], toplevel_only=toplevel_only, ) - assert sorted([answer[1][0] for answer in answers]) == sorted([human, monkey, chimp, rhino]) + assert sorted([db.get_atom(answer)["targets"][0] for answer in answers]) == sorted( + [human, monkey, chimp, rhino] + ) answers = db.get_matched_links( "Inheritance", [db.node_handle("Concept", "mammal"), WILDCARD], toplevel_only=toplevel_only, ) - assert sorted([answer[1][1] for answer in answers]) == sorted([animal]) + assert sorted([db.get_atom(answer)["targets"][1] for answer in answers]) == sorted([animal]) answers = db.get_matched_links( "Similarity", [WILDCARD, db.node_handle("Concept", "human")], toplevel_only=toplevel_only, ) - assert sorted([answer[1][0] for answer in answers]) == sorted([monkey, chimp, ent]) + assert sorted([db.get_atom(answer)["targets"][0] for answer in answers]) == sorted( + [monkey, chimp, ent] + ) answers = db.get_matched_links( "Similarity", [db.node_handle("Concept", "human"), WILDCARD], toplevel_only=toplevel_only, ) - assert sorted([answer[1][1] for answer in answers]) == sorted([monkey, chimp, ent]) + assert sorted([db.get_atom(answer)["targets"][1] for answer in answers]) == sorted( + [monkey, chimp, ent] + ) def test_redis_retrieve(self, _cleanup, _db: RedisMongoDB): db = _db @@ -105,208 +111,34 @@ def test_redis_retrieve(self, _cleanup, _db: RedisMongoDB): templates = db._retrieve_hash_targets_value( KeyPrefix.TEMPLATES, "41c082428b28d7e9ea96160f7fd614ad" ) - assert len(templates) == 12 - assert ( - tuple( - [ - "116df61c01859c710d178ba14a483509", - tuple( - [ - "c1db9b517073e51eb7ef6fed608ec204", - "b99ae727c787f1b13b452fd4c9ce1b9a", - ] - ), - ] - ) - in templates - ) - assert ( - tuple( - [ - "1c3bf151ea200b2d9e088a1178d060cb", - tuple( - [ - "bdfe4e7a431f73386f37c6448afe5840", - "0a32b476852eeb954979b87f5f6cb7af", - ] - ), - ] - ) - in templates - ) - assert ( - tuple( - [ - "4120e428ab0fa162a04328e5217912ff", - tuple( - [ - "bb34ce95f161a6b37ff54b3d4c817857", - "0a32b476852eeb954979b87f5f6cb7af", - ] - ), - ] - ) - in templates - ) - assert ( - tuple( - [ - "75756335011dcedb71a0d9a7bd2da9e8", - tuple( - [ - "5b34c54bee150c04f9fa584b899dc030", - "bdfe4e7a431f73386f37c6448afe5840", - ] - ), - ] - ) - in templates - ) - assert ( - tuple( - [ - "906fa505ae3bc6336d80a5f9aaa47b3b", - tuple( - [ - "d03e59654221c1e8fcda404fd5c8d6cb", - "08126b066d32ee37743e255a2558cccd", - ] - ), - ] - ) - in templates - ) - assert ( - tuple( - [ - "959924e3aab197af80a84c1ab261fd65", - tuple( - [ - "08126b066d32ee37743e255a2558cccd", - "b99ae727c787f1b13b452fd4c9ce1b9a", - ] - ), - ] - ) - in templates - ) - assert ( - tuple( - [ - "b0f428929706d1d991e4d712ad08f9ab", - tuple( - [ - "b99ae727c787f1b13b452fd4c9ce1b9a", - "0a32b476852eeb954979b87f5f6cb7af", - ] - ), - ] - ) - in templates - ) - assert ( - tuple( - [ - "c93e1e758c53912638438e2a7d7f7b7f", - tuple( - [ - "af12f10f9ae2002a1607ba0b47ba8407", - "bdfe4e7a431f73386f37c6448afe5840", - ] - ), - ] - ) - in templates - ) - assert ( - tuple( - [ - "e4685d56969398253b6f77efd21dc347", - tuple( - [ - "b94941d8cd1c0ee4ad3dd3dcab52b964", - "80aff30094874e75028033a38ce677bb", - ] - ), - ] - ) - in templates - ) - assert ( - tuple( - [ - "ee1c03e6d1f104ccd811cfbba018451a", - tuple( - [ - "4e8e26e3276af8a5c2ac2cc2dc95c6d2", - "80aff30094874e75028033a38ce677bb", - ] - ), - ] - ) - in templates - ) - assert ( - tuple( - [ - "f31dfe97db782e8cec26de18dddf8965", - tuple( - [ - "1cdffc6b0b89ff41d68bec237481d1e1", - "bdfe4e7a431f73386f37c6448afe5840", - ] - ), - ] - ) - in templates - ) - assert ( - tuple( - [ - "fbf03d17d6a40feff828a3f2c6e86f05", - tuple( - [ - "99d18c702e813b07260baf577c60c455", - "bdfe4e7a431f73386f37c6448afe5840", - ] - ), - ] - ) - in templates + assert sorted(templates) == sorted( + [ + "116df61c01859c710d178ba14a483509", + "1c3bf151ea200b2d9e088a1178d060cb", + "4120e428ab0fa162a04328e5217912ff", + "75756335011dcedb71a0d9a7bd2da9e8", + "906fa505ae3bc6336d80a5f9aaa47b3b", + "959924e3aab197af80a84c1ab261fd65", + "b0f428929706d1d991e4d712ad08f9ab", + "c93e1e758c53912638438e2a7d7f7b7f", + "e4685d56969398253b6f77efd21dc347", + "ee1c03e6d1f104ccd811cfbba018451a", + "f31dfe97db782e8cec26de18dddf8965", + "fbf03d17d6a40feff828a3f2c6e86f05", + ] ) patterns = db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "112002ff70ea491aad735f978e9d95f5" ) - assert len(patterns) == 4 - assert ( - "75756335011dcedb71a0d9a7bd2da9e8", - ( - "5b34c54bee150c04f9fa584b899dc030", - "bdfe4e7a431f73386f37c6448afe5840", - ), - ) in patterns - assert ( - "fbf03d17d6a40feff828a3f2c6e86f05", - ( - "99d18c702e813b07260baf577c60c455", - "bdfe4e7a431f73386f37c6448afe5840", - ), - ) in patterns - assert ( - "f31dfe97db782e8cec26de18dddf8965", - ( - "1cdffc6b0b89ff41d68bec237481d1e1", - "bdfe4e7a431f73386f37c6448afe5840", - ), - ) in patterns - assert ( - "c93e1e758c53912638438e2a7d7f7b7f", - ( - "af12f10f9ae2002a1607ba0b47ba8407", - "bdfe4e7a431f73386f37c6448afe5840", - ), - ) in patterns + assert sorted(patterns) == sorted( + [ + "75756335011dcedb71a0d9a7bd2da9e8", + "fbf03d17d6a40feff828a3f2c6e86f05", + "f31dfe97db782e8cec26de18dddf8965", + "c93e1e758c53912638438e2a7d7f7b7f", + ] + ) def test_patterns(self, _cleanup, _db: RedisMongoDB): db = _db @@ -325,7 +157,9 @@ def test_commit(self, _cleanup, _db: RedisMongoDB): answers = db.get_matched_links( "Inheritance", [WILDCARD, db.node_handle("Concept", "mammal")] ) - assert sorted([answer[1][0] for answer in answers]) == sorted([human, monkey, chimp, rhino]) + assert sorted([db.get_atom(answer)["targets"][0] for answer in answers]) == sorted( + [human, monkey, chimp, rhino] + ) assert db.get_atom(human)["name"] == node_docs[human]["name"] link_pre = db.get_atom(inheritance[human][mammal]) assert "strength" not in link_pre @@ -362,7 +196,7 @@ def test_commit(self, _cleanup, _db: RedisMongoDB): answers = db.get_matched_links( "Inheritance", [WILDCARD, db.node_handle("Concept", "mammal")] ) - assert sorted([answer[1][0] for answer in answers]) == sorted( + assert sorted([db.get_atom(answer)["targets"][0] for answer in answers]) == sorted( [human, monkey, chimp, rhino, dog] ) @@ -447,22 +281,12 @@ def _check_asserts(): db._retrieve_hash_targets_value( KeyPrefix.TEMPLATES, "e40489cd1e7102e35469c937e05c8bba" ) - ) == sorted( - [ - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)), - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), - ] - ) + ) == sorted([inheritance_dog_mammal_handle, inheritance_cat_mammal_handle]) assert sorted( db._retrieve_hash_targets_value( KeyPrefix.TEMPLATES, "41c082428b28d7e9ea96160f7fd614ad" ) - ) == sorted( - [ - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)), - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), - ] - ) + ) == sorted([inheritance_dog_mammal_handle, inheritance_cat_mammal_handle]) links = [ db.get_atom(inheritance_cat_mammal_handle), @@ -484,66 +308,46 @@ def _check_asserts(): db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "112002ff70ea491aad735f978e9d95f5" ) - ) == sorted( - [ - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)), - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), - ] - ) + ) == sorted([inheritance_dog_mammal_handle, inheritance_cat_mammal_handle]) assert sorted( db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "6e644e70a9fe3145c88b5b6261af5754" ) - ) == sorted( - [ - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)), - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), - ] - ) + ) == sorted([inheritance_dog_mammal_handle, inheritance_cat_mammal_handle]) assert sorted( db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "5dd515aa7a451276feac4f8b9d84ae91" ) - ) == sorted( - [ - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)), - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), - ] - ) + ) == sorted([inheritance_dog_mammal_handle, inheritance_cat_mammal_handle]) assert sorted( db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "7ead6cfa03894c62761162b7603aa885" ) - ) == sorted( - [ - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)), - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), - ] - ) + ) == sorted([inheritance_dog_mammal_handle, inheritance_cat_mammal_handle]) assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "e55007a8477a4e6bf4fec76e4ffd7e10" - ) == [(inheritance_dog_mammal_handle, (dog_handle, mammal_handle))] + ) == [inheritance_dog_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "23dc149b3218d166a14730db55249126" - ) == [(inheritance_dog_mammal_handle, (dog_handle, mammal_handle))] + ) == [inheritance_dog_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "399751d7319f9061d97cd1d75728b66b" - ) == [(inheritance_dog_mammal_handle, (dog_handle, mammal_handle))] + ) == [inheritance_dog_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "d0eaae6eaf750e821b26642cef32becf" - ) == [(inheritance_dog_mammal_handle, (dog_handle, mammal_handle))] + ) == [inheritance_dog_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "f29daafee640d91aa7091e44551fc74a" - ) == [(inheritance_cat_mammal_handle, (cat_handle, mammal_handle))] + ) == [inheritance_cat_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "a11d7cbf62bc544f75702b5fb6a514ff" - ) == [(inheritance_cat_mammal_handle, (cat_handle, mammal_handle))] + ) == [inheritance_cat_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "3ba42d45a50c89600d92fb3f1a46c1b5" - ) == [(inheritance_cat_mammal_handle, (cat_handle, mammal_handle))] + ) == [inheritance_cat_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "9fb71ffef74a1a98eb0bfce7aa3d54e3" - ) == [(inheritance_cat_mammal_handle, (cat_handle, mammal_handle))] + ) == [inheritance_cat_mammal_handle] def _check_asserts_2(): assert db.count_atoms() == {"atom_count": 3} @@ -753,34 +557,34 @@ def _check_asserts_4(): ) assert db._retrieve_hash_targets_value( KeyPrefix.TEMPLATES, "e40489cd1e7102e35469c937e05c8bba" - ) == [(inheritance_dog_mammal_handle, (dog_handle, mammal_handle))] + ) == [inheritance_dog_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.TEMPLATES, "41c082428b28d7e9ea96160f7fd614ad" - ) == [(inheritance_dog_mammal_handle, (dog_handle, mammal_handle))] + ) == [inheritance_dog_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "112002ff70ea491aad735f978e9d95f5" - ) == [(inheritance_dog_mammal_handle, (dog_handle, mammal_handle))] + ) == [inheritance_dog_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "6e644e70a9fe3145c88b5b6261af5754" - ) == [(inheritance_dog_mammal_handle, (dog_handle, mammal_handle))] + ) == [inheritance_dog_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "5dd515aa7a451276feac4f8b9d84ae91" - ) == [(inheritance_dog_mammal_handle, (dog_handle, mammal_handle))] + ) == [inheritance_dog_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "7ead6cfa03894c62761162b7603aa885" - ) == [(inheritance_dog_mammal_handle, (dog_handle, mammal_handle))] + ) == [inheritance_dog_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "e55007a8477a4e6bf4fec76e4ffd7e10" - ) == [(inheritance_dog_mammal_handle, (dog_handle, mammal_handle))] + ) == [inheritance_dog_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "23dc149b3218d166a14730db55249126" - ) == [(inheritance_dog_mammal_handle, (dog_handle, mammal_handle))] + ) == [inheritance_dog_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "399751d7319f9061d97cd1d75728b66b" - ) == [(inheritance_dog_mammal_handle, (dog_handle, mammal_handle))] + ) == [inheritance_dog_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "d0eaae6eaf750e821b26642cef32becf" - ) == [(inheritance_dog_mammal_handle, (dog_handle, mammal_handle))] + ) == [inheritance_dog_mammal_handle] assert ( db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "f29daafee640d91aa7091e44551fc74a" @@ -824,22 +628,22 @@ def _check_asserts_5(): assert db._retrieve_outgoing_set(inheritance_dog_mammal_handle) == [] assert db._retrieve_hash_targets_value( KeyPrefix.TEMPLATES, "e40489cd1e7102e35469c937e05c8bba" - ) == [(inheritance_cat_mammal_handle, (cat_handle, mammal_handle))] + ) == [inheritance_cat_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.TEMPLATES, "41c082428b28d7e9ea96160f7fd614ad" - ) == [(inheritance_cat_mammal_handle, (cat_handle, mammal_handle))] + ) == [inheritance_cat_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "112002ff70ea491aad735f978e9d95f5" - ) == [(inheritance_cat_mammal_handle, (cat_handle, mammal_handle))] + ) == [inheritance_cat_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "6e644e70a9fe3145c88b5b6261af5754" - ) == [(inheritance_cat_mammal_handle, (cat_handle, mammal_handle))] + ) == [inheritance_cat_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "5dd515aa7a451276feac4f8b9d84ae91" - ) == [(inheritance_cat_mammal_handle, (cat_handle, mammal_handle))] + ) == [inheritance_cat_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "7ead6cfa03894c62761162b7603aa885" - ) == [(inheritance_cat_mammal_handle, (cat_handle, mammal_handle))] + ) == [inheritance_cat_mammal_handle] assert ( db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "e55007a8477a4e6bf4fec76e4ffd7e10" @@ -866,16 +670,16 @@ def _check_asserts_5(): ) assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "f29daafee640d91aa7091e44551fc74a" - ) == [(inheritance_cat_mammal_handle, (cat_handle, mammal_handle))] + ) == [inheritance_cat_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "a11d7cbf62bc544f75702b5fb6a514ff" - ) == [(inheritance_cat_mammal_handle, (cat_handle, mammal_handle))] + ) == [inheritance_cat_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "3ba42d45a50c89600d92fb3f1a46c1b5" - ) == [(inheritance_cat_mammal_handle, (cat_handle, mammal_handle))] + ) == [inheritance_cat_mammal_handle] assert db._retrieve_hash_targets_value( KeyPrefix.PATTERNS, "9fb71ffef74a1a98eb0bfce7aa3d54e3" - ) == [(inheritance_cat_mammal_handle, (cat_handle, mammal_handle))] + ) == [inheritance_cat_mammal_handle] db = _db @@ -938,207 +742,51 @@ def test_get_matched_with_pagination(self, _cleanup, _db: RedisMongoDB): assert response == [] response = db.get_matched_links("Similarity", [human, "*"]) - assert sorted(response) == [ - ( + assert sorted(response) == sorted( + [ "16f7e407087bfa0b35b13d13a1aadcae", - ( - "af12f10f9ae2002a1607ba0b47ba8407", - "4e8e26e3276af8a5c2ac2cc2dc95c6d2", - ), - ), - ( "b5459e299a5c5e8662c427f7e01b3bf1", - ( - "af12f10f9ae2002a1607ba0b47ba8407", - "5b34c54bee150c04f9fa584b899dc030", - ), - ), - ( "bad7472f41a0e7d601ca294eb4607c3a", - ( - "af12f10f9ae2002a1607ba0b47ba8407", - "1cdffc6b0b89ff41d68bec237481d1e1", - ), - ), - ] + ] + ) template = ["Inheritance", "Concept", "Concept"] response = db.get_matched_type_template(template) - assert sorted(response) == [ - ( + assert sorted(response) == sorted( + [ "116df61c01859c710d178ba14a483509", - ( - "c1db9b517073e51eb7ef6fed608ec204", - "b99ae727c787f1b13b452fd4c9ce1b9a", - ), - ), - ( "1c3bf151ea200b2d9e088a1178d060cb", - ( - "bdfe4e7a431f73386f37c6448afe5840", - "0a32b476852eeb954979b87f5f6cb7af", - ), - ), - ( "4120e428ab0fa162a04328e5217912ff", - ( - "bb34ce95f161a6b37ff54b3d4c817857", - "0a32b476852eeb954979b87f5f6cb7af", - ), - ), - ( "75756335011dcedb71a0d9a7bd2da9e8", - ( - "5b34c54bee150c04f9fa584b899dc030", - "bdfe4e7a431f73386f37c6448afe5840", - ), - ), - ( "906fa505ae3bc6336d80a5f9aaa47b3b", - ( - "d03e59654221c1e8fcda404fd5c8d6cb", - "08126b066d32ee37743e255a2558cccd", - ), - ), - ( "959924e3aab197af80a84c1ab261fd65", - ( - "08126b066d32ee37743e255a2558cccd", - "b99ae727c787f1b13b452fd4c9ce1b9a", - ), - ), - ( "b0f428929706d1d991e4d712ad08f9ab", - ( - "b99ae727c787f1b13b452fd4c9ce1b9a", - "0a32b476852eeb954979b87f5f6cb7af", - ), - ), - ( "c93e1e758c53912638438e2a7d7f7b7f", - ( - "af12f10f9ae2002a1607ba0b47ba8407", - "bdfe4e7a431f73386f37c6448afe5840", - ), - ), - ( "e4685d56969398253b6f77efd21dc347", - ( - "b94941d8cd1c0ee4ad3dd3dcab52b964", - "80aff30094874e75028033a38ce677bb", - ), - ), - ( "ee1c03e6d1f104ccd811cfbba018451a", - ( - "4e8e26e3276af8a5c2ac2cc2dc95c6d2", - "80aff30094874e75028033a38ce677bb", - ), - ), - ( "f31dfe97db782e8cec26de18dddf8965", - ( - "1cdffc6b0b89ff41d68bec237481d1e1", - "bdfe4e7a431f73386f37c6448afe5840", - ), - ), - ( "fbf03d17d6a40feff828a3f2c6e86f05", - ( - "99d18c702e813b07260baf577c60c455", - "bdfe4e7a431f73386f37c6448afe5840", - ), - ), - ] + ] + ) response = db.get_matched_type("Inheritance") - assert sorted(response) == [ - ( + assert sorted(response) == sorted( + [ "116df61c01859c710d178ba14a483509", - ( - "c1db9b517073e51eb7ef6fed608ec204", - "b99ae727c787f1b13b452fd4c9ce1b9a", - ), - ), - ( "1c3bf151ea200b2d9e088a1178d060cb", - ( - "bdfe4e7a431f73386f37c6448afe5840", - "0a32b476852eeb954979b87f5f6cb7af", - ), - ), - ( "4120e428ab0fa162a04328e5217912ff", - ( - "bb34ce95f161a6b37ff54b3d4c817857", - "0a32b476852eeb954979b87f5f6cb7af", - ), - ), - ( "75756335011dcedb71a0d9a7bd2da9e8", - ( - "5b34c54bee150c04f9fa584b899dc030", - "bdfe4e7a431f73386f37c6448afe5840", - ), - ), - ( "906fa505ae3bc6336d80a5f9aaa47b3b", - ( - "d03e59654221c1e8fcda404fd5c8d6cb", - "08126b066d32ee37743e255a2558cccd", - ), - ), - ( "959924e3aab197af80a84c1ab261fd65", - ( - "08126b066d32ee37743e255a2558cccd", - "b99ae727c787f1b13b452fd4c9ce1b9a", - ), - ), - ( "b0f428929706d1d991e4d712ad08f9ab", - ( - "b99ae727c787f1b13b452fd4c9ce1b9a", - "0a32b476852eeb954979b87f5f6cb7af", - ), - ), - ( "c93e1e758c53912638438e2a7d7f7b7f", - ( - "af12f10f9ae2002a1607ba0b47ba8407", - "bdfe4e7a431f73386f37c6448afe5840", - ), - ), - ( "e4685d56969398253b6f77efd21dc347", - ( - "b94941d8cd1c0ee4ad3dd3dcab52b964", - "80aff30094874e75028033a38ce677bb", - ), - ), - ( "ee1c03e6d1f104ccd811cfbba018451a", - ( - "4e8e26e3276af8a5c2ac2cc2dc95c6d2", - "80aff30094874e75028033a38ce677bb", - ), - ), - ( "f31dfe97db782e8cec26de18dddf8965", - ( - "1cdffc6b0b89ff41d68bec237481d1e1", - "bdfe4e7a431f73386f37c6448afe5840", - ), - ), - ( "fbf03d17d6a40feff828a3f2c6e86f05", - ( - "99d18c702e813b07260baf577c60c455", - "bdfe4e7a431f73386f37c6448afe5840", - ), - ), - ] + ] + ) def test_create_field_index(self, _cleanup, _db: RedisMongoDB): db = _db diff --git a/tests/unit/adapters/data/patterns_redis_data.json b/tests/unit/adapters/data/patterns_redis_data.json index 3a93f46e..32f5595e 100644 --- a/tests/unit/adapters/data/patterns_redis_data.json +++ b/tests/unit/adapters/data/patterns_redis_data.json @@ -1,402 +1,402 @@ { "patterns:33ece2fbf2de88041254699ce03e5d12": [ - "fbf03d17d6a40feff828a3f2c6e86f0599d18c702e813b07260baf577c60c455bdfe4e7a431f73386f37c6448afe5840" + "fbf03d17d6a40feff828a3f2c6e86f05" ], "patterns:bc715adab19a81146b0f05f298138d66": [ - "959924e3aab197af80a84c1ab261fd6508126b066d32ee37743e255a2558cccdb99ae727c787f1b13b452fd4c9ce1b9a" + "959924e3aab197af80a84c1ab261fd65" ], "patterns:599b247a48a77f14348df0ff9711e615": [ - "16f7e407087bfa0b35b13d13a1aadcaeaf12f10f9ae2002a1607ba0b47ba84074e8e26e3276af8a5c2ac2cc2dc95c6d2", - "bad7472f41a0e7d601ca294eb4607c3aaf12f10f9ae2002a1607ba0b47ba84071cdffc6b0b89ff41d68bec237481d1e1", - "b5459e299a5c5e8662c427f7e01b3bf1af12f10f9ae2002a1607ba0b47ba84075b34c54bee150c04f9fa584b899dc030" + "16f7e407087bfa0b35b13d13a1aadcae", + "bad7472f41a0e7d601ca294eb4607c3a", + "b5459e299a5c5e8662c427f7e01b3bf1" ], "patterns:e43eba1ad6978dda624397c44f6fadd1": [ - "959924e3aab197af80a84c1ab261fd6508126b066d32ee37743e255a2558cccdb99ae727c787f1b13b452fd4c9ce1b9a" + "959924e3aab197af80a84c1ab261fd65" ], "patterns:36b1e657e2b7d0170f656c175ea5e7d9": [ - "31535ddf214f5b239d3b517823cb81441cdffc6b0b89ff41d68bec237481d1e15b34c54bee150c04f9fa584b899dc030", - "b5459e299a5c5e8662c427f7e01b3bf1af12f10f9ae2002a1607ba0b47ba84075b34c54bee150c04f9fa584b899dc030" + "31535ddf214f5b239d3b517823cb8144", + "b5459e299a5c5e8662c427f7e01b3bf1" ], "patterns:d4a7666708c529cbc0f0144da31eb414": [ - "ee1c03e6d1f104ccd811cfbba018451a4e8e26e3276af8a5c2ac2cc2dc95c6d280aff30094874e75028033a38ce677bb", - "e4685d56969398253b6f77efd21dc347b94941d8cd1c0ee4ad3dd3dcab52b96480aff30094874e75028033a38ce677bb" + "ee1c03e6d1f104ccd811cfbba018451a", + "e4685d56969398253b6f77efd21dc347" ], "patterns:a2e5f55c0885bdabe057e32c1d929174": [ - "72d0f9904bda2f89f9b68a1010ac61b599d18c702e813b07260baf577c60c455d03e59654221c1e8fcda404fd5c8d6cb" + "72d0f9904bda2f89f9b68a1010ac61b5" ], "patterns:c48b5236102ae75ba3e71729a6bfa2e5": [ - "7ee00a03f67b39f620bd3d0f6ed0c3e6c1db9b517073e51eb7ef6fed608ec204bb34ce95f161a6b37ff54b3d4c817857", - "abe6ad743fc81bd1c55ece2e1307a1785b34c54bee150c04f9fa584b899dc0301cdffc6b0b89ff41d68bec237481d1e1", - "31535ddf214f5b239d3b517823cb81441cdffc6b0b89ff41d68bec237481d1e15b34c54bee150c04f9fa584b899dc030", - "2d7abd27644a9c08a7ca2c8d68338579bb34ce95f161a6b37ff54b3d4c817857c1db9b517073e51eb7ef6fed608ec204", - "16f7e407087bfa0b35b13d13a1aadcaeaf12f10f9ae2002a1607ba0b47ba84074e8e26e3276af8a5c2ac2cc2dc95c6d2", - "bad7472f41a0e7d601ca294eb4607c3aaf12f10f9ae2002a1607ba0b47ba84071cdffc6b0b89ff41d68bec237481d1e1", - "9923fc3e46d779c925d26ac4cf2d9e3bb94941d8cd1c0ee4ad3dd3dcab52b964c1db9b517073e51eb7ef6fed608ec204", - "2c927fdc6c0f1272ee439ceb76a6d1a45b34c54bee150c04f9fa584b899dc030af12f10f9ae2002a1607ba0b47ba8407", - "e431a2eda773adf06ef3f9268f93deafc1db9b517073e51eb7ef6fed608ec204b94941d8cd1c0ee4ad3dd3dcab52b964", - "a45af31b43ee5ea271214338a5a5bd614e8e26e3276af8a5c2ac2cc2dc95c6d2af12f10f9ae2002a1607ba0b47ba8407", - "aef4d3da2565a640e15a52fd98d24d15d03e59654221c1e8fcda404fd5c8d6cb99d18c702e813b07260baf577c60c455", - "2a8a69c01305563932b957de4b3a9ba61cdffc6b0b89ff41d68bec237481d1e1af12f10f9ae2002a1607ba0b47ba8407", - "b5459e299a5c5e8662c427f7e01b3bf1af12f10f9ae2002a1607ba0b47ba84075b34c54bee150c04f9fa584b899dc030", - "72d0f9904bda2f89f9b68a1010ac61b599d18c702e813b07260baf577c60c455d03e59654221c1e8fcda404fd5c8d6cb" + "7ee00a03f67b39f620bd3d0f6ed0c3e6", + "abe6ad743fc81bd1c55ece2e1307a178", + "31535ddf214f5b239d3b517823cb8144", + "2d7abd27644a9c08a7ca2c8d68338579", + "16f7e407087bfa0b35b13d13a1aadcae", + "bad7472f41a0e7d601ca294eb4607c3a", + "9923fc3e46d779c925d26ac4cf2d9e3b", + "2c927fdc6c0f1272ee439ceb76a6d1a4", + "e431a2eda773adf06ef3f9268f93deaf", + "a45af31b43ee5ea271214338a5a5bd61", + "aef4d3da2565a640e15a52fd98d24d15", + "2a8a69c01305563932b957de4b3a9ba6", + "b5459e299a5c5e8662c427f7e01b3bf1", + "72d0f9904bda2f89f9b68a1010ac61b5" ], "patterns:d024789956d6b49fdfdcdd32f25c0770": [ - "116df61c01859c710d178ba14a483509c1db9b517073e51eb7ef6fed608ec204b99ae727c787f1b13b452fd4c9ce1b9a" + "116df61c01859c710d178ba14a483509" ], "patterns:3ac5e7cda6d75569e64aa31bc9408a95": [ - "16f7e407087bfa0b35b13d13a1aadcaeaf12f10f9ae2002a1607ba0b47ba84074e8e26e3276af8a5c2ac2cc2dc95c6d2" + "16f7e407087bfa0b35b13d13a1aadcae" ], "patterns:6066388a9e29f972424275ea2f39715d": [ - "16f7e407087bfa0b35b13d13a1aadcaeaf12f10f9ae2002a1607ba0b47ba84074e8e26e3276af8a5c2ac2cc2dc95c6d2", - "bad7472f41a0e7d601ca294eb4607c3aaf12f10f9ae2002a1607ba0b47ba84071cdffc6b0b89ff41d68bec237481d1e1", - "c93e1e758c53912638438e2a7d7f7b7faf12f10f9ae2002a1607ba0b47ba8407bdfe4e7a431f73386f37c6448afe5840", - "b5459e299a5c5e8662c427f7e01b3bf1af12f10f9ae2002a1607ba0b47ba84075b34c54bee150c04f9fa584b899dc030" + "16f7e407087bfa0b35b13d13a1aadcae", + "bad7472f41a0e7d601ca294eb4607c3a", + "c93e1e758c53912638438e2a7d7f7b7f", + "b5459e299a5c5e8662c427f7e01b3bf1" ], "patterns:e45b923c049c6fc2826059e291a3d161": [ - "7ee00a03f67b39f620bd3d0f6ed0c3e6c1db9b517073e51eb7ef6fed608ec204bb34ce95f161a6b37ff54b3d4c817857" + "7ee00a03f67b39f620bd3d0f6ed0c3e6" ], "patterns:f5269cbecbad862d32ffe6d599cc8c65": [ - "2c927fdc6c0f1272ee439ceb76a6d1a45b34c54bee150c04f9fa584b899dc030af12f10f9ae2002a1607ba0b47ba8407", - "abe6ad743fc81bd1c55ece2e1307a1785b34c54bee150c04f9fa584b899dc0301cdffc6b0b89ff41d68bec237481d1e1" + "2c927fdc6c0f1272ee439ceb76a6d1a4", + "abe6ad743fc81bd1c55ece2e1307a178" ], "patterns:b3036a9a22fc020e3600445bd9585537": [ - "72d0f9904bda2f89f9b68a1010ac61b599d18c702e813b07260baf577c60c455d03e59654221c1e8fcda404fd5c8d6cb" + "72d0f9904bda2f89f9b68a1010ac61b5" ], "patterns:86b4631eb9e7495a0a492f6888b351c3": [ - "9923fc3e46d779c925d26ac4cf2d9e3bb94941d8cd1c0ee4ad3dd3dcab52b964c1db9b517073e51eb7ef6fed608ec204" + "9923fc3e46d779c925d26ac4cf2d9e3b" ], "patterns:60b0c956050d10392d422fe4fb616c74": [ - "f31dfe97db782e8cec26de18dddf89651cdffc6b0b89ff41d68bec237481d1e1bdfe4e7a431f73386f37c6448afe5840" + "f31dfe97db782e8cec26de18dddf8965" ], "patterns:7ead6cfa03894c62761162b7603aa885": [ - "ee1c03e6d1f104ccd811cfbba018451a4e8e26e3276af8a5c2ac2cc2dc95c6d280aff30094874e75028033a38ce677bb", - "e4685d56969398253b6f77efd21dc347b94941d8cd1c0ee4ad3dd3dcab52b96480aff30094874e75028033a38ce677bb", - "906fa505ae3bc6336d80a5f9aaa47b3bd03e59654221c1e8fcda404fd5c8d6cb08126b066d32ee37743e255a2558cccd", - "75756335011dcedb71a0d9a7bd2da9e85b34c54bee150c04f9fa584b899dc030bdfe4e7a431f73386f37c6448afe5840", - "fbf03d17d6a40feff828a3f2c6e86f0599d18c702e813b07260baf577c60c455bdfe4e7a431f73386f37c6448afe5840", - "c93e1e758c53912638438e2a7d7f7b7faf12f10f9ae2002a1607ba0b47ba8407bdfe4e7a431f73386f37c6448afe5840", - "116df61c01859c710d178ba14a483509c1db9b517073e51eb7ef6fed608ec204b99ae727c787f1b13b452fd4c9ce1b9a", - "4120e428ab0fa162a04328e5217912ffbb34ce95f161a6b37ff54b3d4c8178570a32b476852eeb954979b87f5f6cb7af", - "b0f428929706d1d991e4d712ad08f9abb99ae727c787f1b13b452fd4c9ce1b9a0a32b476852eeb954979b87f5f6cb7af", - "1c3bf151ea200b2d9e088a1178d060cbbdfe4e7a431f73386f37c6448afe58400a32b476852eeb954979b87f5f6cb7af", - "959924e3aab197af80a84c1ab261fd6508126b066d32ee37743e255a2558cccdb99ae727c787f1b13b452fd4c9ce1b9a", - "f31dfe97db782e8cec26de18dddf89651cdffc6b0b89ff41d68bec237481d1e1bdfe4e7a431f73386f37c6448afe5840" + "ee1c03e6d1f104ccd811cfbba018451a", + "e4685d56969398253b6f77efd21dc347", + "906fa505ae3bc6336d80a5f9aaa47b3b", + "75756335011dcedb71a0d9a7bd2da9e8", + "fbf03d17d6a40feff828a3f2c6e86f05", + "c93e1e758c53912638438e2a7d7f7b7f", + "116df61c01859c710d178ba14a483509", + "4120e428ab0fa162a04328e5217912ff", + "b0f428929706d1d991e4d712ad08f9ab", + "1c3bf151ea200b2d9e088a1178d060cb", + "959924e3aab197af80a84c1ab261fd65", + "f31dfe97db782e8cec26de18dddf8965" ], "patterns:23b1805ee2eee8b47b1336ed5eb67a63": [ - "31535ddf214f5b239d3b517823cb81441cdffc6b0b89ff41d68bec237481d1e15b34c54bee150c04f9fa584b899dc030" + "31535ddf214f5b239d3b517823cb8144" ], "patterns:112e50d4310273ba9f99403948623d11": [ - "b0f428929706d1d991e4d712ad08f9abb99ae727c787f1b13b452fd4c9ce1b9a0a32b476852eeb954979b87f5f6cb7af" + "b0f428929706d1d991e4d712ad08f9ab" ], "patterns:e3c1b9073620a2d776110a2f867115e1": [ - "c93e1e758c53912638438e2a7d7f7b7faf12f10f9ae2002a1607ba0b47ba8407bdfe4e7a431f73386f37c6448afe5840" + "c93e1e758c53912638438e2a7d7f7b7f" ], "patterns:02715345a1c12653f16f99ef38d2dc74": [ - "abe6ad743fc81bd1c55ece2e1307a1785b34c54bee150c04f9fa584b899dc0301cdffc6b0b89ff41d68bec237481d1e1" + "abe6ad743fc81bd1c55ece2e1307a178" ], "patterns:207553a15eca937359e6940b2bce1147": [ - "4120e428ab0fa162a04328e5217912ffbb34ce95f161a6b37ff54b3d4c8178570a32b476852eeb954979b87f5f6cb7af" + "4120e428ab0fa162a04328e5217912ff" ], "patterns:be73cdab95fb7e83d4a93b65c4dd60c4": [ - "9923fc3e46d779c925d26ac4cf2d9e3bb94941d8cd1c0ee4ad3dd3dcab52b964c1db9b517073e51eb7ef6fed608ec204", - "2d7abd27644a9c08a7ca2c8d68338579bb34ce95f161a6b37ff54b3d4c817857c1db9b517073e51eb7ef6fed608ec204" + "9923fc3e46d779c925d26ac4cf2d9e3b", + "2d7abd27644a9c08a7ca2c8d68338579" ], "patterns:2586aef3dfb28f6d476188aa60846ac2": [ - "116df61c01859c710d178ba14a483509c1db9b517073e51eb7ef6fed608ec204b99ae727c787f1b13b452fd4c9ce1b9a", - "959924e3aab197af80a84c1ab261fd6508126b066d32ee37743e255a2558cccdb99ae727c787f1b13b452fd4c9ce1b9a" + "116df61c01859c710d178ba14a483509", + "959924e3aab197af80a84c1ab261fd65" ], "patterns:ee04dd921bcb34ddc9e7407961e2b171": [ - "b5459e299a5c5e8662c427f7e01b3bf1af12f10f9ae2002a1607ba0b47ba84075b34c54bee150c04f9fa584b899dc030" + "b5459e299a5c5e8662c427f7e01b3bf1" ], "patterns:9072a1bb302c235a29862699eec32433": [ - "2c927fdc6c0f1272ee439ceb76a6d1a45b34c54bee150c04f9fa584b899dc030af12f10f9ae2002a1607ba0b47ba8407" + "2c927fdc6c0f1272ee439ceb76a6d1a4" ], "patterns:a98f2b763cbf7350e2c01bbbd605709e": [ - "a45af31b43ee5ea271214338a5a5bd614e8e26e3276af8a5c2ac2cc2dc95c6d2af12f10f9ae2002a1607ba0b47ba8407" + "a45af31b43ee5ea271214338a5a5bd61" ], "patterns:3d5c095a8fced20a9c32369563fc51fb": [ - "4120e428ab0fa162a04328e5217912ffbb34ce95f161a6b37ff54b3d4c8178570a32b476852eeb954979b87f5f6cb7af" + "4120e428ab0fa162a04328e5217912ff" ], "patterns:c811a103e6a4a924f35f9ec79b6f9bea": [ - "c93e1e758c53912638438e2a7d7f7b7faf12f10f9ae2002a1607ba0b47ba8407bdfe4e7a431f73386f37c6448afe5840" + "c93e1e758c53912638438e2a7d7f7b7f" ], "patterns:93392b12a01496f48e6ae816fa5423c2": [ - "b0f428929706d1d991e4d712ad08f9abb99ae727c787f1b13b452fd4c9ce1b9a0a32b476852eeb954979b87f5f6cb7af" + "b0f428929706d1d991e4d712ad08f9ab" ], "patterns:17f12e8041c9d3d14029bce4b3436bc5": [ - "aef4d3da2565a640e15a52fd98d24d15d03e59654221c1e8fcda404fd5c8d6cb99d18c702e813b07260baf577c60c455" + "aef4d3da2565a640e15a52fd98d24d15" ], "patterns:4f038728598597ba7c1d9b7db83c6624": [ - "16f7e407087bfa0b35b13d13a1aadcaeaf12f10f9ae2002a1607ba0b47ba84074e8e26e3276af8a5c2ac2cc2dc95c6d2" + "16f7e407087bfa0b35b13d13a1aadcae" ], "patterns:71eae19734970016ca8060eb69576c2a": [ - "e431a2eda773adf06ef3f9268f93deafc1db9b517073e51eb7ef6fed608ec204b94941d8cd1c0ee4ad3dd3dcab52b964" + "e431a2eda773adf06ef3f9268f93deaf" ], "patterns:38db3cf156a77e7666f5d84c00d2308d": [ - "9923fc3e46d779c925d26ac4cf2d9e3bb94941d8cd1c0ee4ad3dd3dcab52b964c1db9b517073e51eb7ef6fed608ec204", - "2d7abd27644a9c08a7ca2c8d68338579bb34ce95f161a6b37ff54b3d4c817857c1db9b517073e51eb7ef6fed608ec204" + "9923fc3e46d779c925d26ac4cf2d9e3b", + "2d7abd27644a9c08a7ca2c8d68338579" ], "patterns:e0d9464a089b6183115b46dbdf7fcf31": [ - "4120e428ab0fa162a04328e5217912ffbb34ce95f161a6b37ff54b3d4c8178570a32b476852eeb954979b87f5f6cb7af", - "2d7abd27644a9c08a7ca2c8d68338579bb34ce95f161a6b37ff54b3d4c817857c1db9b517073e51eb7ef6fed608ec204" + "4120e428ab0fa162a04328e5217912ff", + "2d7abd27644a9c08a7ca2c8d68338579" ], "patterns:f3ec599397695b620e12fafc2e65c3dc": [ - "75756335011dcedb71a0d9a7bd2da9e85b34c54bee150c04f9fa584b899dc030bdfe4e7a431f73386f37c6448afe5840" + "75756335011dcedb71a0d9a7bd2da9e8" ], "patterns:e050d7c9ebfca41b026f80bf6f8ff75b": [ - "7ee00a03f67b39f620bd3d0f6ed0c3e6c1db9b517073e51eb7ef6fed608ec204bb34ce95f161a6b37ff54b3d4c817857" + "7ee00a03f67b39f620bd3d0f6ed0c3e6" ], "patterns:6ad6f251e177ffb0a4a69ba848ea5951": [ - "116df61c01859c710d178ba14a483509c1db9b517073e51eb7ef6fed608ec204b99ae727c787f1b13b452fd4c9ce1b9a", - "959924e3aab197af80a84c1ab261fd6508126b066d32ee37743e255a2558cccdb99ae727c787f1b13b452fd4c9ce1b9a" + "116df61c01859c710d178ba14a483509", + "959924e3aab197af80a84c1ab261fd65" ], "patterns:ca793f4d22e39f3623e37b64796372fe": [ - "2c927fdc6c0f1272ee439ceb76a6d1a45b34c54bee150c04f9fa584b899dc030af12f10f9ae2002a1607ba0b47ba8407", - "a45af31b43ee5ea271214338a5a5bd614e8e26e3276af8a5c2ac2cc2dc95c6d2af12f10f9ae2002a1607ba0b47ba8407", - "2a8a69c01305563932b957de4b3a9ba61cdffc6b0b89ff41d68bec237481d1e1af12f10f9ae2002a1607ba0b47ba8407" + "2c927fdc6c0f1272ee439ceb76a6d1a4", + "a45af31b43ee5ea271214338a5a5bd61", + "2a8a69c01305563932b957de4b3a9ba6" ], "patterns:191cac7d4a23f69ac0dd5fc7364eb04a": [ - "72d0f9904bda2f89f9b68a1010ac61b599d18c702e813b07260baf577c60c455d03e59654221c1e8fcda404fd5c8d6cb" + "72d0f9904bda2f89f9b68a1010ac61b5" ], "patterns:a3fdfcd50ac65616075382d2fefd11fd": [ - "fbf03d17d6a40feff828a3f2c6e86f0599d18c702e813b07260baf577c60c455bdfe4e7a431f73386f37c6448afe5840" + "fbf03d17d6a40feff828a3f2c6e86f05" ], "patterns:8f097beb9b347c6044b6b2b639da5985": [ - "ee1c03e6d1f104ccd811cfbba018451a4e8e26e3276af8a5c2ac2cc2dc95c6d280aff30094874e75028033a38ce677bb" + "ee1c03e6d1f104ccd811cfbba018451a" ], "patterns:22529d575a1670c3bbbaa3eda547d60e": [ - "75756335011dcedb71a0d9a7bd2da9e85b34c54bee150c04f9fa584b899dc030bdfe4e7a431f73386f37c6448afe5840" + "75756335011dcedb71a0d9a7bd2da9e8" ], "patterns:8e8fe0e9ff68f6ecb3bdfbac82ff6d35": [ - "906fa505ae3bc6336d80a5f9aaa47b3bd03e59654221c1e8fcda404fd5c8d6cb08126b066d32ee37743e255a2558cccd" + "906fa505ae3bc6336d80a5f9aaa47b3b" ], "patterns:bccfc7700d7fbfe77977afb9a9b7bc1a": [ - "aef4d3da2565a640e15a52fd98d24d15d03e59654221c1e8fcda404fd5c8d6cb99d18c702e813b07260baf577c60c455" + "aef4d3da2565a640e15a52fd98d24d15" ], "patterns:3a724cad494e3c682a29058b2a9e3266": [ - "906fa505ae3bc6336d80a5f9aaa47b3bd03e59654221c1e8fcda404fd5c8d6cb08126b066d32ee37743e255a2558cccd" + "906fa505ae3bc6336d80a5f9aaa47b3b" ], "patterns:8f09c760225cf45b8f050de3a538e663": [ - "e4685d56969398253b6f77efd21dc347b94941d8cd1c0ee4ad3dd3dcab52b96480aff30094874e75028033a38ce677bb", - "9923fc3e46d779c925d26ac4cf2d9e3bb94941d8cd1c0ee4ad3dd3dcab52b964c1db9b517073e51eb7ef6fed608ec204" + "e4685d56969398253b6f77efd21dc347", + "9923fc3e46d779c925d26ac4cf2d9e3b" ], "patterns:cce0902b2c15647f3312d55aebe71338": [ - "31535ddf214f5b239d3b517823cb81441cdffc6b0b89ff41d68bec237481d1e15b34c54bee150c04f9fa584b899dc030", - "2a8a69c01305563932b957de4b3a9ba61cdffc6b0b89ff41d68bec237481d1e1af12f10f9ae2002a1607ba0b47ba8407" + "31535ddf214f5b239d3b517823cb8144", + "2a8a69c01305563932b957de4b3a9ba6" ], "patterns:575e010a4bb0c25d964ddd35cbb9cb58": [ - "2d7abd27644a9c08a7ca2c8d68338579bb34ce95f161a6b37ff54b3d4c817857c1db9b517073e51eb7ef6fed608ec204" + "2d7abd27644a9c08a7ca2c8d68338579" ], "patterns:ab91d5ffc5a3ecb186ccadfc54aef0eb": [ - "31535ddf214f5b239d3b517823cb81441cdffc6b0b89ff41d68bec237481d1e15b34c54bee150c04f9fa584b899dc030", - "b5459e299a5c5e8662c427f7e01b3bf1af12f10f9ae2002a1607ba0b47ba84075b34c54bee150c04f9fa584b899dc030" + "31535ddf214f5b239d3b517823cb8144", + "b5459e299a5c5e8662c427f7e01b3bf1" ], "patterns:177ce9159d7af38dfa2720a65f547cec": [ - "4120e428ab0fa162a04328e5217912ffbb34ce95f161a6b37ff54b3d4c8178570a32b476852eeb954979b87f5f6cb7af", - "b0f428929706d1d991e4d712ad08f9abb99ae727c787f1b13b452fd4c9ce1b9a0a32b476852eeb954979b87f5f6cb7af", - "1c3bf151ea200b2d9e088a1178d060cbbdfe4e7a431f73386f37c6448afe58400a32b476852eeb954979b87f5f6cb7af" + "4120e428ab0fa162a04328e5217912ff", + "b0f428929706d1d991e4d712ad08f9ab", + "1c3bf151ea200b2d9e088a1178d060cb" ], "patterns:5dd515aa7a451276feac4f8b9d84ae91": [ - "75756335011dcedb71a0d9a7bd2da9e85b34c54bee150c04f9fa584b899dc030bdfe4e7a431f73386f37c6448afe5840", - "fbf03d17d6a40feff828a3f2c6e86f0599d18c702e813b07260baf577c60c455bdfe4e7a431f73386f37c6448afe5840", - "c93e1e758c53912638438e2a7d7f7b7faf12f10f9ae2002a1607ba0b47ba8407bdfe4e7a431f73386f37c6448afe5840", - "f31dfe97db782e8cec26de18dddf89651cdffc6b0b89ff41d68bec237481d1e1bdfe4e7a431f73386f37c6448afe5840" + "75756335011dcedb71a0d9a7bd2da9e8", + "fbf03d17d6a40feff828a3f2c6e86f05", + "c93e1e758c53912638438e2a7d7f7b7f", + "f31dfe97db782e8cec26de18dddf8965" ], "patterns:2073045fa2ad12eba1af55a257fd34f5": [ - "116df61c01859c710d178ba14a483509c1db9b517073e51eb7ef6fed608ec204b99ae727c787f1b13b452fd4c9ce1b9a" + "116df61c01859c710d178ba14a483509" ], "patterns:a240d2b25c0082b015763984c5d57a82": [ - "e431a2eda773adf06ef3f9268f93deafc1db9b517073e51eb7ef6fed608ec204b94941d8cd1c0ee4ad3dd3dcab52b964" + "e431a2eda773adf06ef3f9268f93deaf" ], "patterns:1f063c5794592bfa341bf854deab42f2": [ - "906fa505ae3bc6336d80a5f9aaa47b3bd03e59654221c1e8fcda404fd5c8d6cb08126b066d32ee37743e255a2558cccd" + "906fa505ae3bc6336d80a5f9aaa47b3b" ], "patterns:9bf5182cf1cc2d1607a2e892e85637e5": [ - "bad7472f41a0e7d601ca294eb4607c3aaf12f10f9ae2002a1607ba0b47ba84071cdffc6b0b89ff41d68bec237481d1e1", - "abe6ad743fc81bd1c55ece2e1307a1785b34c54bee150c04f9fa584b899dc0301cdffc6b0b89ff41d68bec237481d1e1" + "bad7472f41a0e7d601ca294eb4607c3a", + "abe6ad743fc81bd1c55ece2e1307a178" ], "patterns:10ffc1e4bee3bf1940a343e2ce791210": [ - "e4685d56969398253b6f77efd21dc347b94941d8cd1c0ee4ad3dd3dcab52b96480aff30094874e75028033a38ce677bb" + "e4685d56969398253b6f77efd21dc347" ], "patterns:112002ff70ea491aad735f978e9d95f5": [ - "75756335011dcedb71a0d9a7bd2da9e85b34c54bee150c04f9fa584b899dc030bdfe4e7a431f73386f37c6448afe5840", - "fbf03d17d6a40feff828a3f2c6e86f0599d18c702e813b07260baf577c60c455bdfe4e7a431f73386f37c6448afe5840", - "c93e1e758c53912638438e2a7d7f7b7faf12f10f9ae2002a1607ba0b47ba8407bdfe4e7a431f73386f37c6448afe5840", - "f31dfe97db782e8cec26de18dddf89651cdffc6b0b89ff41d68bec237481d1e1bdfe4e7a431f73386f37c6448afe5840" + "75756335011dcedb71a0d9a7bd2da9e8", + "fbf03d17d6a40feff828a3f2c6e86f05", + "c93e1e758c53912638438e2a7d7f7b7f", + "f31dfe97db782e8cec26de18dddf8965" ], "patterns:5a3bffe6a97084f0e267ff972303e5a6": [ - "e4685d56969398253b6f77efd21dc347b94941d8cd1c0ee4ad3dd3dcab52b96480aff30094874e75028033a38ce677bb" + "e4685d56969398253b6f77efd21dc347" ], "patterns:b0dc87d838daa18f735de1b9e1b08d49": [ - "b0f428929706d1d991e4d712ad08f9abb99ae727c787f1b13b452fd4c9ce1b9a0a32b476852eeb954979b87f5f6cb7af" + "b0f428929706d1d991e4d712ad08f9ab" ], "patterns:a2383971ffc7f41b3bdd74a849134087": [ - "906fa505ae3bc6336d80a5f9aaa47b3bd03e59654221c1e8fcda404fd5c8d6cb08126b066d32ee37743e255a2558cccd" + "906fa505ae3bc6336d80a5f9aaa47b3b" ], "patterns:5a2d7f958f944e7cbe1eb980d5718fdc": [ - "e431a2eda773adf06ef3f9268f93deafc1db9b517073e51eb7ef6fed608ec204b94941d8cd1c0ee4ad3dd3dcab52b964", - "7ee00a03f67b39f620bd3d0f6ed0c3e6c1db9b517073e51eb7ef6fed608ec204bb34ce95f161a6b37ff54b3d4c817857" + "e431a2eda773adf06ef3f9268f93deaf", + "7ee00a03f67b39f620bd3d0f6ed0c3e6" ], "patterns:45467511cdeea84ad6971277ba74e074": [ - "7ee00a03f67b39f620bd3d0f6ed0c3e6c1db9b517073e51eb7ef6fed608ec204bb34ce95f161a6b37ff54b3d4c817857" + "7ee00a03f67b39f620bd3d0f6ed0c3e6" ], "patterns:6e644e70a9fe3145c88b5b6261af5755": [ - "e4685d56969398253b6f77efd21dc347b94941d8cd1c0ee4ad3dd3dcab52b96480aff30094874e75028033a38ce677bb", - "abe6ad743fc81bd1c55ece2e1307a1785b34c54bee150c04f9fa584b899dc0301cdffc6b0b89ff41d68bec237481d1e1", - "16f7e407087bfa0b35b13d13a1aadcaeaf12f10f9ae2002a1607ba0b47ba84074e8e26e3276af8a5c2ac2cc2dc95c6d2", - "9923fc3e46d779c925d26ac4cf2d9e3bb94941d8cd1c0ee4ad3dd3dcab52b964c1db9b517073e51eb7ef6fed608ec204", - "a45af31b43ee5ea271214338a5a5bd614e8e26e3276af8a5c2ac2cc2dc95c6d2af12f10f9ae2002a1607ba0b47ba8407", - "2a8a69c01305563932b957de4b3a9ba61cdffc6b0b89ff41d68bec237481d1e1af12f10f9ae2002a1607ba0b47ba8407", - "f31dfe97db782e8cec26de18dddf89651cdffc6b0b89ff41d68bec237481d1e1bdfe4e7a431f73386f37c6448afe5840", - "7ee00a03f67b39f620bd3d0f6ed0c3e6c1db9b517073e51eb7ef6fed608ec204bb34ce95f161a6b37ff54b3d4c817857", - "906fa505ae3bc6336d80a5f9aaa47b3bd03e59654221c1e8fcda404fd5c8d6cb08126b066d32ee37743e255a2558cccd", - "fbf03d17d6a40feff828a3f2c6e86f0599d18c702e813b07260baf577c60c455bdfe4e7a431f73386f37c6448afe5840", - "c93e1e758c53912638438e2a7d7f7b7faf12f10f9ae2002a1607ba0b47ba8407bdfe4e7a431f73386f37c6448afe5840", - "bad7472f41a0e7d601ca294eb4607c3aaf12f10f9ae2002a1607ba0b47ba84071cdffc6b0b89ff41d68bec237481d1e1", - "116df61c01859c710d178ba14a483509c1db9b517073e51eb7ef6fed608ec204b99ae727c787f1b13b452fd4c9ce1b9a", - "1c3bf151ea200b2d9e088a1178d060cbbdfe4e7a431f73386f37c6448afe58400a32b476852eeb954979b87f5f6cb7af", - "2c927fdc6c0f1272ee439ceb76a6d1a45b34c54bee150c04f9fa584b899dc030af12f10f9ae2002a1607ba0b47ba8407", - "e431a2eda773adf06ef3f9268f93deafc1db9b517073e51eb7ef6fed608ec204b94941d8cd1c0ee4ad3dd3dcab52b964", - "959924e3aab197af80a84c1ab261fd6508126b066d32ee37743e255a2558cccdb99ae727c787f1b13b452fd4c9ce1b9a", - "b5459e299a5c5e8662c427f7e01b3bf1af12f10f9ae2002a1607ba0b47ba84075b34c54bee150c04f9fa584b899dc030", - "2d7abd27644a9c08a7ca2c8d68338579bb34ce95f161a6b37ff54b3d4c817857c1db9b517073e51eb7ef6fed608ec204", - "4120e428ab0fa162a04328e5217912ffbb34ce95f161a6b37ff54b3d4c8178570a32b476852eeb954979b87f5f6cb7af", - "b0f428929706d1d991e4d712ad08f9abb99ae727c787f1b13b452fd4c9ce1b9a0a32b476852eeb954979b87f5f6cb7af", - "aef4d3da2565a640e15a52fd98d24d15d03e59654221c1e8fcda404fd5c8d6cb99d18c702e813b07260baf577c60c455", - "ee1c03e6d1f104ccd811cfbba018451a4e8e26e3276af8a5c2ac2cc2dc95c6d280aff30094874e75028033a38ce677bb", - "75756335011dcedb71a0d9a7bd2da9e85b34c54bee150c04f9fa584b899dc030bdfe4e7a431f73386f37c6448afe5840", - "31535ddf214f5b239d3b517823cb81441cdffc6b0b89ff41d68bec237481d1e15b34c54bee150c04f9fa584b899dc030", - "72d0f9904bda2f89f9b68a1010ac61b599d18c702e813b07260baf577c60c455d03e59654221c1e8fcda404fd5c8d6cb" + "e4685d56969398253b6f77efd21dc347", + "abe6ad743fc81bd1c55ece2e1307a178", + "16f7e407087bfa0b35b13d13a1aadcae", + "9923fc3e46d779c925d26ac4cf2d9e3b", + "a45af31b43ee5ea271214338a5a5bd61", + "2a8a69c01305563932b957de4b3a9ba6", + "f31dfe97db782e8cec26de18dddf8965", + "7ee00a03f67b39f620bd3d0f6ed0c3e6", + "906fa505ae3bc6336d80a5f9aaa47b3b", + "fbf03d17d6a40feff828a3f2c6e86f05", + "c93e1e758c53912638438e2a7d7f7b7f", + "bad7472f41a0e7d601ca294eb4607c3a", + "116df61c01859c710d178ba14a483509", + "1c3bf151ea200b2d9e088a1178d060cb", + "2c927fdc6c0f1272ee439ceb76a6d1a4", + "e431a2eda773adf06ef3f9268f93deaf", + "959924e3aab197af80a84c1ab261fd65", + "b5459e299a5c5e8662c427f7e01b3bf1", + "2d7abd27644a9c08a7ca2c8d68338579", + "4120e428ab0fa162a04328e5217912ff", + "b0f428929706d1d991e4d712ad08f9ab", + "aef4d3da2565a640e15a52fd98d24d15", + "ee1c03e6d1f104ccd811cfbba018451a", + "75756335011dcedb71a0d9a7bd2da9e8", + "31535ddf214f5b239d3b517823cb8144", + "72d0f9904bda2f89f9b68a1010ac61b5" ], "patterns:77b4608883110386871480c9b4b93429": [ - "ee1c03e6d1f104ccd811cfbba018451a4e8e26e3276af8a5c2ac2cc2dc95c6d280aff30094874e75028033a38ce677bb", - "e4685d56969398253b6f77efd21dc347b94941d8cd1c0ee4ad3dd3dcab52b96480aff30094874e75028033a38ce677bb" + "ee1c03e6d1f104ccd811cfbba018451a", + "e4685d56969398253b6f77efd21dc347" ], "patterns:b8ed8c96ed9cbc145ed3a891bd16924f": [ - "f31dfe97db782e8cec26de18dddf89651cdffc6b0b89ff41d68bec237481d1e1bdfe4e7a431f73386f37c6448afe5840" + "f31dfe97db782e8cec26de18dddf8965" ], "patterns:53dd550f94ec5c12d8c021550f77f3a6": [ - "aef4d3da2565a640e15a52fd98d24d15d03e59654221c1e8fcda404fd5c8d6cb99d18c702e813b07260baf577c60c455" + "aef4d3da2565a640e15a52fd98d24d15" ], "patterns:d77f08e15edf2a7192b43686d2b2c993": [ - "1c3bf151ea200b2d9e088a1178d060cbbdfe4e7a431f73386f37c6448afe58400a32b476852eeb954979b87f5f6cb7af" + "1c3bf151ea200b2d9e088a1178d060cb" ], "patterns:89a4e7313f510e044202bd5682fbf55f": [ - "31535ddf214f5b239d3b517823cb81441cdffc6b0b89ff41d68bec237481d1e15b34c54bee150c04f9fa584b899dc030", - "2a8a69c01305563932b957de4b3a9ba61cdffc6b0b89ff41d68bec237481d1e1af12f10f9ae2002a1607ba0b47ba8407", - "f31dfe97db782e8cec26de18dddf89651cdffc6b0b89ff41d68bec237481d1e1bdfe4e7a431f73386f37c6448afe5840" + "31535ddf214f5b239d3b517823cb8144", + "2a8a69c01305563932b957de4b3a9ba6", + "f31dfe97db782e8cec26de18dddf8965" ], "patterns:219f8f719231d340934db0e913dfc821": [ - "1c3bf151ea200b2d9e088a1178d060cbbdfe4e7a431f73386f37c6448afe58400a32b476852eeb954979b87f5f6cb7af" + "1c3bf151ea200b2d9e088a1178d060cb" ], "patterns:ca06a74888b763517838cf4155794aed": [ - "2c927fdc6c0f1272ee439ceb76a6d1a45b34c54bee150c04f9fa584b899dc030af12f10f9ae2002a1607ba0b47ba8407", - "75756335011dcedb71a0d9a7bd2da9e85b34c54bee150c04f9fa584b899dc030bdfe4e7a431f73386f37c6448afe5840", - "abe6ad743fc81bd1c55ece2e1307a1785b34c54bee150c04f9fa584b899dc0301cdffc6b0b89ff41d68bec237481d1e1" + "2c927fdc6c0f1272ee439ceb76a6d1a4", + "75756335011dcedb71a0d9a7bd2da9e8", + "abe6ad743fc81bd1c55ece2e1307a178" ], "patterns:b6b420517271ae8c181537e01e06b0e0": [ - "bad7472f41a0e7d601ca294eb4607c3aaf12f10f9ae2002a1607ba0b47ba84071cdffc6b0b89ff41d68bec237481d1e1", - "abe6ad743fc81bd1c55ece2e1307a1785b34c54bee150c04f9fa584b899dc0301cdffc6b0b89ff41d68bec237481d1e1" + "bad7472f41a0e7d601ca294eb4607c3a", + "abe6ad743fc81bd1c55ece2e1307a178" ], "patterns:b9c90deb7e496fa84922a162ed036f1d": [ - "fbf03d17d6a40feff828a3f2c6e86f0599d18c702e813b07260baf577c60c455bdfe4e7a431f73386f37c6448afe5840", - "72d0f9904bda2f89f9b68a1010ac61b599d18c702e813b07260baf577c60c455d03e59654221c1e8fcda404fd5c8d6cb" + "fbf03d17d6a40feff828a3f2c6e86f05", + "72d0f9904bda2f89f9b68a1010ac61b5" ], "patterns:fe49c75321cfbea324513ea6be03047e": [ - "959924e3aab197af80a84c1ab261fd6508126b066d32ee37743e255a2558cccdb99ae727c787f1b13b452fd4c9ce1b9a" + "959924e3aab197af80a84c1ab261fd65" ], "patterns:53e8d3304d5ca1582e9cabd009695c74": [ - "bad7472f41a0e7d601ca294eb4607c3aaf12f10f9ae2002a1607ba0b47ba84071cdffc6b0b89ff41d68bec237481d1e1" + "bad7472f41a0e7d601ca294eb4607c3a" ], "patterns:796cd25b5d0a24532b7de470414ddd43": [ - "ee1c03e6d1f104ccd811cfbba018451a4e8e26e3276af8a5c2ac2cc2dc95c6d280aff30094874e75028033a38ce677bb", - "a45af31b43ee5ea271214338a5a5bd614e8e26e3276af8a5c2ac2cc2dc95c6d2af12f10f9ae2002a1607ba0b47ba8407" + "ee1c03e6d1f104ccd811cfbba018451a", + "a45af31b43ee5ea271214338a5a5bd61" ], "patterns:0dae65f7537787a242d67f4db5c4fbbf": [ - "2d7abd27644a9c08a7ca2c8d68338579bb34ce95f161a6b37ff54b3d4c817857c1db9b517073e51eb7ef6fed608ec204" + "2d7abd27644a9c08a7ca2c8d68338579" ], "patterns:35c13ecf02c032d7afa0a335f58bc966": [ - "aef4d3da2565a640e15a52fd98d24d15d03e59654221c1e8fcda404fd5c8d6cb99d18c702e813b07260baf577c60c455", - "906fa505ae3bc6336d80a5f9aaa47b3bd03e59654221c1e8fcda404fd5c8d6cb08126b066d32ee37743e255a2558cccd" + "aef4d3da2565a640e15a52fd98d24d15", + "906fa505ae3bc6336d80a5f9aaa47b3b" ], "patterns:42cf50554e4eab75dcd3ae1fedb05bfb": [ - "9923fc3e46d779c925d26ac4cf2d9e3bb94941d8cd1c0ee4ad3dd3dcab52b964c1db9b517073e51eb7ef6fed608ec204" + "9923fc3e46d779c925d26ac4cf2d9e3b" ], "patterns:6e87db346db89c2f7441dd29c934f37b": [ - "aef4d3da2565a640e15a52fd98d24d15d03e59654221c1e8fcda404fd5c8d6cb99d18c702e813b07260baf577c60c455" + "aef4d3da2565a640e15a52fd98d24d15" ], "patterns:b5b52cf4f3d592e2ebe66afd9f8d707e": [ - "4120e428ab0fa162a04328e5217912ffbb34ce95f161a6b37ff54b3d4c8178570a32b476852eeb954979b87f5f6cb7af", - "b0f428929706d1d991e4d712ad08f9abb99ae727c787f1b13b452fd4c9ce1b9a0a32b476852eeb954979b87f5f6cb7af", - "1c3bf151ea200b2d9e088a1178d060cbbdfe4e7a431f73386f37c6448afe58400a32b476852eeb954979b87f5f6cb7af" + "4120e428ab0fa162a04328e5217912ff", + "b0f428929706d1d991e4d712ad08f9ab", + "1c3bf151ea200b2d9e088a1178d060cb" ], "patterns:9bc459ad6a9d086aac843296a3a23774": [ - "2c927fdc6c0f1272ee439ceb76a6d1a45b34c54bee150c04f9fa584b899dc030af12f10f9ae2002a1607ba0b47ba8407", - "a45af31b43ee5ea271214338a5a5bd614e8e26e3276af8a5c2ac2cc2dc95c6d2af12f10f9ae2002a1607ba0b47ba8407", - "2a8a69c01305563932b957de4b3a9ba61cdffc6b0b89ff41d68bec237481d1e1af12f10f9ae2002a1607ba0b47ba8407" + "2c927fdc6c0f1272ee439ceb76a6d1a4", + "a45af31b43ee5ea271214338a5a5bd61", + "2a8a69c01305563932b957de4b3a9ba6" ], "patterns:f31534e0246ef8b6a2f78e409e2d685c": [ - "16f7e407087bfa0b35b13d13a1aadcaeaf12f10f9ae2002a1607ba0b47ba84074e8e26e3276af8a5c2ac2cc2dc95c6d2" + "16f7e407087bfa0b35b13d13a1aadcae" ], "patterns:229f1cf9864fc0b648f9379da70f716b": [ - "e431a2eda773adf06ef3f9268f93deafc1db9b517073e51eb7ef6fed608ec204b94941d8cd1c0ee4ad3dd3dcab52b964" + "e431a2eda773adf06ef3f9268f93deaf" ], "patterns:1bd7c2f037df05925e9d6a3898860d6d": [ - "116df61c01859c710d178ba14a483509c1db9b517073e51eb7ef6fed608ec204b99ae727c787f1b13b452fd4c9ce1b9a", - "e431a2eda773adf06ef3f9268f93deafc1db9b517073e51eb7ef6fed608ec204b94941d8cd1c0ee4ad3dd3dcab52b964", - "7ee00a03f67b39f620bd3d0f6ed0c3e6c1db9b517073e51eb7ef6fed608ec204bb34ce95f161a6b37ff54b3d4c817857" + "116df61c01859c710d178ba14a483509", + "e431a2eda773adf06ef3f9268f93deaf", + "7ee00a03f67b39f620bd3d0f6ed0c3e6" ], "patterns:ea7a31dad0e3567905520206fa22dd67": [ - "a45af31b43ee5ea271214338a5a5bd614e8e26e3276af8a5c2ac2cc2dc95c6d2af12f10f9ae2002a1607ba0b47ba8407" + "a45af31b43ee5ea271214338a5a5bd61" ], "patterns:11ab43defbe2154243e368ecb96cf382": [ - "1c3bf151ea200b2d9e088a1178d060cbbdfe4e7a431f73386f37c6448afe58400a32b476852eeb954979b87f5f6cb7af" + "1c3bf151ea200b2d9e088a1178d060cb" ], "patterns:6a69435164e0bb3405767f941159a5d6": [ - "ee1c03e6d1f104ccd811cfbba018451a4e8e26e3276af8a5c2ac2cc2dc95c6d280aff30094874e75028033a38ce677bb" + "ee1c03e6d1f104ccd811cfbba018451a" ], "patterns:dcbceb9cdec4e97c239d6b7f6fb12ade": [ - "2a8a69c01305563932b957de4b3a9ba61cdffc6b0b89ff41d68bec237481d1e1af12f10f9ae2002a1607ba0b47ba8407" + "2a8a69c01305563932b957de4b3a9ba6" ], "patterns:8f3c3ee0b825d8e2face2ea7600e5605": [ - "72d0f9904bda2f89f9b68a1010ac61b599d18c702e813b07260baf577c60c455d03e59654221c1e8fcda404fd5c8d6cb" + "72d0f9904bda2f89f9b68a1010ac61b5" ], "patterns:09d62c43e5ac4738fb2e38035d88cf79": [ - "d542caa94b57219f1e489e3b03be7126a912032ece1826e55fa583dcaacdc4a91e8ba9639663105e6c735ba83174f789" + "d542caa94b57219f1e489e3b03be7126" ], "patterns:22b109cd4b54e8bc27cd3c399436bc8f": [ - "1e8ba9639663105e6c735ba83174f78907508083e73bbc1e9ad513dd10a968ae24bc29bd87ecc3b3bc6c16c646506438" + "1e8ba9639663105e6c735ba83174f789" ], "patterns:410fbee4b1683893342e748372cc0674": [ - "1e8ba9639663105e6c735ba83174f78907508083e73bbc1e9ad513dd10a968ae24bc29bd87ecc3b3bc6c16c646506438" + "1e8ba9639663105e6c735ba83174f789" ], "patterns:55bf38e5e6ae7091f87c6f540bfc1896": [ - "1e8ba9639663105e6c735ba83174f78907508083e73bbc1e9ad513dd10a968ae24bc29bd87ecc3b3bc6c16c646506438" + "1e8ba9639663105e6c735ba83174f789" ], "patterns:61e20b9d946843c0e391818f1a4e4fac": [ - "1e8ba9639663105e6c735ba83174f78907508083e73bbc1e9ad513dd10a968ae24bc29bd87ecc3b3bc6c16c646506438" + "1e8ba9639663105e6c735ba83174f789" ], "patterns:6e644e70a9fe3145c88b5b6261af5754": [ - "1e8ba9639663105e6c735ba83174f78907508083e73bbc1e9ad513dd10a968ae24bc29bd87ecc3b3bc6c16c646506438", - "d542caa94b57219f1e489e3b03be7126a912032ece1826e55fa583dcaacdc4a91e8ba9639663105e6c735ba83174f789" + "1e8ba9639663105e6c735ba83174f789", + "d542caa94b57219f1e489e3b03be7126" ], "patterns:7e4071137a69f147dde49f892cb8e61d": [ - "1e8ba9639663105e6c735ba83174f78907508083e73bbc1e9ad513dd10a968ae24bc29bd87ecc3b3bc6c16c646506438" + "1e8ba9639663105e6c735ba83174f789" ], "patterns:8721a229b5cad6403828924cbdd726a4": [ - "d542caa94b57219f1e489e3b03be7126a912032ece1826e55fa583dcaacdc4a91e8ba9639663105e6c735ba83174f789" + "d542caa94b57219f1e489e3b03be7126" ], "patterns:bcc291dd0778be127bec52ee2e28ac84": [ - "d542caa94b57219f1e489e3b03be7126a912032ece1826e55fa583dcaacdc4a91e8ba9639663105e6c735ba83174f789" + "d542caa94b57219f1e489e3b03be7126" ], "patterns:d23673920e8289897273316a1331048e": [ - "d542caa94b57219f1e489e3b03be7126a912032ece1826e55fa583dcaacdc4a91e8ba9639663105e6c735ba83174f789" + "d542caa94b57219f1e489e3b03be7126" ], "patterns:e48c0b4d17a514cb58a75c789eb8bb14": [ - "d542caa94b57219f1e489e3b03be7126a912032ece1826e55fa583dcaacdc4a91e8ba9639663105e6c735ba83174f789" + "d542caa94b57219f1e489e3b03be7126" ], "patterns:fc55eaf3fe4af40321a3bec94e50fd5b": [ - "1e8ba9639663105e6c735ba83174f78907508083e73bbc1e9ad513dd10a968ae24bc29bd87ecc3b3bc6c16c646506438", - "d542caa94b57219f1e489e3b03be7126a912032ece1826e55fa583dcaacdc4a91e8ba9639663105e6c735ba83174f789" + "1e8ba9639663105e6c735ba83174f789", + "d542caa94b57219f1e489e3b03be7126" ] } diff --git a/tests/unit/adapters/data/templates_redis_data.json b/tests/unit/adapters/data/templates_redis_data.json index 2b8e102e..9c2151d8 100644 --- a/tests/unit/adapters/data/templates_redis_data.json +++ b/tests/unit/adapters/data/templates_redis_data.json @@ -1,72 +1,72 @@ { "templates:e40489cd1e7102e35469c937e05c8bba": [ - "ee1c03e6d1f104ccd811cfbba018451a4e8e26e3276af8a5c2ac2cc2dc95c6d280aff30094874e75028033a38ce677bb", - "e4685d56969398253b6f77efd21dc347b94941d8cd1c0ee4ad3dd3dcab52b96480aff30094874e75028033a38ce677bb", - "906fa505ae3bc6336d80a5f9aaa47b3bd03e59654221c1e8fcda404fd5c8d6cb08126b066d32ee37743e255a2558cccd", - "75756335011dcedb71a0d9a7bd2da9e85b34c54bee150c04f9fa584b899dc030bdfe4e7a431f73386f37c6448afe5840", - "fbf03d17d6a40feff828a3f2c6e86f0599d18c702e813b07260baf577c60c455bdfe4e7a431f73386f37c6448afe5840", - "c93e1e758c53912638438e2a7d7f7b7faf12f10f9ae2002a1607ba0b47ba8407bdfe4e7a431f73386f37c6448afe5840", - "116df61c01859c710d178ba14a483509c1db9b517073e51eb7ef6fed608ec204b99ae727c787f1b13b452fd4c9ce1b9a", - "4120e428ab0fa162a04328e5217912ffbb34ce95f161a6b37ff54b3d4c8178570a32b476852eeb954979b87f5f6cb7af", - "b0f428929706d1d991e4d712ad08f9abb99ae727c787f1b13b452fd4c9ce1b9a0a32b476852eeb954979b87f5f6cb7af", - "1c3bf151ea200b2d9e088a1178d060cbbdfe4e7a431f73386f37c6448afe58400a32b476852eeb954979b87f5f6cb7af", - "959924e3aab197af80a84c1ab261fd6508126b066d32ee37743e255a2558cccdb99ae727c787f1b13b452fd4c9ce1b9a", - "f31dfe97db782e8cec26de18dddf89651cdffc6b0b89ff41d68bec237481d1e1bdfe4e7a431f73386f37c6448afe5840" + "ee1c03e6d1f104ccd811cfbba018451a", + "e4685d56969398253b6f77efd21dc347", + "906fa505ae3bc6336d80a5f9aaa47b3b", + "75756335011dcedb71a0d9a7bd2da9e8", + "fbf03d17d6a40feff828a3f2c6e86f05", + "c93e1e758c53912638438e2a7d7f7b7f", + "116df61c01859c710d178ba14a483509", + "4120e428ab0fa162a04328e5217912ff", + "b0f428929706d1d991e4d712ad08f9ab", + "1c3bf151ea200b2d9e088a1178d060cb", + "959924e3aab197af80a84c1ab261fd65", + "f31dfe97db782e8cec26de18dddf8965" ], "templates:ed73ea081d170e1d89fc950820ce1cee": [ - "7ee00a03f67b39f620bd3d0f6ed0c3e6c1db9b517073e51eb7ef6fed608ec204bb34ce95f161a6b37ff54b3d4c817857", - "abe6ad743fc81bd1c55ece2e1307a1785b34c54bee150c04f9fa584b899dc0301cdffc6b0b89ff41d68bec237481d1e1", - "31535ddf214f5b239d3b517823cb81441cdffc6b0b89ff41d68bec237481d1e15b34c54bee150c04f9fa584b899dc030", - "2d7abd27644a9c08a7ca2c8d68338579bb34ce95f161a6b37ff54b3d4c817857c1db9b517073e51eb7ef6fed608ec204", - "16f7e407087bfa0b35b13d13a1aadcaeaf12f10f9ae2002a1607ba0b47ba84074e8e26e3276af8a5c2ac2cc2dc95c6d2", - "bad7472f41a0e7d601ca294eb4607c3aaf12f10f9ae2002a1607ba0b47ba84071cdffc6b0b89ff41d68bec237481d1e1", - "9923fc3e46d779c925d26ac4cf2d9e3bb94941d8cd1c0ee4ad3dd3dcab52b964c1db9b517073e51eb7ef6fed608ec204", - "2c927fdc6c0f1272ee439ceb76a6d1a45b34c54bee150c04f9fa584b899dc030af12f10f9ae2002a1607ba0b47ba8407", - "e431a2eda773adf06ef3f9268f93deafc1db9b517073e51eb7ef6fed608ec204b94941d8cd1c0ee4ad3dd3dcab52b964", - "a45af31b43ee5ea271214338a5a5bd614e8e26e3276af8a5c2ac2cc2dc95c6d2af12f10f9ae2002a1607ba0b47ba8407", - "aef4d3da2565a640e15a52fd98d24d15d03e59654221c1e8fcda404fd5c8d6cb99d18c702e813b07260baf577c60c455", - "2a8a69c01305563932b957de4b3a9ba61cdffc6b0b89ff41d68bec237481d1e1af12f10f9ae2002a1607ba0b47ba8407", - "b5459e299a5c5e8662c427f7e01b3bf1af12f10f9ae2002a1607ba0b47ba84075b34c54bee150c04f9fa584b899dc030", - "72d0f9904bda2f89f9b68a1010ac61b599d18c702e813b07260baf577c60c455d03e59654221c1e8fcda404fd5c8d6cb" + "7ee00a03f67b39f620bd3d0f6ed0c3e6", + "abe6ad743fc81bd1c55ece2e1307a178", + "31535ddf214f5b239d3b517823cb8144", + "2d7abd27644a9c08a7ca2c8d68338579", + "16f7e407087bfa0b35b13d13a1aadcae", + "bad7472f41a0e7d601ca294eb4607c3a", + "9923fc3e46d779c925d26ac4cf2d9e3b", + "2c927fdc6c0f1272ee439ceb76a6d1a4", + "e431a2eda773adf06ef3f9268f93deaf", + "a45af31b43ee5ea271214338a5a5bd61", + "aef4d3da2565a640e15a52fd98d24d15", + "2a8a69c01305563932b957de4b3a9ba6", + "b5459e299a5c5e8662c427f7e01b3bf1", + "72d0f9904bda2f89f9b68a1010ac61b5" ], "templates:a9dea78180588431ec64d6bc4872fdbc": [ - "7ee00a03f67b39f620bd3d0f6ed0c3e6c1db9b517073e51eb7ef6fed608ec204bb34ce95f161a6b37ff54b3d4c817857", - "abe6ad743fc81bd1c55ece2e1307a1785b34c54bee150c04f9fa584b899dc0301cdffc6b0b89ff41d68bec237481d1e1", - "31535ddf214f5b239d3b517823cb81441cdffc6b0b89ff41d68bec237481d1e15b34c54bee150c04f9fa584b899dc030", - "2d7abd27644a9c08a7ca2c8d68338579bb34ce95f161a6b37ff54b3d4c817857c1db9b517073e51eb7ef6fed608ec204", - "16f7e407087bfa0b35b13d13a1aadcaeaf12f10f9ae2002a1607ba0b47ba84074e8e26e3276af8a5c2ac2cc2dc95c6d2", - "bad7472f41a0e7d601ca294eb4607c3aaf12f10f9ae2002a1607ba0b47ba84071cdffc6b0b89ff41d68bec237481d1e1", - "9923fc3e46d779c925d26ac4cf2d9e3bb94941d8cd1c0ee4ad3dd3dcab52b964c1db9b517073e51eb7ef6fed608ec204", - "2c927fdc6c0f1272ee439ceb76a6d1a45b34c54bee150c04f9fa584b899dc030af12f10f9ae2002a1607ba0b47ba8407", - "e431a2eda773adf06ef3f9268f93deafc1db9b517073e51eb7ef6fed608ec204b94941d8cd1c0ee4ad3dd3dcab52b964", - "a45af31b43ee5ea271214338a5a5bd614e8e26e3276af8a5c2ac2cc2dc95c6d2af12f10f9ae2002a1607ba0b47ba8407", - "aef4d3da2565a640e15a52fd98d24d15d03e59654221c1e8fcda404fd5c8d6cb99d18c702e813b07260baf577c60c455", - "2a8a69c01305563932b957de4b3a9ba61cdffc6b0b89ff41d68bec237481d1e1af12f10f9ae2002a1607ba0b47ba8407", - "b5459e299a5c5e8662c427f7e01b3bf1af12f10f9ae2002a1607ba0b47ba84075b34c54bee150c04f9fa584b899dc030", - "72d0f9904bda2f89f9b68a1010ac61b599d18c702e813b07260baf577c60c455d03e59654221c1e8fcda404fd5c8d6cb" + "7ee00a03f67b39f620bd3d0f6ed0c3e6", + "abe6ad743fc81bd1c55ece2e1307a178", + "31535ddf214f5b239d3b517823cb8144", + "2d7abd27644a9c08a7ca2c8d68338579", + "16f7e407087bfa0b35b13d13a1aadcae", + "bad7472f41a0e7d601ca294eb4607c3a", + "9923fc3e46d779c925d26ac4cf2d9e3b", + "2c927fdc6c0f1272ee439ceb76a6d1a4", + "e431a2eda773adf06ef3f9268f93deaf", + "a45af31b43ee5ea271214338a5a5bd61", + "aef4d3da2565a640e15a52fd98d24d15", + "2a8a69c01305563932b957de4b3a9ba6", + "b5459e299a5c5e8662c427f7e01b3bf1", + "72d0f9904bda2f89f9b68a1010ac61b5" ], "templates:41c082428b28d7e9ea96160f7fd614ad": [ - "ee1c03e6d1f104ccd811cfbba018451a4e8e26e3276af8a5c2ac2cc2dc95c6d280aff30094874e75028033a38ce677bb", - "e4685d56969398253b6f77efd21dc347b94941d8cd1c0ee4ad3dd3dcab52b96480aff30094874e75028033a38ce677bb", - "906fa505ae3bc6336d80a5f9aaa47b3bd03e59654221c1e8fcda404fd5c8d6cb08126b066d32ee37743e255a2558cccd", - "75756335011dcedb71a0d9a7bd2da9e85b34c54bee150c04f9fa584b899dc030bdfe4e7a431f73386f37c6448afe5840", - "fbf03d17d6a40feff828a3f2c6e86f0599d18c702e813b07260baf577c60c455bdfe4e7a431f73386f37c6448afe5840", - "c93e1e758c53912638438e2a7d7f7b7faf12f10f9ae2002a1607ba0b47ba8407bdfe4e7a431f73386f37c6448afe5840", - "116df61c01859c710d178ba14a483509c1db9b517073e51eb7ef6fed608ec204b99ae727c787f1b13b452fd4c9ce1b9a", - "4120e428ab0fa162a04328e5217912ffbb34ce95f161a6b37ff54b3d4c8178570a32b476852eeb954979b87f5f6cb7af", - "b0f428929706d1d991e4d712ad08f9abb99ae727c787f1b13b452fd4c9ce1b9a0a32b476852eeb954979b87f5f6cb7af", - "1c3bf151ea200b2d9e088a1178d060cbbdfe4e7a431f73386f37c6448afe58400a32b476852eeb954979b87f5f6cb7af", - "959924e3aab197af80a84c1ab261fd6508126b066d32ee37743e255a2558cccdb99ae727c787f1b13b452fd4c9ce1b9a", - "f31dfe97db782e8cec26de18dddf89651cdffc6b0b89ff41d68bec237481d1e1bdfe4e7a431f73386f37c6448afe5840" + "ee1c03e6d1f104ccd811cfbba018451a", + "e4685d56969398253b6f77efd21dc347", + "906fa505ae3bc6336d80a5f9aaa47b3b", + "75756335011dcedb71a0d9a7bd2da9e8", + "fbf03d17d6a40feff828a3f2c6e86f05", + "c93e1e758c53912638438e2a7d7f7b7f", + "116df61c01859c710d178ba14a483509", + "4120e428ab0fa162a04328e5217912ff", + "b0f428929706d1d991e4d712ad08f9ab", + "1c3bf151ea200b2d9e088a1178d060cb", + "959924e3aab197af80a84c1ab261fd65", + "f31dfe97db782e8cec26de18dddf8965" ], "templates:158e76774ba76f59ef774871252cfb7e": [ - "1e8ba9639663105e6c735ba83174f78907508083e73bbc1e9ad513dd10a968ae24bc29bd87ecc3b3bc6c16c646506438" + "1e8ba9639663105e6c735ba83174f789" ], "templates:b74a43dbb36287ea86eb5b0c7b86e8e8": [ - "1e8ba9639663105e6c735ba83174f78907508083e73bbc1e9ad513dd10a968ae24bc29bd87ecc3b3bc6c16c646506438", - "d542caa94b57219f1e489e3b03be7126a912032ece1826e55fa583dcaacdc4a91e8ba9639663105e6c735ba83174f789" + "1e8ba9639663105e6c735ba83174f789", + "d542caa94b57219f1e489e3b03be7126" ], "templates:0ef46597d9234ad94b014af4a1997545": [ - "d542caa94b57219f1e489e3b03be7126a912032ece1826e55fa583dcaacdc4a91e8ba9639663105e6c735ba83174f789" + "d542caa94b57219f1e489e3b03be7126" ] } diff --git a/tests/unit/adapters/test_ram_only.py b/tests/unit/adapters/test_ram_only.py index 85b68834..3a8f7592 100644 --- a/tests/unit/adapters/test_ram_only.py +++ b/tests/unit/adapters/test_ram_only.py @@ -277,20 +277,6 @@ def test_get_link_targets_invalid(self, database: InMemoryDB): assert exc_info.type is AtomDoesNotExist assert exc_info.value.args[0] == "Nonexistent atom" - def test_is_ordered_true(self, database: InMemoryDB): - human = database.get_node_handle("Concept", "human") - mammal = database.get_node_handle("Concept", "mammal") - handle = database.get_link_handle("Inheritance", [human, mammal]) - ret = database.is_ordered(handle) - assert ret is True - - def test_is_ordered_false(self, database: InMemoryDB): - with pytest.raises(AtomDoesNotExist) as exc_info: - database.is_ordered("handle_123") - - assert exc_info.type is AtomDoesNotExist - assert exc_info.value.args[0] == "Nonexistent atom" - def test_get_matched_links_without_wildcard(self, database): link_type = "Similarity" human = ExpressionHasher.terminal_hash("Concept", "human") @@ -304,44 +290,16 @@ def test_get_matched_links_without_wildcard(self, database): def test_get_matched_links_link_equal_wildcard(self, database: InMemoryDB): human = ExpressionHasher.terminal_hash("Concept", "human") chimp = ExpressionHasher.terminal_hash("Concept", "chimp") - expected = [ - ( - "b5459e299a5c5e8662c427f7e01b3bf1", - ( - "af12f10f9ae2002a1607ba0b47ba8407", - "5b34c54bee150c04f9fa584b899dc030", - ), - ) + assert database.get_matched_links("*", [human, chimp]) == [ + "b5459e299a5c5e8662c427f7e01b3bf1" ] - actual = database.get_matched_links("*", [human, chimp]) - - assert expected == actual def test_get_matched_links_link_diff_wildcard(self, database: InMemoryDB): link_type = "Similarity" chimp = ExpressionHasher.terminal_hash("Concept", "chimp") - expected = sorted( - [ - ( - "b5459e299a5c5e8662c427f7e01b3bf1", - ( - "af12f10f9ae2002a1607ba0b47ba8407", - "5b34c54bee150c04f9fa584b899dc030", - ), - ), - ( - "31535ddf214f5b239d3b517823cb8144", - ( - "1cdffc6b0b89ff41d68bec237481d1e1", - "5b34c54bee150c04f9fa584b899dc030", - ), - ), - ], - key=lambda i: i[0], - ) - + expected = ["b5459e299a5c5e8662c427f7e01b3bf1", "31535ddf214f5b239d3b517823cb8144"] actual = database.get_matched_links(link_type, ["*", chimp]) - assert expected == sorted(actual, key=lambda i: i[0]) + assert sorted(expected) == sorted(actual) def test_get_matched_links_link_does_not_exist(self, database: InMemoryDB): link_type = "Similarity-Fake" @@ -379,19 +337,10 @@ def test_get_matched_links_toplevel_only(self, database: InMemoryDB): ], } ) - expected = [ - ( - "661fb5a7c90faabfeada7e1f63805fc0", - ( - "a912032ece1826e55fa583dcaacdc4a9", - "260e118be658feeeb612dcd56d270d77", - ), - ) - ] + expected = ["661fb5a7c90faabfeada7e1f63805fc0"] actual = database.get_matched_links("Evaluation", ["*", "*"], toplevel_only=True) assert expected == actual - assert len(actual) == 1 def test_get_matched_links_wrong_parameter(self, database: InMemoryDB): database.add_link( @@ -816,48 +765,48 @@ def test_delete_atom(self): } assert db.db.templates == { "41c082428b28d7e9ea96160f7fd614ad": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)), + inheritance_cat_mammal_handle, + inheritance_dog_mammal_handle, }, "e40489cd1e7102e35469c937e05c8bba": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)), + inheritance_cat_mammal_handle, + inheritance_dog_mammal_handle, }, } assert db.db.patterns == { "6e644e70a9fe3145c88b5b6261af5754": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)), + inheritance_cat_mammal_handle, + inheritance_dog_mammal_handle, }, "5dd515aa7a451276feac4f8b9d84ae91": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)), + inheritance_cat_mammal_handle, + inheritance_dog_mammal_handle, }, "a11d7cbf62bc544f75702b5fb6a514ff": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), + inheritance_cat_mammal_handle, }, "f29daafee640d91aa7091e44551fc74a": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), + inheritance_cat_mammal_handle, }, "7ead6cfa03894c62761162b7603aa885": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)), + inheritance_cat_mammal_handle, + inheritance_dog_mammal_handle, }, "112002ff70ea491aad735f978e9d95f5": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)), + inheritance_cat_mammal_handle, + inheritance_dog_mammal_handle, }, "3ba42d45a50c89600d92fb3f1a46c1b5": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), + inheritance_cat_mammal_handle, }, "e55007a8477a4e6bf4fec76e4ffd7e10": { - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)) + inheritance_dog_mammal_handle, }, "23dc149b3218d166a14730db55249126": { - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)) + inheritance_dog_mammal_handle, }, "399751d7319f9061d97cd1d75728b66b": { - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)) + inheritance_dog_mammal_handle, }, } @@ -958,36 +907,36 @@ def test_delete_atom(self): assert db.db.outgoing_set == {inheritance_dog_mammal_handle: [dog_handle, mammal_handle]} assert db.db.templates == { "41c082428b28d7e9ea96160f7fd614ad": { - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)) + inheritance_dog_mammal_handle, }, "e40489cd1e7102e35469c937e05c8bba": { - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)) + inheritance_dog_mammal_handle, }, } assert db.db.patterns == { "6e644e70a9fe3145c88b5b6261af5754": { - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)) + inheritance_dog_mammal_handle, }, "5dd515aa7a451276feac4f8b9d84ae91": { - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)) + inheritance_dog_mammal_handle, }, "a11d7cbf62bc544f75702b5fb6a514ff": set(), "f29daafee640d91aa7091e44551fc74a": set(), "7ead6cfa03894c62761162b7603aa885": { - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)) + inheritance_dog_mammal_handle, }, "3ba42d45a50c89600d92fb3f1a46c1b5": set(), "112002ff70ea491aad735f978e9d95f5": { - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)) + inheritance_dog_mammal_handle, }, "e55007a8477a4e6bf4fec76e4ffd7e10": { - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)) + inheritance_dog_mammal_handle, }, "23dc149b3218d166a14730db55249126": { - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)) + inheritance_dog_mammal_handle, }, "399751d7319f9061d97cd1d75728b66b": { - (inheritance_dog_mammal_handle, (dog_handle, mammal_handle)) + inheritance_dog_mammal_handle, }, } @@ -1010,33 +959,33 @@ def test_delete_atom(self): assert db.db.outgoing_set == {inheritance_cat_mammal_handle: [cat_handle, mammal_handle]} assert db.db.templates == { "41c082428b28d7e9ea96160f7fd614ad": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)) + inheritance_cat_mammal_handle, }, "e40489cd1e7102e35469c937e05c8bba": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)) + inheritance_cat_mammal_handle, }, } assert db.db.patterns == { "6e644e70a9fe3145c88b5b6261af5754": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), + inheritance_cat_mammal_handle, }, "5dd515aa7a451276feac4f8b9d84ae91": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), + inheritance_cat_mammal_handle, }, "a11d7cbf62bc544f75702b5fb6a514ff": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), + inheritance_cat_mammal_handle, }, "f29daafee640d91aa7091e44551fc74a": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), + inheritance_cat_mammal_handle, }, "7ead6cfa03894c62761162b7603aa885": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), + inheritance_cat_mammal_handle, }, "112002ff70ea491aad735f978e9d95f5": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), + inheritance_cat_mammal_handle, }, "3ba42d45a50c89600d92fb3f1a46c1b5": { - (inheritance_cat_mammal_handle, (cat_handle, mammal_handle)), + inheritance_cat_mammal_handle, }, "e55007a8477a4e6bf4fec76e4ffd7e10": set(), "23dc149b3218d166a14730db55249126": set(), @@ -1128,86 +1077,32 @@ def test_add_link_that_already_exists(self): } assert db.db.patterns["6e644e70a9fe3145c88b5b6261af5754"] == { - ( - "4a7f5140c0017fe270c8693605fd000a", - ( - "167a378d17b1eda5587292814c8d0769", - "e24c839b9ffaf295c5d9be05171cf5d1", - ), - ) + "4a7f5140c0017fe270c8693605fd000a", } assert db.db.patterns["dab80dcb22dc4b246e3f8642a4e99449"] == { - ( - "4a7f5140c0017fe270c8693605fd000a", - ( - "167a378d17b1eda5587292814c8d0769", - "e24c839b9ffaf295c5d9be05171cf5d1", - ), - ) + "4a7f5140c0017fe270c8693605fd000a", } assert db.db.patterns["957e33112374129ee9a7afacc702fe33"] == { - ( - "4a7f5140c0017fe270c8693605fd000a", - ( - "167a378d17b1eda5587292814c8d0769", - "e24c839b9ffaf295c5d9be05171cf5d1", - ), - ) + "4a7f5140c0017fe270c8693605fd000a", } assert db.db.patterns["7fc3951816751ca77e6e14efecff2529"] == { - ( - "4a7f5140c0017fe270c8693605fd000a", - ( - "167a378d17b1eda5587292814c8d0769", - "e24c839b9ffaf295c5d9be05171cf5d1", - ), - ) + "4a7f5140c0017fe270c8693605fd000a", } assert db.db.patterns["c48b5236102ae75ba3e71729a6bfa2e5"] == { - ( - "4a7f5140c0017fe270c8693605fd000a", - ( - "167a378d17b1eda5587292814c8d0769", - "e24c839b9ffaf295c5d9be05171cf5d1", - ), - ) + "4a7f5140c0017fe270c8693605fd000a", } assert db.db.patterns["699ac93da51eeb8d573f9a20d7e81010"] == { - ( - "4a7f5140c0017fe270c8693605fd000a", - ( - "167a378d17b1eda5587292814c8d0769", - "e24c839b9ffaf295c5d9be05171cf5d1", - ), - ) + "4a7f5140c0017fe270c8693605fd000a", } assert db.db.patterns["7d277b5039fb500cbf51806d06dbdc78"] == { - ( - "4a7f5140c0017fe270c8693605fd000a", - ( - "167a378d17b1eda5587292814c8d0769", - "e24c839b9ffaf295c5d9be05171cf5d1", - ), - ) + "4a7f5140c0017fe270c8693605fd000a", } assert db.db.templates["4c201422342d157b2dded43181e7782d"] == { - ( - "4a7f5140c0017fe270c8693605fd000a", - ( - "167a378d17b1eda5587292814c8d0769", - "e24c839b9ffaf295c5d9be05171cf5d1", - ), - ) + "4a7f5140c0017fe270c8693605fd000a", } assert db.db.templates["a9dea78180588431ec64d6bc4872fdbc"] == { - ( - "4a7f5140c0017fe270c8693605fd000a", - ( - "167a378d17b1eda5587292814c8d0769", - "e24c839b9ffaf295c5d9be05171cf5d1", - ), - ) + "4a7f5140c0017fe270c8693605fd000a", } def test_bulk_insert(self): diff --git a/tests/unit/adapters/test_redis_mongo_db.py b/tests/unit/adapters/test_redis_mongo_db.py index 392b4749..2ce5ccb3 100644 --- a/tests/unit/adapters/test_redis_mongo_db.py +++ b/tests/unit/adapters/test_redis_mongo_db.py @@ -184,24 +184,6 @@ def test_get_link_targets_invalid(self, database: RedisMongoDB): assert exc_info.type is ValueError assert exc_info.value.args[0] == f"Invalid handle: {handle}-Fake" - def test_is_ordered(self, database: RedisMongoDB): - human = database.get_node_handle("Concept", "human") - monkey = database.get_node_handle("Concept", "monkey") - mammal = database.get_node_handle("Concept", "mammal") - link_1 = database.get_link_handle("Inheritance", [human, mammal]) - link_2 = database.get_link_handle("Similarity", [human, monkey]) - assert database.is_ordered(link_1) - assert database.is_ordered(link_2) - - def test_is_ordered_invalid(self, database: RedisMongoDB): - human = database.get_node_handle("Concept", "human") - mammal = database.get_node_handle("Concept", "mammal") - link = database.get_link_handle("Inheritance", [human, mammal]) - with pytest.raises(ValueError) as exc_info: - database.get_link_targets(f"{link}-Fake") - assert exc_info.type is ValueError - assert exc_info.value.args[0] == f"Invalid handle: {link}-Fake" - def test_get_matched_links_without_wildcard(self, database: RedisMongoDB): link_type = "Similarity" human = ExpressionHasher.terminal_hash("Concept", "human") @@ -216,15 +198,7 @@ def test_get_matched_links_link_equal_wildcard(self, database: RedisMongoDB): link_type = "*" human = ExpressionHasher.terminal_hash("Concept", "human") chimp = ExpressionHasher.terminal_hash("Concept", "chimp") - expected = [ - ( - "b5459e299a5c5e8662c427f7e01b3bf1", - ( - "af12f10f9ae2002a1607ba0b47ba8407", - "5b34c54bee150c04f9fa584b899dc030", - ), - ) - ] + expected = ["b5459e299a5c5e8662c427f7e01b3bf1"] actual = database.get_matched_links(link_type, [human, chimp]) assert expected == actual @@ -233,35 +207,15 @@ def test_get_matched_links_link_diff_wildcard(self, database: RedisMongoDB): link_type = "Similarity" chimp = ExpressionHasher.terminal_hash("Concept", "chimp") expected = [ - ( - "31535ddf214f5b239d3b517823cb8144", - ( - "1cdffc6b0b89ff41d68bec237481d1e1", - "5b34c54bee150c04f9fa584b899dc030", - ), - ), - ( - "b5459e299a5c5e8662c427f7e01b3bf1", - ( - "af12f10f9ae2002a1607ba0b47ba8407", - "5b34c54bee150c04f9fa584b899dc030", - ), - ), + "31535ddf214f5b239d3b517823cb8144", + "b5459e299a5c5e8662c427f7e01b3bf1", ] actual = database.get_matched_links(link_type, ["*", chimp]) assert expected == actual def test_get_matched_links_toplevel_only(self, database: RedisMongoDB): - expected = [ - ( - "d542caa94b57219f1e489e3b03be7126", - ( - "a912032ece1826e55fa583dcaacdc4a9", - "1e8ba9639663105e6c735ba83174f789", - ), - ) - ] + expected = ["d542caa94b57219f1e489e3b03be7126"] actual = database.get_matched_links("Evaluation", ["*", "*"], toplevel_only=True) assert expected == actual assert len(actual) == 1 diff --git a/tests/unit/test_database.py b/tests/unit/test_database.py index f530d48e..7afff599 100644 --- a/tests/unit/test_database.py +++ b/tests/unit/test_database.py @@ -520,25 +520,6 @@ def test_get_link_targets(self, database, request): assert all(isinstance(t, str) for t in targets) assert targets == link_a["targets"] - @pytest.mark.parametrize("database", ["redis_mongo_db", "in_memory_db"]) - def test_is_ordered(self, database, request): - db: AtomDB = request.getfixturevalue(database) - link_a = self._add_link(db, "Ac", [{"name": "A", "type": "A"}], database) - # NOTE just retrieves the link ... - assert db.is_ordered(link_a["handle"]) - - @pytest.mark.parametrize("database", ["redis_mongo_db", "in_memory_db"]) - def test_is_ordered_no_handle(self, database, request): - if database == "redis_mongo_db": - # TODO: fix this - pytest.skip( - "ERROR redis_mongo_db is raising ValueError exception, should be AtomDoesNotExist. " - "See https://github.com/singnet/das-atom-db/issues/210" - ) - db: AtomDB = request.getfixturevalue(database) - with pytest.raises(Exception, match="Nonexistent atom"): - db.is_ordered("handle") - @pytest.mark.parametrize( "database,params,links_len", [ # TODO: differences here must be fixed if possible @@ -645,10 +626,9 @@ def test_get_matched_type_template(self, database, params, links_len, is_top_lev assert len(links) == links_len if len(links) > 0: for link in links: - assert _check_handle(link[0]) - assert link[0] == link_a["handle"] - assert all(t in link[1] for t in link_a["targets"]) - assert all(_check_handle(t) for t in link[1]) + assert _check_handle(link) + assert link == link_a["handle"] + assert sorted(db.get_atom(link)["targets"]) == sorted(link_a["targets"]) @pytest.mark.parametrize("database", ["redis_mongo_db", "in_memory_db"]) def test_get_matched_type(self, database, request): @@ -665,10 +645,9 @@ def test_get_matched_type(self, database, request): assert len(links) == 1 if len(links) > 0: for link in links: - assert _check_handle(link[0]) - assert link[0] == link_a["handle"] - assert all(t in link[1] for t in link_a["targets"]) - assert all(_check_handle(t) for t in link[1]) + assert _check_handle(link) + assert link == link_a["handle"] + assert sorted(db.get_atom(link)["targets"]) == sorted(link_a["targets"]) @pytest.mark.parametrize( "database,params,top_level,n_links,n_nodes",