def _contact_details(self, subject, predicate):
'''
Returns a dict with details about a vcard expression
Both subject and predicate must be rdflib URIRef or BNode objects
Returns keys for uri, name and email with the values set to
None if they could not be found
'''
contact = {}
for agent in self.g.objects(subject, predicate):
contact['uri'] = (unicode(agent) if isinstance(agent,
rdflib.term.URIRef) else None)
contact['name'] = self._object_value(agent, VCARD.fn)
contact['email'] = self._object_value(agent, VCARD.hasEmail)
return contact
评论列表
文章目录