當前位置: 首頁>>代碼示例>>Java>>正文


Java Node.equals方法代碼示例

本文整理匯總了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;
}
 
開發者ID:dice-group,項目名稱:RDF2PT,代碼行數:38,代碼來源:TripleConverterPortuguese.java

示例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;
}
 
開發者ID:dice-group,項目名稱:BENGAL,代碼行數:38,代碼來源:TripleConverter.java

示例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();
}
 
開發者ID:thesmartenergy,項目名稱:sparql-generate,代碼行數:11,代碼來源:SPARQLGenerateFormatterElement.java

示例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); 
}
 
開發者ID:afs,項目名稱:rdf-delta,代碼行數:4,代碼來源:Match.java


注:本文中的org.apache.jena.graph.Node.equals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。