本文整理汇总了Python中al_lib.ArchiLib.ArchiLib类的典型用法代码示例。如果您正苦于以下问题:Python ArchiLib类的具体用法?Python ArchiLib怎么用?Python ArchiLib使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ArchiLib类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: requirementAnalysis
def requirementAnalysis(fileArchimate=None):
if fileArchimate is None:
fileArchimate = u"/Users/morrj140/Documents/SolutionEngineering/Archimate Models/DVC v38.archimate"
al = ArchiLib(fileArchimate)
conceptsFile = fileConceptsRequirements
searchTypes = list()
searchTypes.append(u"archimate:Requirement")
nl = al.getTypeNodes(searchTypes)
logger.info(u"Find Words in Requirements...")
concepts = Concepts(u"Requirement", u"Requirements")
n = 0
for sentence in nl:
n += 1
logger.debug(u"%s" % sentence)
c = concepts.addConceptKeyType(u"Document" + str(n), u"Document")
d = c.addConceptKeyType(sentence, u"Sentence" + str(n))
if True and sentence is not None:
cleanSentence = ' '.join([word for word in sentence.split(u" ") if word not in stop])
for word, pos in nltk.pos_tag(nltk.wordpunct_tokenize(cleanSentence)):
if len(word) > 1 and pos[0] == u"N":
e = d.addConceptKeyType(word, u"Word")
f = e.addConceptKeyType(pos, u"POS")
Concepts.saveConcepts(concepts, conceptsFile)
logger.info(u"Saved : %s" % conceptsFile)
chunks = Chunks(concepts)
chunks.createChunks()
示例2: test_ArchiCounts
def test_ArchiCounts(cleandir, fileArchimate):
assert (os.path.isfile(fileArchimate) is True)
al = ArchiLib(fileArchimateTest)
lc = al.logTypeCounts()
assert (len(lc) > 0)
示例3: createRelations
def createRelations(fileArchimate=fileArchimateTest):
start_time = ArchiLib.startTimer()
cr = CreateRelationsInArchi(fileArchimate)
cr.createRelations()
ArchiLib.stopTimer(start_time)
示例4: namedEntityAnalysis
def namedEntityAnalysis(fileArchimate=fileArchimateTest, fileConceptsRequirements=fileConceptsRequirements):
start_time = ArchiLib.startTimer()
ane = AnalyzeNamedEntities(fileArchimate, fileConceptsRequirements)
ane.analyzeNamedEntities()
ArchiLib.stopTimer(start_time)
示例5: __init__
def __init__(self, fileArchimate):
self.fileAchimate = fileArchimate
self.n = 0
self.al = ArchiLib(fileArchimate)
self.start_time = ArchiLib.startTimer()
self.width = u"120"
self.height = u"55"
示例6: exportArchi
def exportArchi(fileArchimate, fileConceptsExport):
start_time = ArchiLib.startTimer()
ea = ExportArchi(fileArchimate, fileConceptsExport)
ea.exportArchi()
ArchiLib.stopTimer(start_time)
示例7: exportArchiFolderModels
def exportArchiFolderModels(fileArchimate, fileConceptsExport, folder):
start_time = ArchiLib.startTimer()
eafm = ExportArchiFolderModels(fileArchimate, fileConceptsExport)
eafm.exportArchiFolderModels(folder)
ArchiLib.stopTimer(start_time)
示例8: analyzeGraph
def analyzeGraph(gdb):
concepts = None
start_time = ArchiLib.startTimer()
ag = AnalyzeGraph(gdb)
ag.analyzeNetworkX(concepts, fileConceptsExport)
ArchiLib.stopTimer(start_time)
示例9: createTagCloud
def createTagCloud(conceptFile, topic):
start_time = ArchiLib.startTimer()
concepts = Concepts.loadConcepts(conceptFile)
tc = TopicCloud(concepts, font_path=u"/Users/morrj140/Fonts/DroidSans.ttf", imageFile=u"Topics.png")
tc.createTagCloud(topic)
ArchiLib.stopTimer(start_time)
示例10: exportArchiModel
def exportArchiModel(fileArchimate, fileConceptsExport, model, fileCSVExport):
start_time = ArchiLib.startTimer()
eam = ExportArchiModel(fileArchimate, fileConceptsExport, fileCSVExport)
listMTE = list()
listMTE.append(model)
eam.exportArchiModel(listMTE)
ArchiLib.stopTimer(start_time)
示例11: exportNeo4j
def exportNeo4j(gdb):
# measure process time, wall time
start_time = ArchiLib.startTimer()
concepts = Concepts(u"Neo4J", u"Neo4J Graph DB")
nj = Neo4JLib(gdb)
nj.exportNeo4JToConcepts(concepts)
ArchiLib.stopTimer(start_time)
示例12: dependancyAnalysisFromArchi
def dependancyAnalysisFromArchi(fileArchimate):
start_time = ArchiLib.startTimer()
da = DependancyAnalysis(fileArchimate)
concepts, listTSort = da.collectDependancyAnalysisNodes()
da.dependancyAnalysis(listTSort)
concepts.logConcepts()
ArchiLib.stopTimer(start_time)
示例13: importWSDL
def importWSDL():
start_time = ArchiLib.startTimer()
etree.QName(ArchiLib.ARCHIMATE_NS, u"model")
treeArchi = etree.parse(fileArchimateTest)
al = ArchiLib()
dirWSDL = u"/Users/morrj140/Documents/SolutionEngineering/Jawa/Jawa_v2_rc37"
for root, dirs, files in os.walk(dirWSDL, topdown=True):
for name in files:
nameFile = os.path.join(root, name)
logger.info(u"Checking File : %s" % name)
if nameFile[-4:].lower() == u"wsdl":
nFile = name[:-5]
logger.info(u"nFile : %s" % nFile)
tree = etree.parse(nameFile)
xp = u"//@schemaLocation"
txp = tree.xpath(xp)
for x in txp:
method = x[4:-4]
logger.info(u"x : %s" % method)
al.insertTwoColumns(
treeArchi, u"Application", u"New Jawa", u"archimate:ApplicationService", nFile, method
)
al.outputXML(treeArchi)
ArchiLib.stopTimer(start_time)
示例14: createArchimateConcepts
def createArchimateConcepts(fileArchimate, fileConceptsArch):
logger.info(u"Using : %s" % fileArchimate)
concepts = Concepts(fileArchimateModel, u"Archimate")
al = ArchiLib(fileArchimate)
al.logTypeCounts()
#
# Create Concepts from Archimate
#
al.folderConcepts(concepts)
Concepts.saveConcepts(concepts, fileConceptsArch)
logger.info(u"Saved concepts to : %s" % fileConceptsArch)
示例15: importConceptsIntoArchi
def importConceptsIntoArchi():
logger.info(u"Using : %s" % fileArchimateTest)
conceptFile = fileConceptsBatches
logger.info(u"Loading :" + conceptFile)
concepts = Concepts.loadConcepts(conceptFile)
al = ArchiLib()
# Create Subfolder
folder = u"Implementation & Migration"
subfolder = u"Dependancy Analysis - %s" % time.strftime(u"%Y%d%m_%H%M%S")
attrib = dict()
attrib[u"id"] = al.getID()
attrib[u"name"] = subfolder
al.insertNode(u"folder", folder, attrib)
logger.info(u"--- Insert Nodes ---")
insertConceptNode(al, concepts, subfolder)
logger.info(u"--- Insert Relations ---")
insertConceptRelation(al, concepts)
al.outputXMLtoFile(filename=u"import_concepts.archimate")