public static final void exampleContantsManipulations() {
    System.out.println("Starting Cyc constant manipulation examples.");
    try {
      CycConstant cycAdministrator = access.getKnownConstantByName("CycAdministrator");
      CycConstant generalCycKE = access.getKnownConstantByName("GeneralCycKE");
      access.setCyclist(cycAdministrator); // needed to maintain bookeeping information
      access.setKePurpose(generalCycKE); // needed to maintain bookeeping information

      // obtaining a constant from its external ID (preferred mechanism for lookup)
      CycConstant dog = (CycConstant) DefaultCycObject.fromCompactExternalId("Mx4rvVjaoJwpEbGdrcN5Y29ycA", access);

      // obtaining an external id from a CycObject
      String externalId = DefaultCycObject.toCompactExternalId(dog, access);

      // obtaining a constant from its name
      // Note: not preferred, because constant names can change in the KB
      // which would require all the code references to be modified to
      // maintain correct behavior
      CycConstant dog2 = access.getKnownConstantByName("Dog");

      // obtain comments for a CycConstant
      String comment = access.getComment(dog);
      System.out.println("Got comments for constant Dog:\n" + comment);

      // creating a constant
      CycConstant newTypeOfDog = access.findOrCreate("NewTypeOfDog");

      // asserting the isa and genls relations
      // every new term should have at least 1 isa assertion made on it
      access.assertIsa(newTypeOfDog, CycAccess.collection, CycAccess.baseKB);
      // every new collection should have at least 1 genls assertion made on it
      access.assertGenls(newTypeOfDog, dog, CycAccess.baseKB);

      // verify genls relation
      assert access.isSpecOf(newTypeOfDog, dog, CycAccess.baseKB) : "Good grief! Our new type of dog isn't known to be a type of dog.";

      // find everything that is a dog
      System.out.println("Got instances of Dog: " + access.getAllInstances(dog, CycAccess.baseKB));

      // find everything that a dog is a type of
      System.out.println("Got generalizations of Dog: " + access.getAllGenls(dog, CycAccess.baseKB));

      // find everything that is a type of dog
      System.out.println("Got specializations of Dog: " + access.getAllSpecs(dog, CycAccess.baseKB));

      // generating NL
      String dogNl = access.getGeneratedPhrase(dog);
      System.out.println("The concept " + dog.cyclify()
              + " can be referred to in English as '" + dogNl + "'.");

      // Killing a constant -- removing a constant and all assertions involving that constant
      // Warning: you can potentially do serious harm to the KB if you remove critical information
      access.kill(newTypeOfDog);

    } catch (UnknownHostException nohost) {
      nohost.printStackTrace();
    } catch (IOException io) {
      io.printStackTrace();
    } catch (CycApiException cyc_e) {
      cyc_e.printStackTrace();
    }
    System.out.println("Finished.");
  }