Commits

edsu committed 0aa7b42

small edits

Comments (0)

Files changed (1)

 
     def endElement(self, name):
 
-        if name == 'node':
+        if name == 'node' and self.node['identity']:
             n = self.node
-            s = snac_url(self.node['identity'])
+            s = snac_url(n['identity'])
             if n['entityType'] == 'person':
                 self.graph.add((s, rdflib.RDF.type, FOAF.Person))
                 # TODO: massage heading into a real name?
                 self.graph.add((s, FOAF.name, rdflib.Literal(n['identity'])))
             if n['urls']:
                 for u in n['urls'].replace('\n', ' ').split(' '):
+                    if not u:
+                        continue
                     coll = rdflib.URIRef(u)
                     self.graph.add((s, ARCH.primaryProvenanceOf, coll))
                     self.graph.add((coll, ARCH.hasProvenance, s))
-            print self.node['identity']
+            print n['identity']
             self.node = None
 
         elif name == 'edge':