<docbook><section><title>VirtTipsAndTricksGuideMakeMeshups</title><bridgehead class="http://www.w3.org/1999/xhtml:h2">How can I use SPARQL to make Meshups?</bridgehead>
<para>The following example demonstrates how to use SPARQL in order to make Meshups:</para>
<programlisting>PREFIX dbo: &lt;http://dbpedia.org/ontology/&gt;
PREFIX rtb: &lt;http://www.openlinksw.com/schemas/oat/rdftabs#&gt;

CONSTRUCT 
  {
    ?museum geo:geometry ?museumgeo ;
             rtb:useMarker &#39;star&#39; ;
             foaf:name ?musname;
             rdfs:comment ?muscomment.
    ?edu geo:geometry ?edugeo ;
          rtb:useMarker &#39;book&#39; ;
          foaf:name ?eduname;
          rdfs:comment ?educomment.
    ?wh geo:geometry ?whgeo;
            rtb:useMarker &#39;03&#39;;
            foaf:name ?whname;
            rdfs:comment ?whcomment.
  }
WHERE 
  { 
    {
      ?museum a dbo:Museum;
              geo:geometry ?museumgeo;
              foaf:name ?musname;
              rdfs:comment ?muscomment.
      filter (lang(?musname)=&#39;en&#39; &amp;&amp; lang(?muscomment)=&#39;en&#39;)
    } 
    UNION 
    {
      ?edu a dbo:University;
           geo:geometry ?edugeo;
           foaf:name ?eduname;
           rdfs:comment ?educomment.
      filter (lang(?eduname)=&#39;en&#39; &amp;&amp; lang(?educomment)=&#39;en&#39;)
    } 
    UNION 
    {
      ?wh a dbo:WorldHeritageSite;
            geo:geometry ?whgeo;
            rdfs:label ?whname;
            rdfs:comment ?whcomment. 
      filter (lang(?whname)=&#39;en&#39; &amp;&amp; lang(?whcomment)=&#39;en&#39;)
    } 
  }
</programlisting><para><ulink url="http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&amp;query=PREFIX+dbo%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0APREFIX+rtb%3A+%3Chttp%3A%2F%2Fwww.openlinksw.com%2Fschemas%2Foat%2Frdftabs%23%3E%0D%0A%0D%0ACONSTRUCT+%0D%0A++%7B%0D%0A++++%3Fmuseum+geo%3Ageometry+%3Fmuseumgeo+%3B%0D%0A+++++++++++++rtb%3AuseMarker+%27star%27+%3B%0D%0A+++++++++++++foaf%3Aname+%3Fmusname%3B%0D%0A+++++++++++++rdfs%3Acomment+%3Fmuscomment.%0D%0A++++%3Fedu+geo%3Ageometry+%3Fedugeo+%3B%0D%0A++++++++++rtb%3AuseMarker+%27book%27+%3B%0D%0A++++++++++foaf%3Aname+%3Feduname%3B%0D%0A++++++++++rdfs%3Acomment+%3Feducomment.%0D%0A++++%3Fwh+geo%3Ageometry+%3Fwhgeo%3B%0D%0A++++++++++++rtb%3AuseMarker+%2703%27%3B%0D%0A++++++++++++foaf%3Aname+%3Fwhname%3B%0D%0A++++++++++++rdfs%3Acomment+%3Fwhcomment.%0D%0A++%7D%0D%0AWHERE+%0D%0A++%7B+%0D%0A++++%7B%0D%0A++++++%3Fmuseum+a+dbo%3AMuseum%3B%0D%0A++++++++++++++geo%3Ageometry+%3Fmuseumgeo%3B%0D%0A++++++++++++++foaf%3Aname+%3Fmusname%3B%0D%0A++++++++++++++rdfs%3Acomment+%3Fmuscomment.%0D%0A++++++filter+%28lang%28%3Fmusname%29%3D%27en%27+%26%26+lang%28%3Fmuscomment%29%3D%27en%27%29%0D%0A++++%7D+%0D%0A++++UNION+%0D%0A++++%7B%0D%0A++++++%3Fedu+a+dbo%3AUniversity%3B%0D%0A+++++++++++geo%3Ageometry+%3Fedugeo%3B%0D%0A+++++++++++foaf%3Aname+%3Feduname%3B%0D%0A+++++++++++rdfs%3Acomment+%3Feducomment.%0D%0A++++++filter+%28lang%28%3Feduname%29%3D%27en%27+%26%26+lang%28%3Feducomment%29%3D%27en%27%29%0D%0A++++%7D+%0D%0A++++UNION+%0D%0A++++%7B%0D%0A++++++%3Fwh+a+dbo%3AWorldHeritageSite%3B%0D%0A++++++++++++geo%3Ageometry+%3Fwhgeo%3B%0D%0A++++++++++++rdfs%3Alabel+%3Fwhname%3B%0D%0A++++++++++++rdfs%3Acomment+%3Fwhcomment.+%0D%0A++++++filter+%28lang%28%3Fwhname%29%3D%27en%27+%26%26+lang%28%3Fwhcomment%29%3D%27en%27%29%0D%0A++++%7D+%0D%0A++%7D%0D%0Alimit+100&amp;format=application%2Frdf%2Bxml&amp;timeout=0&amp;debug=on">View the results</ulink> of the query execution on the <ulink url="http://dbpedia.org">dbpedia</ulink> instance.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3">Related</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtTipsAndTricksGuide">Virtuoso Tips and Tricks Collection</ulink> </listitem>
</itemizedlist></section></docbook>