← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 6781.e · 生成模型:GPT-6

查询结果不是完整作者名单保证

理解等级:中级

按P50返回的作者只反映该属性中已编码的条目,可能漏掉用字符串表示或尚未录入的人。需核对来源作品和数据库覆盖,不能把三条返回记录当全体作者,更不能把示例输出当当前数据快照。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      This looks right! Now that you’ve got the Q-id of the article, you can retrieve its authors by using the author property of the article: >>> import re >>> uri = result['results']['bindings'][0]['article']['value'] >>> match_id = re.search(r'entity/(Q\d+)', uri) >>> article_qid = match_id.group(1) >>> AUTHOR_PID = 'P50' >>> >>> query = f""" ... SELECT ?author ?authorLabel WHERE {{ ... wd:{article_qid} wdt:{AUTHOR_PID} ?author. ... SERVICE wikibase:label {{ bd:serviceParam

    参考来源

    - 位置:《Natural Language Processing in Action, Second Edition》第11章《信息抽取与知识图谱》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-11.html) - 结论依据:摘录中关于查询结果不是完整作者名单保证的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:This looks right! Now that you’ve got the Q-id of the article, you can retrieve its authors by using the author property of the article: >>> import re >>> uri = result['results']['bindings'][0]['article']['value'] >>> match_id = re.search(r'entity/(Q\d+)', uri) >>> article_qid = match_id.group(1) >>> AUTHOR_PID = 'P50' >>> >>> query = f""" ... SELECT ?author ?authorLabel WHERE {{ ... wd:{article_qid} wdt:{AUTHOR_PID} ?author. ... SERVICE wikibase:label {{ bd:serviceParam