当前位置: 首页>>代码示例>>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;未经允许,请勿转载。