SMS2: ID for JSON Lists

I am converting the following JSON structure succesfully via a SMS2 mapper:

...

FROM JSON{

 {
  [
     {"utterance": "?utt"}, 
  ]
 }

}TO {
?hit has :Utterance.
?utterance a :Utterance .
       :has_text ?utt .
...
}

Example input and output:

{
  [
     {"utterance": "Hello "}, 
     {"utterance": "world"}, 
  ]
 }

<:Message123> :has <:Utterance1> ;
                           :has <:Utterance2> .
<:Utterance1> :has_text "Hello" .
<:Utterance2> :has_text "World" .

Is there a way to keep track of the order of the array using SMS2? The result should be something like:

<:Message123> :has <:Utterance1> ;
                           :has <:Utterance2> .
<:Utterance1> :has_text "Hello" ;
                        :has_id 1 .
<:Utterance2> :has_text "World" ;
                        :has_id 2 .

So how could I add an iterator to:

?hit has :Utterance.
?utterance a :Utterance .
       :has_text ?utt ; 
       :has_id <????my_iterator_solution????>

...

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.