Sparql query for GND-RDF

356 views Asked by At

What is the correct SPARQL query for extracting the forename, surname, dateOfBirth and placeOfBirth of all "DifferentiatedPerson"s in the GND RDF/XML data? (Data-Homepage: http://www.dnb.de/DE/Service/DigitaleDienste/Datendienst/datendienst_node.html)

Example excerpt of data:

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:geo="http://www.opengis.net/ont/geosparql#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:sf="http://www.opengis.net/ont/sf#" xmlns:isbd="http://iflastandards.info/ns/isbd/elements/" xmlns:gndo="http://d-nb.info/standards/elementset/gnd#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:marcRole="http://id.loc.gov/vocabulary/relators/" xmlns:lib="http://purl.org/library/" xmlns:umbel="http://umbel.org/umbel#" xmlns:rdau="http://rdaregistry.info/Elements/u/" xmlns:bibo="http://purl.org/ontology/bibo/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:skos="http://www.w3.org/2004/02/skos/core#">
...
  <rdf:Description rdf:about="http://d-nb.info/gnd/1070954047">
            <rdf:type rdf:resource="http://d-nb.info/standards/elementset/gnd#DifferentiatedPerson" />
            <gndo:gndIdentifier>1070954047</gndo:gndIdentifier>
            <gndo:preferredNameForThePerson>Kunz, Hans Jürgen</gndo:preferredNameForThePerson>
            <gndo:preferredNameEntityForThePerson rdf:parseType="Resource">
                    <gndo:forename>Hans Jürgen</gndo:forename>
                    <gndo:surname>Kunz</gndo:surname>
            </gndo:preferredNameEntityForThePerson>
            <gndo:affiliation rdf:resource="http://d-nb.info/gnd/2010684-1" />
            <gndo:affiliation rdf:resource="http://d-nb.info/gnd/2063435-3" />
            <gndo:professionOrOccupation rdf:resource="http://d-nb.info/gnd/4141636-3" />
            <gndo:professionOrOccupationAsLiteral>Zootechniker</gndo:professionOrOccupationAsLiteral>
            <gndo:geographicAreaCode rdf:resource="http://d-nb.info/standards/vocab/gnd/geographic-area-code#XA-DE" />
            <gndo:publication>Abgangsursachen bei Ferkeln und Sauen. - 1986 (Diss., Kiel)</gndo:publication>
            <gndo:placeOfBirth rdf:resource="http://d-nb.info/gnd/4050610-1" />
            <gndo:gender rdf:resource="http://d-nb.info/standards/vocab/gnd/Gender#male" />
            <gndo:dateOfBirth rdf:datatype="http://www.w3.org/2001/XMLSchema#gYear">1953</gndo:dateOfBirth>
  </rdf:Description>

I tried the following SPARQL (data is stored in Apache Jena TDB):

PREFIX gndo: <http://d-nb.info/standards/elementset/gnd#>
SELECT ?forename ?surname ?dateOfBirth ?placeOfBirth
WHERE {
  ?person a gndo:DifferentiatedPerson .
  ?person gndo:forename ?forename .
  ?person gndo:surname ?surname .
  ?person gndo:dateOfBirth ?dateOfBirth .
  ?person gndo:placeOfBirth ?placeOfBirth
}

returning no results. (As this is my first SPARQL query it might be totally wrong...)

1

There are 1 answers

0
UninformedUser On BEST ANSWER

Forename and surename are connected to persons via the property gndo:preferredNameEntityForThePerson and a blanknode, i.e. the query should be something like

PREFIX gndo: <http://d-nb.info/standards/elementset/gnd#>
SELECT ?forename ?surname ?dateOfBirth ?placeOfBirth
WHERE {
  ?person a gndo:DifferentiatedPerson ;
          gndo:dateOfBirth ?dateOfBirth ;
          gndo:placeOfBirth ?placeOfBirth ;
          gndo:preferredNameEntityForThePerson [
                                                gndo:forename ?forename ;
                                                gndo:surname ?surname 
                                               ]
}