简体   繁体   中英

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.

For example, for #$AdultFemaleHuman , I want to get:

prettyString: "women", "female adults", "female adult", "adult females", "adult female", "ladies", "lady", "babes", "babe", "dames", "dame"

wordnet mapping: "synset-woman-noun-1"

But I can't find a way to retrieve it from the java API. I'd really appreciate if anyone can help. Or do I need to upgrade to researchCyc to get this done?

The APIs are the same for all platforms. Some API calls might return different values based on the KB content and the type of Cyc (OpenCyc vs ResearchCyc).

In your case, OpenCyc has the content.

We will release a new OpenCyc soon, that will work with our latest Java APIs. 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.

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:

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]

Please feel free to use http://dev.cyc.com/ for posting questions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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