🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

how to extract metadata of a table (other than using R)?

User: "juju"
New Altair Community Member
Updated by Jocelyn

Hi, how do I programmatically extract the metadata of a table?

For exmaple, how to extract the column name of the label?

I want to automate some workflow based on what the data look like. Thanks

 

I know how to extract metadata in "EXECTURE R". If there's no easy way using RM functions, I'll use R.

 

 

 

Untitled.png

 

sample code:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.4.000">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.4.000" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="generate_data" compatibility="6.4.000" expanded="true" height="60" name="Generate Data" width="90" x="112" y="30">
<parameter key="number_examples" value="10"/>
</operator>
<connect from_op="Generate Data" from_port="output" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>

 

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "IngoRM"
    New Altair Community Member
    Accepted Answer

    Hey,

     

    Ok, got it.  There might be another way (it's getting late ;-)) but right now the only one I was able to come with was by using a small script in the Execute Script operator.  Below is a process which is doing this.

     

    Hope this helps and I will come back if I can figure out a completely code free way :smileywink:

     

    Best,

    Ingo

     

    <?xml version="1.0" encoding="UTF-8"?><process version="7.2.001">
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="7.2.001" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="retrieve" compatibility="7.2.001" expanded="true" height="68" name="Retrieve Sonar" width="90" x="45" y="34">
    <parameter key="repository_entry" value="//Samples/data/Sonar"/>
    </operator>
    <operator activated="true" class="execute_script" compatibility="7.2.001" expanded="true" height="82" name="Execute Script" width="90" x="179" y="34">
    <parameter key="script" value="ExampleSet exampleSet = operator.getInput(ExampleSet.class);&#10;&#10;Attribute label = exampleSet.getAttributes().getLabel();&#10;if (label != null)&#10;&#9;operator.getProcess().getMacroHandler().addMacro(&quot;label_name&quot;, label.getName());&#10;else&#10;&#9;operator.getProcess().getMacroHandler().addMacro(&quot;label_name&quot;, &quot;null&quot;);&#10;&#9;&#10;return exampleSet;"/>
    </operator>
    <connect from_op="Retrieve Sonar" from_port="output" to_op="Execute Script" to_port="input 1"/>
    <connect from_op="Execute Script" from_port="output 1" to_port="result 1"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_result 1" spacing="0"/>
    <portSpacing port="sink_result 2" spacing="0"/>
    </process>
    </operator>
    </process>