<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>success</status>
  <result>
    <project>
      <id>75591</id>
      <name>simplesparql</name>
      <created_at>2008-12-19T21:07:34Z</created_at>
      <updated_at>2008-12-19T21:07:34Z</updated_at>
      <description>SimpleSPARQL allows queries to SPARQL endpoints in a very simple language similar to MQL. The query language is designed specifically for python and uses python dictionaries in the same way as MQL. 

Example Code: 

&gt;&gt;&gt; from SimpleSPARQL import SimpleSPARQL
&gt;&gt;&gt; sparql = SimpleSPARQL(&quot;http://dbpedia.org/sparql&quot;)
&gt;&gt;&gt; n = sparql.n
&gt;&gt;&gt; n.bind('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#')
&gt;&gt;&gt; n.bind('rdfs', 'http://www.w3.org/2000/01/rdf-schema#')
&gt;&gt;&gt; n.bind('dbpedia2', 'http://dbpedia.org/property/')

&gt;&gt;&gt; # the area in Km^2 of things labeled England
&gt;&gt;&gt; print sparql.quickread({
&gt;&gt;&gt;                           n.rdfs.label : u&quot;England&quot;,
&gt;&gt;&gt;                           n.dbpedia2.areaKm : None
&gt;&gt;&gt;                        })[0]
130395

&gt;&gt;&gt; # The Prime Minister of England's types
&gt;&gt;&gt; q = {
&gt;&gt;&gt;		n.rdfs.label : u&quot;England&quot;,
&gt;&gt;&gt;		n.dbpedia2.primeMinister : {
&gt;&gt;&gt;			n.rdf.type : None
&gt;&gt;&gt;		}
&gt;&gt;&gt; 	}
&gt;&gt;&gt; for type in sparql.quickread(q) :
&gt;&gt;&gt;	print type
http://xmlns.com/foaf/0.1/Person
http://dbpedia.org/class/yago/PrimeMinistersOfTheUnitedKingdom
http://dbpedia.org/class/yago/ChancellorsOfTheExchequerOfTheUnitedKingdom
http://dbpedia.org/class/yago/LeadersOfTheBritishLabourParty
http://dbpedia.org/class/yago/AcademicsOfTheUniversityOfEdinburgh
http://dbpedia.org/class/yago/RectorsOfTheUniversityOfEdinburgh
http://dbpedia.org/class/yago/PeopleFromGlasgow
http://dbpedia.org/class/yago/AcademicsOfTheOpenUniversity
...

&gt;&gt;&gt; for obj in sparql.read(q) :
&gt;&gt;&gt;	print obj
{
	rdflib.URIRef('http://dbpedia.org/property/primeMinister'):{
		rdflib.URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'): u'http://dbpedia.org/ontology/OfficeHolder#Class'
	},
	rdflib.URIRef('http://www.w3.org/2000/01/rdf-schema#label'): u'England'
}
{
	rdflib.URIRef('http://dbpedia.org/property/primeMinister'):{
		rdflib.URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'): u'http://dbpedia.org/ontology/OfficeHolder#Class'
	},
	rdflib.URIRef('http://www.w3.org/2000/01/rdf-schema#label'): u'England'
}
{
	rdflib.URIRef('http://dbpedia.org/property/primeMinister'):{
		rdflib.URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'): u'http://dbpedia.org/ontology/OfficeHolder#Class'
	},
	rdflib.URIRef('http://www.w3.org/2000/01/rdf-schema#label'): u'England'
}
...
	
&gt;&gt;&gt; print sparql.ask({ n.rdfs.label : u&quot;England&quot;, 
                       n.dbpedia2.primeMinister : { n.rdfs.label : u&quot;Tony Blair&quot; }
                     })
False

&gt;&gt;&gt; # and if you could do writes to dbpedia:
&gt;&gt;&gt; obj = {
&gt;&gt;&gt;		n.rdfs.label : &quot;Hello World&quot;,
&gt;&gt;&gt;		n.sparql.create : n.sparql.unless_exists
&gt;&gt;&gt;       }
&gt;&gt;&gt; sparql.write(obj)</description>
      <homepage_url>http://code.google.com/p/simplesparql</homepage_url>
      <download_url></download_url>
      <url_name>simplesparql</url_name>
      <user_count>0</user_count>
      <average_rating></average_rating>
      <rating_count>0</rating_count>
      <analysis_id></analysis_id>
      <licenses>
        <license>
          <name>gpl3_or_later</name>
          <nice_name>GNU General Public License 3 or later</nice_name>
        </license>
      </licenses>
    </project>
  </result>
</response>
