用于提取GND RDF / XML数据中所有“DifferentiatedPerson”的forename,surname,dateOfBirth和placeOfBirth的正确SPARQL查询是什么? (数据主页:http://www.dnb.de/DE/Service/DigitaleDienste/Datendienst/datendienst_node.html)
示例摘录数据:
<?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>
我尝试了以下SPARQL(数据存储在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
}
没有返回任何结果。 (因为这是我的第一个SPARQL查询,它可能完全错误......)
答案 0 :(得分:1)
Forename和surename通过属性gndo:preferredNameEntityForThePerson和blanknode连接到人,即查询应该类似
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
]
}