下载维基数据单一实体-truthy [英] Download Wikidata single entity - truthy
问题描述
我想为单个实体下载维基数据.我知道我可以使用 URL 来实现,例如:
I would like to download Wikidata for a single entity. I know I can achieve using the URL, for example:
https://www.wikidata.org/wiki/Special:EntityData/Q42.rdf
将以 RDF 格式为我提供 Douglas Adams 的 Wikidata.
Will give me Wikidata for Douglas Adams in RDF format.
但这个数据是完整的,意味着完整的元数据,如限定符和引用.我只对原始数据感兴趣.
But this data is fully, meaning complete with meta-data such as qualifiers and references. I am interested in primary data only.
实际上我正在研究 RDF Reification,为此我需要一些示例非 RDF 数据,我可以在上面测试我的程序(如真实的 Wikidata).
Actually I am working on RDF Reification, and for that I need some sample non-RDF data which I can test my program on (like truthy Wikidata).
我不想下载整个 Wikidata 转储(我知道它们以真实格式提供).
I do not wish to download entire Wikidata dumps (Which I know are available in truthy format).
推荐答案
.ttl?flavor=simple
也产生了许多看起来像这样的附加链接:
.ttl?flavor=simple
produces also many sitelinks which look like this:
<https://ru.wikipedia.org/wiki/Адамс,_Дуглас> a schema:Article ;
schema:about wd:Q42 ;
schema:inLanguage "ru" ;
schema:isPartOf <https://ru.wikipedia.org/> ;
schema:name "Адамс, Дуглас"@ru .
<https://ru.wikipedia.org/> wikibase:wikiGroup "wikipedia" .
如果你想摆脱它们,你可以手动CONSTRUCT
你想要什么,如下所述.
If you want to get rid of them, you can manually CONSTRUCT
what you want as described below.
不要忘记发送Accept: text/turtle
.
真实的陈述,没有外部词汇的属性
CONSTRUCT {?s ?p ?o} WHERE {
VALUES (?s) {(wd:Q42)}
?s ?p ?o .
[] wikibase:directClaim ?p
}
真实陈述,具有来自外部词汇表的属性
CONSTRUCT {?s ?p ?o} WHERE {
VALUES (?s) {(wd:Q42)}
?s ?p ?o .
FILTER NOT EXISTS { [] wikibase:claim|wikibase:directClaimNormalized ?p }
}
这篇关于下载维基数据单一实体-truthy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!