0

英語とヘブライ語の名前のリストを含む CSV ファイルがあり、情報を取得する必要があります。

必要なデータは「名前 - ヘブライ名 - 英語 DBpedia - URL 日付 生年月日 生年月日 死亡場所 死のエントリ_where_found」

人ごとに、DBpedia または wiki データで情報が見つかった場合、「entry_where_found」が返されるはずです。

私は次のようなことを考えました:

PREFIX wd: <http://www.wikidata.org/entity/> 
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX dbo: <http://dbpedia.org/ontology/> 

SELECT ?person WHERE { 
  SERVICE <http://dbpedia.org/sparql> {?person a dbo:Person }
  SERVICE <https://query.wikidata.org/sparql> { ?person wdt:P31 wd:Q5 }
}

DBpedia と wikidata の両方をクエリするには、次のようにします。

SELECT ?instance_of ?label_he ?label_en ?place_of_birthLabel ?date_of_birth ?place_of_death ?place_of_deathLabel ?date_of_death ?URL WHERE {
  ?instance_of rdfs:label ?label_he.
  ?instance_of rdfs:label ?label_en.
  ?instance_of wdt:P31 wd:Q5.
  ?instance_of wdt:P19 ?place_of_birth.
  ?instance_of wdt:P569 ?date_of_birth.
  ?instance_of wdt:P20 ?place_of_death.
  ?instance_of wdt:P570 ?date_of_death.
  OPTIONAL { ?instance_of wdt:P31 ?record_label. }
  OPTIONAL { ?instance_of wdt:P31 ?instance_of. }
  OPTIONAL { ?instance_of wdt:P2699 ?URL. }
  FILTER(((LANG(?label_he)) = "he") && ((LANG(?label_en)) = "en"))
}

しかし、毎回検索する特定の名前を追加する方法と、クエリを最初のコードと組み合わせる方法がわかりません。

誰か助けてくれませんか?ありがとう!

4

0 に答える 0