2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Modelerストリームのノード情報をmodeler scriptで取得する

Last updated at Posted at 2022-09-15

Modeler ScriptをつかってModelerストリームのノード情報を取得します。

以下のようなPythonのmodeler scriptで取得できます。

nodeinfo.py
import modeler.api
import pprint
stream = modeler.script.stream()

for node in stream.iterator():
    print('id: '+node.getID())
    print('label: '+node.getLabel())
    print('typeName: '+node.getTypeName())
    print('getAnnotation: '+node.getAnnotation())
    print 'getKeywords: ', ' '.join(map(str,node.getKeywords()))
    print('getToolTipText: '+node.getToolTipText())
    print''

以下のストリームからコメントを取得します。様々な種類のノードが使われています。

image.png

特に「credit_6か月前.csv」については注釈情報を詳しく入力しています。

image.png

以下のように全ノードのid、ラベル、ノードタイプ、注釈、キーワード、ツールチップの情報が取れています。
image.png

結果
id: id6I7QRGCAXGX
label: credit_6か月前.csv
typeName: variablefile
getAnnotation: 入力ファイルは適宜最新をダウンロードしてください。
getKeywords:  キーワード1
getToolTipText: 入力ファイルは最新を使ってください

id: id6Z4WQVEADMV
label: HKWD.COND4N_E104
typeName: database
getAnnotation: 
getKeywords:  
getToolTipText: 

id: id7X8RT3RE74Y
label: credit_新規結果.csv
typeName: outputfile
getAnnotation: 
getKeywords:  
getToolTipText: 

id: id5W8R6HDHYY4
label: credit_新規顧客.csv
typeName: variablefile
getAnnotation: 
getKeywords:  
getToolTipText: 

id: id5W6WKK3E9HH
label: Age > '$P-AGE'
typeName: select
getAnnotation: 
getKeywords:  
getToolTipText: 

id: id3VMXA85W5LP
label: Credit_rating
typeName: chaid
getAnnotation: 8679a6771f
getKeywords:  
getToolTipText: 

id: id492VK7JSS41
label: Credit_rating
typeName: applychaid
getAnnotation: 8679a6771f
getKeywords:  
getToolTipText: 

id: id2KGWUX5K8AH
label: Credit_rating
typeName: applychaid
getAnnotation: 8679a6771f
getKeywords:  
getToolTipText: 

id: id3QPX5A7BQWG
label: 拡張の変換
typeName: extension_process
getAnnotation: 
getKeywords:  
getToolTipText: 

id: id2GDXAWCGG6M
label: 精度分析
typeName: analysis
getAnnotation: 8679a67821
getKeywords:  
getToolTipText: 

id: id1WEX4RUL91M
label: TESTTAB
typeName: databaseexport
getAnnotation: 
getKeywords:  
getToolTipText: 
  • テスト環境
    • Modeler 18.4
    • Windows 11 64bit

参考

共通のノード・プロパティー - IBM Documentation

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?