Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.cyc.kb.client;
/*
* #%L
* File: StandardKbObject.java
* Project: KB Client
* %%
* Copyright (C) 2013 - 2017 Cycorp, Inc
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import com.cyc.base.cycobject.CycConstant;
import com.cyc.base.cycobject.CycObject;
import com.cyc.base.cycobject.Fort;
import com.cyc.base.cycobject.Nart;
import com.cyc.base.exception.CycApiException;
import com.cyc.base.exception.CycConnectionException;
import com.cyc.baseclient.cycobject.CycVariableImpl;
import com.cyc.baseclient.cycobject.DefaultCycObjectImpl;
import com.cyc.baseclient.cycobject.FormulaSentenceImpl;
import com.cyc.kb.KbObject;
import com.cyc.kb.KbStatus;
import com.cyc.kb.client.config.KbConfiguration;
import com.cyc.kb.exception.CreateException;
import com.cyc.kb.exception.InvalidNameException;
import com.cyc.kb.exception.KbObjectNotFoundException;
import com.cyc.kb.exception.KbRuntimeException;
import com.cyc.kb.exception.KbTypeConflictException;
import com.cyc.kb.exception.KbTypeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Abstract common supertype of several classes that share initialization code.
* The class and the methods of this class are not part of the KB API.
*
* @param type of CycObject core
*
* @author David Baxter
* @todo DaveS review Documentation
*/
abstract class StandardKbObject extends KbObjectImpl {
private static final Logger LOG = LoggerFactory.getLogger(StandardKbObject.class.getCanonicalName());
/**
* Not part of the KB API. This default constructor only has the effect of
* ensuring that there is access to a Cyc server.
*
*
* @throws KbRuntimeException if there is a problem connecting to Cyc.
*/
StandardKbObject() {
super();
}
// We will either use HLID or cycObjString. There is no point using both.
/*
* StandardKBObject(String cycObjStr, String hlid) throws KBApiException {
* super(cycObjStr, hlid); try { if (!isValidCore(core)) { String msg =
* "The term \"" + core.toString() + "\" is not a " + getTypeString() + ".";
* log.fine(msg); throw new KBTypeException(msg); } } catch (Exception ex) {
* throw new KBApiException(ex); } }
*/
/**
* This not part of the public, supported KB API. An implementation-dependent constructor.
*
* It is only called by the subclasses, when they need to build wrap an existing
* CycObject, usually as a result of a Query.
*
*
* @param cycObject the object to be wrapped
*
* @throws KbTypeException if the object (which already exists) is not of the
* appropriate type
*/
StandardKbObject(CycObject cycObject) throws KbTypeException {
this();
setCore(cycObject);
}
/* *
* !!!EXPERIMENTAL!!!
*
* @param nameOrId
* @param l
* @throws KbTypeException
* @throws CreateException
* /
StandardKbObject(String nameOrId, List