Hello Worlds
In November 2009, I made a post on Cycorp's Blog that showed a minimal example of Cyc API usage with Research Cyc. In a reference to the long tradition of minimal code examples called HelloWorld, the code is called "Hello Worlds" and it does what you might expect. It's now six years later, and a colleague at Lucid.ai wanted some simple "getting started code", so I updated it to use the latest RC5 Cyc Public API.
Here's the gist of it:
KbCollection planetInTheSolarSystem =
KbCollectionFactory.get("PlanetInTheSolarSystem");
Set<KbIndividual> planets =
(Set<KbIndividual>) planetInTheSolarSystem.getInstances();
for (KbIndividual planet : planets) {
System.out.println("Hello '" + planet.toString() + "'.");
}
And here's the github gist of it, all 33 lines.
Here's the output:
Hello 'PlanetMars'.
Hello 'PlanetVenus'.
Hello 'PlanetJupiter'.
Hello 'PlanetEarth'.
Hello 'PlanetNeptune'.
Hello 'PlanetMercury'.
Hello 'PlanetUranus'.
Hello 'PlanetSaturn'.
You'll need the maven dependencies at: http://dev.cyc.com/api/core/download/index.html
and you'll need a copy of Research Cyc licensed by Cycorp.
What's Before Science. What Happened If we convey our massages without any COMMUNICATIONS TOOL ?????