本文整理匯總了Java中org.apache.jena.graph.Node.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java Node.equals方法的具體用法?Java Node.equals怎麽用?Java Node.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.jena.graph.Node
的用法示例。
在下文中一共展示了Node.equals方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processClassNode
import org.apache.jena.graph.Node; //導入方法依賴的package包/類
/**
* Converts the node that is supposed to represent a class in the knowledge
* base into an NL phrase.
*
* @param node
* the node
* @param plural
* whether the plural form should be used
* @return the NL phrase
*/
public NPPhraseSpec processClassNode(Node node, boolean plural) {
NPPhraseSpec object;
if (node.equals(OWL.Thing.asNode())) {
object = nlgFactory.createNounPhrase(GenericType.ENTITY.getNlr());
} else if (node.equals(RDFS.Literal.asNode())) {
object = nlgFactory.createNounPhrase(GenericType.VALUE.getNlr());
} else if (node.equals(RDF.Property.asNode())) {
object = nlgFactory.createNounPhrase(GenericType.RELATION.getNlr());
} else if (node.equals(RDF.type.asNode())) {
object = nlgFactory.createNounPhrase(GenericType.TYPE.getNlr());
} else {
String label = uriConverter.convert(node.getURI());
if (label != null) {
// get the singular form
// label = PlingStemmer.stem(label);
// we assume that classes are always used in lower case format
label = label.toLowerCase();
object = nlgFactory.createNounPhrase(nlgFactory.createWord(label, LexicalCategory.NOUN));
} else {
object = nlgFactory.createNounPhrase(GenericType.ENTITY.getNlr());
}
}
// set plural form
object.setPlural(plural);
return object;
}
示例2: processClassNode
import org.apache.jena.graph.Node; //導入方法依賴的package包/類
/**
* Converts the node that is supposed to represent a class in the knowledge
* base into an NL phrase.
*
* @param node
* the node
* @param plural
* whether the plural form should be used
* @return the NL phrase
*/
public NPPhraseSpec processClassNode(Node node, boolean plural) {
NPPhraseSpec object;
if (node.equals(OWL.Thing.asNode())) {
object = nlgFactory.createNounPhrase(GenericType.ENTITY.getNlr());
} else if (node.equals(RDFS.Literal.asNode())) {
object = nlgFactory.createNounPhrase(GenericType.VALUE.getNlr());
} else if (node.equals(RDF.Property.asNode())) {
object = nlgFactory.createNounPhrase(GenericType.RELATION.getNlr());
} else if (node.equals(RDF.type.asNode())) {
object = nlgFactory.createNounPhrase(GenericType.TYPE.getNlr());
} else {
String label = uriConverter.convert(node.getURI());
if (label != null) {
// get the singular form
label = PlingStemmer.stem(label);
// we assume that classes are always used in lower case format
label = label.toLowerCase();
object = nlgFactory.createNounPhrase(nlgFactory.createInflectedWord(label, LexicalCategory.NOUN));
} else {
object = nlgFactory.createNounPhrase(GenericType.ENTITY.getNlr());
}
}
// set plural form
object.setPlural(plural);
return object;
}
示例3: printProperty
import org.apache.jena.graph.Node; //導入方法依賴的package包/類
private int printProperty(Node p) {
String str = slotToString(p);
if (p.equals(RDF.Nodes.type) && str.equals(RDFTYPE)) {
out.print("a");
} else {
out.print(str);
}
out.pad(predicateWidth);
return str.length();
}
示例4: match
import org.apache.jena.graph.Node; //導入方法依賴的package包/類
public static boolean match(Node node, Node pattern) {
return pattern == null || pattern == Node.ANY || pattern.equals(node);
}