0
我想找到IBM的首席執行官。這將是什麼MQL查詢?這個freebase MQL查詢會是什麼?
我想找到IBM的首席執行官。這將是什麼MQL查詢?這個freebase MQL查詢會是什麼?
此搜索的MQL如下所示。
這個特定的實例可能比所需的要複雜得多,因爲我最初從Freebase交互式搜索中獲得它,然後手動添加/改進過濾器。
我用相對成功的各種公司名稱對其進行了驗證,即它的工作原理是基礎數據在Freebase中正確編碼(某些公司缺失,某些公司領導數據不完整等)
有幾個技巧此查詢:
u0
fitler公司名稱需要精確匹配的公司名稱記錄在遊離鹼。你可以使用一個contains
謂詞而不是一個equal
,但這可能會引入許多不相關的命中。例如,您需要使用「IBM」,「Apple Inc.」,「通用汽車」而不是這些名稱的普通替代品(「國際商業機器」,「Apple」,「GM」...)u1
過濾器,在領導作用是在廣泛One of
謂語表示,因爲不幸的是,這些角色的命名是相對寬鬆的,有重複(如可能是CEO
或Chief Executive Officer
),並用事實CEO的角色常常與其他企業角色,如董事會主席和/或總裁等。我首先查找(在Freebase中)包含「首席執行官」或「首席執行官」的領導角色實例,從而挑選出此列表。u2
過濾器表示to
日期應該是空的,以便只選擇當前在職的人,而不是前任首席執行官(希望Freebase記錄其任職結束日期)。根據您的應用程序,您可能需要測試查詢是否返回一條記錄,如果沒有,則會進行相應的修改。
Freebase MQL editor是一個方便的工具測試和編輯這種查詢。
[
{
"from": null,
"id": null,
"limit": 20,
"organization": {
"id": null,
"name": null,
"optional": true
},
"person": {
"id": null,
"name": null,
"optional": true
},
"role": {
"id": null,
"name": null,
"optional": true
},
"s0:type": [
{
"id": "/organization/leadership",
"link": [
{
"timestamp": [
{
"optional": true,
"type": "/type/datetime",
"value": null
}
],
"type": "/type/link"
}
],
"type": "/type/type"
}
],
"sort": "s0:type.link.timestamp.value",
"title": null,
"to": null,
"type": "/organization/leadership",
"u0:organization": [
{
"id": null,
"name": "IBM",
"type": "/organization/organization"
}
],
"u1:role": [
{
"id": null,
"name|=": ["Chief Executive Officer", "President and CEO", "Chairman and CEO", "Interim CEO", "Interim Chief Executive Officer", "Founder and CEO", "Chairman, President and CEO", "Managing Director and CEO", "Executive Vice President and Chief Operating Officer", "Co-Founder, Chairman and Chief Executive Officer"],
"type": "/organization/role"
}
],
"u2:to": [
{
"value": null,
"optional": "forbidden"
}
]
}
]
取樣返回(對於 「IBM」,特別是)
{
"code": "/api/status/ok",
"result": [{
"from": "2012-01-01",
"id": "/m/09t7b08",
"organization": {
"id": "/en/ibm",
"name": "IBM"
},
"person": {
"id": "/en/virginia_m_rometty",
"name": "Virginia M. Rometty"
},
"role": {
"id": "/en/chairman_president_and_ceo",
"name": "Chairman, President and CEO"
},
"s0:type": [{
"id": "/organization/leadership",
"link": [{
"timestamp": [{
"type": "/type/datetime",
"value": "2010-01-23T08:02:57.0006Z"
}],
"type": "/type/link"
}],
"type": "/type/type"
}],
"title": "Chairman, President and CEO",
"to": null,
"type": "/organization/leadership",
"u0:organization": [{
"id": "/en/ibm",
"name": "IBM",
"type": "/organization/organization"
}],
"u1:role": [{
"id": "/en/chairman_president_and_ceo",
"type": "/organization/role"
}],
"u2:to": []
}
輝煌!我沒有別的話要說。 –