Introduced ConceptsAlgebra
This commit is contained in:
+16
-16
@@ -565,7 +565,7 @@ class Sheerka(Concept):
|
||||
return c
|
||||
|
||||
metadata = [(index_name, key), ("id", concept_id)] if concept_id else (index_name, key)
|
||||
return self._get_unknown(metadata)
|
||||
return self.get_unknown(metadata)
|
||||
|
||||
def resolve(self, concept):
|
||||
"""
|
||||
@@ -827,20 +827,20 @@ class Sheerka(Concept):
|
||||
|
||||
return self.parsers_prefix + name
|
||||
|
||||
def concepts(self):
|
||||
"""
|
||||
List of all known concepts (look up in sdp)
|
||||
:return:
|
||||
"""
|
||||
res = []
|
||||
lst = self.sdp.list(self.CONCEPTS_BY_ID_ENTRY)
|
||||
for item in lst:
|
||||
if isinstance(item, list):
|
||||
res.extend(item)
|
||||
else:
|
||||
res.append(item)
|
||||
|
||||
return sorted(res, key=lambda i: int(i.id))
|
||||
# def concepts(self):
|
||||
# """
|
||||
# List of all known concepts (look up in sdp)
|
||||
# :return:
|
||||
# """
|
||||
# res = []
|
||||
# lst = self.sdp.list(self.CONCEPTS_BY_ID_ENTRY)
|
||||
# for item in lst:
|
||||
# if isinstance(item, list):
|
||||
# res.extend(item)
|
||||
# else:
|
||||
# res.append(item)
|
||||
#
|
||||
# return sorted(res, key=lambda i: int(i.id))
|
||||
|
||||
def get_last_execution(self):
|
||||
return self._last_execution
|
||||
@@ -896,7 +896,7 @@ class Sheerka(Concept):
|
||||
return a.key == b_key
|
||||
|
||||
@staticmethod
|
||||
def _get_unknown(metadata):
|
||||
def get_unknown(metadata):
|
||||
"""
|
||||
Returns the concept 'UnknownConcept' for a requested id or key
|
||||
Note that I don't call the new() method to prevent cyclic call
|
||||
|
||||
Reference in New Issue
Block a user