title: How to form dbPedia iSPARQL query (for wikipedia content)
body: <p>Say I need to fetch content from wikipedia about all mountains. My target is to show initial paragraph, and an image from respective article (eg. <a href="http://en.wikipedia.org/wiki/Monte_Rosa" rel="nofollow">Monte Rosa</a> and <a href="http://en.wikipedia.org/wiki/Vincent_Pyramid" rel="nofollow">Vincent Pyramid</a>.</p>
  
  <p>I came to know about dbpedia, and with some research got to find that it provides live queries into wiki database directly. </p>
  
  <p>I have 2 questions:</p>
  
  <p>1 - I am finding it difficult how could I formulate my queries. I can't play around <a href="http://dbpedia.org/isparql/#" rel="nofollow">iSPARQL</a>. I tried following query but it throws error saying invalid xml.</p>
  
  <pre><code>SELECT DISTINCT ?Mountain FROM &lt;http://dbpedia.org&gt; WHERE {
    [] rdf:type ?Mountain 
  }
  </code></pre>
  
  <p>2 - My requirement is to show only mountains that have at least 1 image (I need to show this image too). Now the ones I listed above have images, but how could I be sure? Also, looking at both examples I see many fields differ in wiki articles - so for future extension it maybe quite difficult to fetch them. </p>
  
  <p>I just want to reject those which do not have sufficient data or description.</p>
  
  <p>How can I filter out mountains based on pictures present?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>My corrected query, which solves my first problem:</p>
  
  <pre><code>PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
  PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
  
  SELECT DISTINCT ?name ?description
  WHERE {
  ?name rdf:type &lt;http://dbpedia.org/ontology/Mountain&gt;;
  dbpedia-owl:abstract ?description .
  }
  </code></pre>