def get_personnames(bibdata): # Find all the instances of persons personnames = [] xpath ="//foaf:Person" persons = bibdata.xpath(xpath, namespaces=namespaces)print("There are "+str(len(persons)) +" instances of the Element 'person' in the dataset.")# Get the names (full name or first name, last name) from each personfor item in persons: iflen(item) ==1: personname = item[0].text personnames.append(personname)eliflen(item) ==2: personname = item[0].text +", "+ item[1].text personnames.append(personname) print("There are "+str(len(Counter(personnames))) +" different person names in the dataset.")return personnamesglobal personnamespersonnames = get_personnames(bibdata)
There are 96424 instances of the Element 'person' in the dataset.
There are 30514 different person names in the dataset.
Visualization of the most frequent person names
These persons could be authors or editors of publications.