Commits

Anonymous committed 2f89b41

debugging fixes to letters and place controller. Changed rdf in sparql_functions

Comments (0)

Files changed (4)

openletters/controllers/letters.py

                 return xml.letter_xml(query_string)
        
         elif type == "rdf":
-            response.headers['Content-Type'] = 'text/xml'
+            response.headers['Content-Type'] = 'application/rdf+xml'
             rdf = rdf_transform()
             return rdf.create_rdf_letter(query_string)
 

openletters/controllers/place.py

         locations = []
         locations = list(sparql.find_places())
         c.places = sorted(locations)
+        print "locations", c.places
 
         return render('letters/magazineindex.html')
     

openletters/transform/sparql_funcs.py

 '''
 
 geo = Namespace('http://www.w3.org/2003/01/geo/wgs84_pos#')
+dublin_core = Namespace('http://purl.org/dc/elements/1.1/')
 
 class sparql_funcs():
     
         '''
         row = set()
         self.g.parse(self.endpoint)
-        print "places", len(self.g)
-        for s,_,n in self.g.triples((None, geo['name'], None)):
+
+        for s,_,n in self.g.triples((None, dublin_core['title'], None)):
+            print "sub", s
             loc_key = urllib.unquote(n.replace("http://www.opencorrespondence.org/place/resource/", ""))
             row.add(self.__tidy_location(loc_key))
-       
+        print "row", row
         return row
     
     def __tidy_location (self, location):

openletters/transform/transform_rdf.py

         
     def create_place (self, place):
         
-        long = ''
-        lat = ''
-        place_name = ''
-        
-        if place == "Gad's Hill":
-            long = '51.2440'
+        (long, lat, place_name, place_abstract) = ('','','','')
+       # long = ''
+       # lat = ''
+       # place_name = ''
+       # place_abstract = ''
+
+        if place == "Gads Hill":
+            long = '51.2440N'
             lat = '0.2728E'
             place_name = place
             place_abstract = "Gads Hill Place in Higham, Kent, sometimes spelt Gadshill Place and Gad's Hill Place, was the country home of Charles Dickens, the most successful British author of the Victorian era."
-        elif place == 'Tavistock Place':
-            long = '51.5255'
+        elif place == 'Tavistock House':
+            long = '51.5255N'
             lat = '0.1286W'
             place_name = place
             place_abstract = "Tavistock House was the London home of the noted British author Charles Dickens and his family from 1851 to 1860. At Tavistock House Dickens wrote Bleak House, Hard Times, Little Dorrit and A Tale of Two Cities. He also put on amateur theatricals there which are described in John Forster's Life of Charles Dickens. Later, it was the home of William and Georgina Weldon, whose lodger was the French composer Charles Gounod, who composed part of his opera Polyeucte at the house."