<docbook><section><title>NorthWindREFExample5</title><bridgehead class="http://www.w3.org/1999/xhtml:h4">Dump all People which are contacts of customers and show customer company details.
</bridgehead>
<programlisting>PREFIX ndw:&lt;http://demo.openlinksw.com/schemas/northwind#&gt;
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
PREFIX rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;
SELECT ?name ?phone ?customer_company
WHERE
  { 
    ?st a foaf:Person .
    ?st rdf:type ndw:CustomerContact .
    ?st foaf:name ?name.
    ?st foaf:phone ?phone .
    ?st ndw:is_contact_at ?cnt.
    ?cnt ndw:companyName ?customer_company
  }
</programlisting><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4">Sample Data (Live Query Results)</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem>View Query Results <ulink url="http://demo.openlinksw.com/sparql?default-graph-uri=&amp;should-sponge=&amp;query=PREFIX+ndw%3A%3Chttp%3A%2F%2Fdemo.openlinksw.com%2Fschemas%2Fnorthwind%23%3E%0D%0APREFIX+foaf%3A+%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0D%0APREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0ASELECT+%3Fname+%3Fphone+%3Fcustomer_company%0D%0AWHERE%0D%0A++%7B+%0D%0A++++%3Fst+a+foaf%3APerson+.%0D%0A++++%3Fst+rdf%3Atype+ndw%3ACustomerContact+.%0D%0A++++%3Fst+foaf%3Aname+%3Fname.%0D%0A++++%3Fst+foaf%3Aphone+%3Fphone+.%0D%0A++++%3Fst+ndw%3Ais_contact_at+%3Fcnt.%0D%0A++++%3Fcnt+ndw%3AcompanyName+%3Fcustomer_company%0D%0A++%7D&amp;format=text%2Fhtml&amp;debug=on">(via SPARQL Protocol URL)</ulink> </listitem>
<listitem>View Query Results <ulink url="http://demo.openlinksw.com/view/?format=application%2Frdf%2Bxml&amp;maxrows=50&amp;query=%0APREFIX%20ndw%3A%3Chttp%3A%2F%2Fdemo.openlinksw.com%2Fschemas%2Fnorthwind%23%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0APREFIX%20rdf%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0ASELECT%20%3Fname%20%3Fphone%20%3Fcustomer_company%0AWHERE%0A%20%20%7B%20%0A%20%20%20%20%3Fst%20a%20foaf%3APerson%20.%0A%20%20%20%20%3Fst%20rdf%3Atype%20ndw%3ACustomerContact%20.%0A%20%20%20%20%3Fst%20foaf%3Aname%20%3Fname.%0A%20%20%20%20%3Fst%20foaf%3Aphone%20%3Fphone%20.%0A%20%20%20%20%3Fst%20ndw%3Ais_contact_at%20%3Fcnt.%0A%20%20%20%20%3Fcnt%20ndw%3AcompanyName%20%3Fcustomer_company%0A%20%20%7D&amp;endpoint=/sparql&amp;maxrows=50&amp;default-graph-uri=">(via iSPARQL Results URL)</ulink> </listitem>
<listitem>View Query Editor <ulink url="http://demo.openlinksw.com/isparql/?query=PREFIX%20ndw%3A%3Chttp%3A%2F%2Fdemo.openlinksw.com%2Fschemas%2Fnorthwind%23%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0APREFIX%20rdf%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0ASELECT%20%3Fname%20%3Fphone%20%3Fcustomer_company%0AWHERE%0A%20%20%7B%20%0A%20%20%20%20%3Fst%20a%20foaf%3APerson%20.%0A%20%20%20%20%3Fst%20rdf%3Atype%20ndw%3ACustomerContact%20.%0A%20%20%20%20%3Fst%20foaf%3Aname%20%3Fname.%0A%20%20%20%20%3Fst%20foaf%3Aphone%20%3Fphone%20.%0A%20%20%20%20%3Fst%20ndw%3Ais_contact_at%20%3Fcnt.%0A%20%20%20%20%3Fcnt%20ndw%3AcompanyName%20%3Fcustomer_company%0A%20%20%7D&amp;endpoint=/sparql&amp;maxrows=50&amp;default-graph-uri=">(via iSPARQL Visual Query Editor URL)</ulink> </listitem>
</itemizedlist></section></docbook>