Hey Benedikt,
You have two mistakes, firstly, RDF is triples of subject, predicate, object (s,p,o) - the rdflib resource object lets you tie down the subject part and more easily query the p's and o's to go with that subject. If you wanted to list everything known about a given person, you could have used "resource", but you are actually interested in all (s,o) pairs that are related the surname property.
The other mistake is the URL for the surname property, you did:
> gnd.resource('gnd:surname')
but RDFLib doesn't know how to expand the "gnd:" prefix shorthand to the full URL like this. Instead, you define a namespace:
and then you can do:
GND.surname
to get the a URIRef object representing your property.
This you can use in a call to graph.subject_objects() and you get your values:
for person, name in gnd.subject_objects(GND.surname):
print person, name
Have fun!
- Gunnar