📄 racerclient.java
字号:
not an array of array of strings. In order to know the equivalent set of concepts for a given
concept, the conceptSynonyms method can be used.
* @param cn java.lang.String the concept name
* @param tbox java.lang.String The tbox
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public String[] conceptDescendants(String c, String tbox) throws RacerException, IOException {
if (termParser!=null) termParser.parseConcept(c);
String res=send("(concept-descendants "+c+" "+tbox+")",true);
return parseConceptSetList(res);
}
/** This method refers to the concept-disjoint? RACER macro, in which the current tbox is used.
* @return boolean true if c1 and c2 are disjoint and false otherwise.
* @param c1 java.lang.String one concept term.
* @param c2 java.lang.String the other concept term.
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public boolean conceptDisjointP(String c1, String c2) throws java.io.IOException, RacerException {
if (termParser!=null) termParser.parseConcept(c1);
if (termParser!=null) termParser.parseConcept(c2);
String res=send("(concept-disjoint? "+c1+" "+c2+")",true);
return parseBoolean(res);
}
/** This method refers to the RACER concept-disjoint-p function.
* @return boolean true if c1 and c2 are disjoint in tbox; and false otherwise.
* @param c1 java.lang.String one concept term.
* @param c2 java.lang.String the other concept term.
* @param tbox java.lang.String The tbox name.
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public boolean conceptDisjointP(String c1, String c2, String tbox) throws java.io.IOException, RacerException {
if (termParser!=null) termParser.parseConcept(c1);
if (termParser!=null) termParser.parseConcept(c2);
String res=send("(concept-disjoint-p "+c1+" "+c2+" "+tbox+")",true);
return parseBoolean(res);
}
/** This method refers to the concept-equivalent? RACER macro, in which the current tbox is used.
* @return boolean true if c1 equivalent to c2 and false otherwise.
* @param c1 java.lang.String one concept term.
* @param c2 java.lang.String the other concept term.
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public boolean conceptEquivalentP(String c1, String c2) throws java.io.IOException, RacerException {
if (termParser!=null) termParser.parseConcept(c1);
if (termParser!=null) termParser.parseConcept(c2);
String res=send("(concept-equivalent? "+c1+" "+c2+")",true);
return parseBoolean(res);
}
/** This method refers to the RACER concept-equivalent-p function.
* @return boolean true if c1 is equivalent to c2 in tbox; and false otherwise.
* @param c1 java.lang.String one concept term.
* @param c2 java.lang.String the other concept term.
* @param tbox java.lang.String The tbox name.
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public boolean conceptEquivalentP(String c1, String c2, String tbox) throws java.io.IOException, RacerException {
if (termParser!=null) termParser.parseConcept(c1);
if (termParser!=null) termParser.parseConcept(c2);
String res=send("(concept-equivalent-p "+c1+" "+c2+" "+tbox+")",true);
return parseBoolean(res);
}
/** This method refers to the RACER concept-instances macro.
* @return java.lang.String[] A list of individual names.
* @param c java.lang.String The concept term.
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public String[] conceptInstances(String c) throws java.io.IOException, RacerException {
if (termParser!=null) termParser.parseConcept(c);
String res=send("(concept-instances "+c+")",true);
return parseList(res);
}
/** This method refers to the RACER concept-instances macro.
* @return java.lang.String[] A list of concept names (one concept name for every concept equivalence
set returned by RACER).
* @param c java.lang.String the concept term.
* @param abox java.lang.String The abox name.
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public String[] conceptInstances(String c,String abox) throws java.io.IOException, RacerException {
if (termParser!=null) termParser.parseConcept(c);
String res=send("(concept-instances "+c+" "+abox+")",true);
return parseList(res);
}
/** This method refers to the concept-is-primitive-p RACER macro. The current tbox is used.
* @return boolean true if the concept is satisfiable and false otherwise.
* @param c java.lang.String The concept term.
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public boolean conceptIsPrimitiveP(String c) throws java.io.IOException, RacerException {
if (termParser!=null) termParser.parseConcept(c);
String res=send("(concept-is-primitive-p "+c+")",true);
return parseBoolean(res);
}
/** This method refers to the RACER concept-is-primitive-p function.
* @return boolean True if the concept is a primitive one and false otherwise.
* @param c java.lang.String the concept name
* @param tbox java.lang.String The tbox
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public boolean conceptIsPrimitiveP(String c, String tbox) throws RacerException, IOException {
if (termParser!=null) termParser.parseConcept(c);
String res=send("(concept-is-primitive-p "+c+" "+tbox+")",true);
return parseBoolean(res);
}
/** This method refers to the concept-p RACER macro. The current tbox is used.
* @return boolean true if the concept is satisfiable and false otherwise.
* @param c java.lang.String The concept term.
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public boolean conceptP(String c) throws java.io.IOException, RacerException {
if (termParser!=null) termParser.parseConcept(c);
String res=send("(concept-p "+c+")",true);
return parseBoolean(res);
}
/** This method refers to the RACER concept-p function.
* @return boolean
* @param c java.lang.String
* @param tbox java.lang.String
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public boolean conceptP(String c, String tbox) throws RacerException, IOException {
if (termParser!=null) termParser.parseConcept(c);
String res=send("(concept-p "+c+" "+tbox+")",true);
return parseBoolean(res);
}
/** This method refers to the RACER concept-parents macro using the current TBox.
* @return String[] an array of strings containing all the atomic concept parents of a concept
in the tbox. For every equivalence concept set returned by RACER, only the first concept (taken
as the representative of the class) is returned. This is done in order to return a String[] and
not an array of array of strings. In order to know the equivalent set of concepts for a given
concept, the conceptSynonyms method can be used.
* @param cn java.lang.String the concept name
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public String[] conceptParents(String cn) throws RacerException, IOException {
if (termParser!=null) termParser.parseConcept(cn);
String res=send("(concept-parents "+cn+")",true);
return parseConceptSetList(res);
}
/** This method refers to the RACER concept-parents macro using the current TBox.
* @return String[] an array of strings containing all the atomic concept parents of a concept
in the tbox. For every equivalence concept set returned by RACER, only the first concept (taken
as the representative of the class) is returned. This is done in order to return a String[] and
not an array of array of strings. In order to know the equivalent set of concepts for a given
concept, the conceptSynonyms method can be used.
* @param cn java.lang.String the concept name
* @param tbox java.lang.String The tbox
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public String[] conceptParents(String c, String tbox) throws RacerException, IOException {
if (termParser!=null) termParser.parseConcept(c);
String res=send("(concept-parents "+c+" "+tbox+")",true);
return parseConceptSetList(res);
}
/** This method refers to the concept-satisfiable? RACER macro. The current tbox is used.
* @return boolean true if the concept is satisfiable and false otherwise.
* @param c java.lang.String The concept term.
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public boolean conceptSatisfiableP(String c) throws java.io.IOException, RacerException {
if (termParser!=null) termParser.parseConcept(c);
// RC20020321 Added Closing Bracket!
System.out.println("test1:"+send("(instance i c)"));
System.out.println("test2:"+send("(time (retrieve (?x) (?x c)))"));
String res=send("(time (concept-satisfiable? "+c+"))",true);
return parseBoolean(res);
}
/** This method refers to the RACER concept-satisfiable-p function.
* @return boolean true if the concept is satisfiable and false otherwise.
* @param c java.lang.String the concept.
* @param tbox java.lang.String the tbox name.
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public boolean conceptSatisfiableP(String c, String tbox) throws RacerException, IOException {
if (termParser!=null) termParser.parseConcept(c);
String res=send("(time (concept-satisfiable-p "+c+" "+tbox+"))",true);
return parseBoolean(res);
}
/** This method refers to the concept-subsumes? RACER macro, in which the current tbox is used.
* @return boolean true if c1 subsumes c2 and false otherwise.
* @param c1 java.lang.String concept term for the subsumer.
* @param c2 java.lang.String concept term for the subsumee.
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public boolean conceptSubsumesP(String c1, String c2) throws java.io.IOException, RacerException {
if (termParser!=null) termParser.parseConcept(c1);
if (termParser!=null) termParser.parseConcept(c2);
String res=send("(concept-subsumes? "+c1+" "+c2+")",true);
return parseBoolean(res);
}
/** This method refers to the RACER concept-subsumes-p function.
* @return boolean true if c1 subsumes c2 in tbox; and false otherwise.
* @param c1 java.lang.String the subsumer concept term.
* @param c2 java.lang.String the subsumee concept term.
* @param tbox java.lang.String The tbox name.
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public boolean conceptSubsumesP(String c1, String c2, String tbox) throws java.io.IOException, RacerException {
if (termParser!=null) termParser.parseConcept(c1);
if (termParser!=null) termParser.parseConcept(c2);
String res=send("(concept-subsumes-p "+c1+" "+c2+" "+tbox+")",true);
return parseBoolean(res);
}
/** This method refers to the RACER concept-synonyms macro using the current TBox.
* @return String[] an array of strings containing the concept synonyms for cn.
* @param cn java.lang.String the concept name
* @exception java.io.IOException Thrown when there is a communication problem with the RACER server.
* @exception dl.racer.RacerException Thrown when the RACER server produces an ":error" message.
*/
public String[] conceptSynonyms(String c) throws RacerException, IOException {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -