知識蒐集與查詢:
知識蒐集 (Category):(查詢)
# -*- coding: utf-8 -*- import sys import codecs import uuid class BDA0(): Category = [ "Big Data & Analytics Benefits and Concepts", "Big Data & Analytics Design Principles", "Big Data & Analytics Adoption", "IBM Big Data & Analytics Solutions", "IBM Big Data & Analytics Infrastructure Considerations", "IBM Big Data & Analytics Reference Architecture" ] def __init__(self): pass def GenerateJSON(self): json = [] for cat in self.Category: json.append('\t{"_id":"%s", "Title":"%s"}' % (uuid.uuid4(), cat)) return "[\n%s\n]" % (',\n'.join(json)) if __name__ == '__main__': jsonFile = None if len(sys.argv) > 1: jsonFile = sys.argv[1] main = BDA0() if jsonFile is None: print main.GenerateJSON() else: try: f = codecs.open(jsonFile, 'w', encoding='utf-8') f.write(main.GenerateJSON()) f.close() except Exception, e: print e
知識蒐集 (Subject):(查詢)
# -*- coding: utf-8 -*- import sys import codecs import uuid class BDA1(): idCategory = "fc30b4c8-558f-43d6-b9c1-95300c38559f" Subject = [ "Explain Volume, Velocity, Variety and Veracity in relation to BD&A.", "Define analytics and the various types", "Describe the value of analytics to support business decisions.", "Explain how Big Data & Analytics are interlocked.", "Explain the various data preparation processes.", "Explain specific data preparation techniques for creating structured data.", "Describe the general sources of data for BD&A." ] def __init__(self): pass def GenerateJSON(self): json = [] for subj in self.Subject: json.append('\t{"_id":"%s", "idCategory":"%s", "Title":"%s"}' % (uuid.uuid4(), self.idCategory, subj)) return "[\n%s\n]" % (',\n'.join(json)) if __name__ == '__main__': jsonFile = None if len(sys.argv) > 1: jsonFile = sys.argv[1] main = BDA1() if jsonFile is None: print main.GenerateJSON() else: try: f = codecs.open(jsonFile, 'w', encoding='utf-8') f.write(main.GenerateJSON()) f.close() except Exception, e: print e