Thellmann / callimachus

Automatically exported from code.google.com/p/callimachus
Other
0 stars 0 forks source link

Template Engine Can't handle @rel nested in @property #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
To show only related resources if a property exists should be done like this.

    <tbody rel="tri:released_to" resource="?released">
        <tr property="tri:amount_in_pounds" content="?amount">
            <td><span>{?amount} lbs</span></td>
            <td><span rel="tri:environmental_medium ">{rdfs:label}</span></td>
            <td><span rel="tri:release_basis_estimate">{rdfs:label}</span></td>
        </tr>
    </tbody>

However, that produces the SPARQL below, when the amount_in_pounds is not 
matched and the nested resources are, the template engine gets messed up and 
can't continue. This happens because the SPARQL results are inconsistent with 
the template markup.

 {
  ?this tri:released_to ?released .
  OPTIONAL {
   {
    ?released tri:amount_in_pounds ?amount .
   }
   UNION
   {
    ?released tri:environmental_medium ?_released_environmental_medium .
    OPTIONAL {
     ?_released_environmental_medium rdfs:label ?_released_environmental_medium_label .
    }
   }
   UNION
   {
    ?released tri:release_basis_estimate ?_released_release_basis_estimate .
    OPTIONAL {
     ?_released_release_basis_estimate rdfs:label ?_released_release_basis_estimate_label .
    }
   }
  }
 }

The nested @rel should be in an OPTIONAL from the @property.

Original issue reported on code.google.com by ja...@3roundstones.com on 23 Sep 2011 at 7:19