gpt4 book ai didi

api - 如何反转MQL查询(对于freebase)?

转载 作者:行者123 更新时间:2023-12-03 07:54:18 25 4
gpt4 key购买 nike

我正在尝试列出特定ID的所有类型:

{
"id": "/en/sony",
"type": [{
"name": "Topic",
"id": null
}]
}

该查询给我以下结果:
http://tinyurl.com/lubavey
{
"result": {
"type": [
{
"id": "/common/topic",
"name": "Topic"
},
{
"id": "/base/audiobase/topic",
"name": "Topic"
},
{
"id": "/base/fblinux/topic",
"name": "Topic"
},
{
"id": "/base/digitalcameras/topic",
"name": "Topic"
},
{
"id": "/base/popstra/topic",
"name": "Topic"
},
{
"id": "/base/televisions/topic",
"name": "Topic"
},
{
"id": "/base/ps3games/topic",
"name": "Topic"
},
{
"id": "/base/filmcameras/topic",
"name": "Topic"
},
{
"id": "/m/04mny2g",
"name": "Topic"
}
],
"id": "/en/sony"
}
}

我想要完全相反的结果。我想要所有没有名称作为“主题”的类型。
我该如何实现?我尝试对属性 !使用 name运算符,该属性在MQL引用指南中建议,但给我错误:

"Can't use unqualified property names with ! reversing".



我该怎么做才能用 !消除此错误并获得相反的查询结果?

最佳答案

尝试!=:

{
"id": "/en/sony",
"type": [{
"name!=": "Topic",
"id": null
}]
}

The != operator says that the constrained property can be anything but the specified value. (It does require that the property be something, however: it does not match object for which the property is null.)



在此处阅读有关 !=运算符的更多信息: http://wiki.freebase.com/wiki/MQL_operators#The_.22but_not.22_Operator_.21.3D

关于api - 如何反转MQL查询(对于freebase)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29197495/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com