作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我可以通过标签获取项目及其属性:
SELECT distinct ?item ?itemLabel ?itemDescription
(SAMPLE(?DR) as ?DR) (SAMPLE(?article)as ?article)
WHERE {
?item wdt:P31 wd:Q5.
?item ?label "Einstein"@en
OPTIONAL{?item wdt:P569 ?DR .}
?article schema:about ?item .
?article schema:inLanguage "en" .
?article schema:isPartOf <https://en.wikipedia.org/>.
OPTIONAL{?item wdt:P570 ?RIP .}
OPTIONAL{?item wdt:P18 ?image .}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?item ?itemLabel ?itemDescription
我如何使用 QID 而不是标签来做同样的事情?
最佳答案
使用 URI 而不是变量 ?item
将获取基于实体 Albert Einstein 的信息:
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
SELECT DISTINCT ?item ?itemLabel ?itemDescription (SAMPLE(?DR) AS ?DRSample) (SAMPLE(?article) AS ?articleSample)
WHERE
{ ?article schema:about ?item ;
schema:inLanguage "en" ;
schema:isPartOf <https://en.wikipedia.org/>
FILTER ( ?item = <http://www.wikidata.org/entity/Q937> )
OPTIONAL
{ ?item wdt:P569 ?DR }
OPTIONAL
{ ?item wdt:P570 ?RIP }
OPTIONAL
{ ?item wdt:P18 ?image }
SERVICE wikibase:label
{ bd:serviceParam
wikibase:language "en"
}
}
GROUP BY ?item ?itemLabel ?itemDescription
关于sparql - 通过 QID 获取属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41527706/
我可以通过标签获取项目及其属性: SELECT distinct ?item ?itemLabel ?itemDescription (SAMPLE(?DR) as ?DR) (SAMPLE(?a
我想每次加载不同的问题。我尝试了以下代码,但它仅随机更改第一个问题。所有其他问题都按顺序排列。 QuizHelper db = new QuizHelper(this); // my questio
有谁知道在 LimeSurvey 中复制调查时防止 QID 发生变化的方法。我正在将调查从开发服务器复制到生产服务器,并编辑了模板 css 以执行许多特定操作。例如,我有针对特定问题 ID (QID)
以下描述是一个带有问题和答案的简单示例。但我的网站的逻辑是相似的。 假设表格是: USERS table: USER_ID, etc QUESTIONS table: QUESTION_ID, TEX
我是一名优秀的程序员,十分优秀!