One interesting technique is to use several rules to combine two sets of unrelated data together. To do this, we create one rule to generate one set of results and a second rule to generate another set of results. If a result from the second rule wasn't also matched by the first rule, it will have content created for it. Recall that when the member resource for a rule matches several rules, only the earliest rule that matches will have content generated for it. If resources don't overlap, we can generate content for two different parts of the RDF data. This technique isn't commonly used. Usually, all of the rules will be similar but just have different filters to match based on different criteria.

If we add the following data about people to the neighbourhood datasource:

  <rdf:Description rdf:about="http://www.xulplanet.com/rdf/myneighbourhood">
    <r:people>
      <rdf:Seq>
        <rdf:li rdf:resource="http://www.xulplanet.com/rdf/person/1"/>
        <rdf:li rdf:resource="http://www.xulplanet.com/rdf/person/2"/>
      </rdf:Seq>
    </r:people>
  </rdf:Description>
  <rdf:Description rdf:about="http://www.xulplanet.com/rdf/person/1"
                   dc:title="Nathan"/>
  <rdf:Description rdf:about="http://www.xulplanet.com/rdf/person/2"
                   dc:title="Karen"/>

We can then use two rules to generate results from different parts of the datasource. The first rule will match the streets as before, but the second rule will generate a result for each person. A header class is used to distinguish the content, although you could use exactly the same content if you wish.

<template>
  <rule>
    <conditions>
      <content uri="?start"/>
      <member container="?start" child="?item"/>
    </conditions>
    <bindings>
      <binding subject="?item" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/>
    </bindings>
    <action>
      <label uri="?item" value="?title" class="header"/>
    </action>
  </rule>
  <rule>
    <conditions>
      <content uri="?start"/>
      <triple subject="?start" predicate="http://www.xulplanet.com/rdf/people" object="?people"/>
      <member container="?people" child="?item"/>
    </conditions>
    <bindings>
      <binding subject="?item" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/>
    </bindings>
    <action>
      <label uri="?item" value="?title"/>
    </action>
  </rule>
</template>

You can view the example.