简体   繁体   English

OpenCyc中的WordNet映射和prettyStrings-从GAF获取信息

[英]WordNet mappings and prettyStrings in OpenCyc - getting information from GAFs

I'm just wondering how I can get the wordnet mappings and prettyString from openCyc java API. 我只是想知道如何从openCyc java API获取wordnet映射和prettyString。

For example, for #$AdultFemaleHuman , I want to get: 例如,对于#$AdultFemaleHuman ,我想要获得:

prettyString: "women", "female adults", "female adult", "adult females", "adult female", "ladies", "lady", "babes", "babe", "dames", "dame" prettyString:“妇女”,“成年女性”,“成年女性”,“成年女性”,“成年女性”,“女士”,“女士”,“婴儿”,“婴儿”,“女士”,“贵妇”

wordnet mapping: "synset-woman-noun-1" wordnet映射:“ synset-woman-noun-1”

But I can't find a way to retrieve it from the java API. 但是我找不到从Java API检索它的方法。 I'd really appreciate if anyone can help. 如果有人可以提供帮助,我将不胜感激。 Or do I need to upgrade to researchCyc to get this done? 还是我需要升级到researchCyc才能完成此工作?

The APIs are the same for all platforms. 所有平台的API均相同。 Some API calls might return different values based on the KB content and the type of Cyc (OpenCyc vs ResearchCyc). 某些API调用可能会根据KB内容和Cyc的类型(OpenCyc与ResearchCyc)返回不同的值。

In your case, OpenCyc has the content. 就您而言,OpenCyc具有内容。

We will release a new OpenCyc soon, that will work with our latest Java APIs. 我们即将发布新的OpenCyc,它将与我们最新的Java API一起使用。 The APIs themselves can be found here: http://dev.cyc.com/ Since the OpenCyc you have works with older version of Java API, I will provide example using that, but please upgrade to new APIs when they are available, since we will not be supporting older APIs after the OpenCyc release. 可以在以下位置找到API本身: http : //dev.cyc.com/由于您使用的是OpenCyc,因此可以使用较旧版本的Java API,因此,我将提供使用它的示例,但是请在可用时升级到新API,因为OpenCyc版本发布后,我们将不再支持较旧的API。

CycAccess cyc = <SET YOUR="" CYC="" ACCESS="">;
CycConstant prettyStr = cyc.getLookupTool().find("prettyString");
CycConstant adultFem = cyc.getLookupTool().find("UnixOS");
List<Object> strings = cyc.getLookupTool().getArg2s(prettyStr, adultFem); 
System.out.println("Pretty strings: " + strings);

In the new APIs, you would do the following: 在新的API中,您将执行以下操作:

KBPredicate prettyStr = KBPredicateImpl.get("prettyString");
KBCollection col = KBCollectionImpl.get("UnixOS");
Collection<String> strs = col.<String>getValues(prettyStr, 1, 2, ContextImpl.get("EnglishMt"));
System.out.println("Strings: " + strs);

Strings: [UNIX operating system] 字符串:[UNIX操作系统]

Please feel free to use http://dev.cyc.com/ for posting questions. 请随时使用http://dev.cyc.com/发表问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM