The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
loop example problem
I am a bit stuck with the loop example operator, so if someone can tell me what I am doing wrong here it would be great.
I have a example set with urls, and each url should be crawled and stored, but I am only able to fetch the last one. Find below simplified process :
What am I overlooking ? How can I get the actual attribute value of the current itteration ?
I have a example set with urls, and each url should be crawled and stored, but I am only able to fetch the last one. Find below simplified process :
<?xml version="1.0" encoding="UTF-8" standalone="no"?>running this will give me my original url, but for every example I get the last value in the example set, where I was expecting the value for the given index (macro value e in this example)
<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="retrieve" compatibility="6.4.000" expanded="true" height="60" name="Retrieve tv" width="90" x="45" y="30">
<parameter key="repository_entry" value="crawler/links"/>
</operator>
<operator activated="true" class="loop_examples" compatibility="6.4.000" expanded="true" height="76" name="Loop Examples (2)" width="90" x="179" y="30">
<parameter key="iteration_macro" value="e"/>
<process expanded="true">
<operator activated="true" class="extract_macro" compatibility="6.4.000" expanded="true" height="60" name="Extract Macro (2)" width="90" x="112" y="30">
<parameter key="macro" value="href"/>
<parameter key="macro_type" value="data_value"/>
<parameter key="attribute_name" value="href"/>
<parameter key="example_index" value="%{e}"/>
<list key="additional_macros">
<parameter key="date" value="date"/>
</list>
</operator>
<operator activated="true" class="generate_attributes" compatibility="6.4.000" expanded="true" height="76" name="Generate Attributes (2)" width="90" x="246" y="30">
<list key="function_descriptions">
<parameter key="link" value="macro("href")"/>
<parameter key="index" value="macro("e")"/>
</list>
</operator>
<connect from_port="example set" to_op="Extract Macro (2)" to_port="example set"/>
<connect from_op="Extract Macro (2)" from_port="example set" to_op="Generate Attributes (2)" to_port="example set input"/>
<connect from_op="Generate Attributes (2)" from_port="example set output" to_port="example set"/>
<portSpacing port="source_example set" spacing="0"/>
<portSpacing port="sink_example set" spacing="0"/>
<portSpacing port="sink_output 1" spacing="0"/>
</process>
</operator>
<connect from_op="Retrieve tv" from_port="output" to_op="Loop Examples (2)" to_port="example set"/>
<connect from_op="Loop Examples (2)" from_port="example set" 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>
What am I overlooking ? How can I get the actual attribute value of the current itteration ?
Tagged:
0
Answers
this one should work better: Loop Examples is giving you the full example set each time. The upper most port is given to you in the next iteration. The lower ports are the output ports.
~Martin
Dortmund, Germany