Index

Example: Generate a list of items from inbound arcs

This template generates results from inbound arcs instead of those pointing out of a node. In the first triple, the ?uri variable is used in the object instead of the subject. This will find all the people that have the tarantula as a favorite animal.

View   View Data Source

<vbox datasources="animals.rdf" ref="http://www.some-fictitious-zoo.com/arachnids/tarantula">
  <template>
    <rule>
      <conditions>
          <content uri="?uri"/>
          <triple subject="?human"
                  predicate="http://www.some-fictitious-zoo.com/rdf#favoriteAnimal"
                  object="?uri"/>
          <triple subject="?human"
                  predicate="http://www.some-fictitious-zoo.com/rdf#name"
                  object="?humanname"/>
      </conditions>
      <action>
        <label uri="?human" value="?humanname"/>
      </action>
    </rule>
  </template>
</vbox>
Copyright © 1999 - 2005 XULPlanet.com