我正在尝试使用 SPARQL 查询维基词典以获取所有属于某种语言(例如德语)的名词的术语并作为输出:
- 名词的字符串
- 语法性别(属):男、女、中性
我正在使用 SPARQL-Endpoint:http ://wiktionary.dbpedia.org/sparql ,我找到了一个示例,但我不知道如何调整它以获得我想要的信息。
PREFIX terms:<http://wiktionary.dbpedia.org/terms/>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX dc:<http://purl.org/dc/elements/1.1/>
SELECT ?sword ?slang ?spos ?ssense ?twordRes ?tword ?tlang
FROM <http://wiktionary.dbpedia.org>
WHERE {
?swordRes terms:hasTranslation ?twordRes .
?swordRes rdfs:label ?sword .
?swordRes dc:language ?slang .
?swordRes terms:hasPoS ?spos .
OPTIONAL { ?swordRes terms:hasMeaning ?ssense . }
OPTIONAL {
?twordBaseRes terms:hasLangUsage ?twordRes .
?twordBaseRes rdfs:label ?tword .
}
OPTIONAL { ?twordRes dc:language ?tlang . }
}