当前位置: 首页>>代码示例>>Java>>正文


Java OWLEntity.isOWLObjectProperty方法代码示例

本文整理汇总了Java中org.semanticweb.owlapi.model.OWLEntity.isOWLObjectProperty方法的典型用法代码示例。如果您正苦于以下问题:Java OWLEntity.isOWLObjectProperty方法的具体用法?Java OWLEntity.isOWLObjectProperty怎么用?Java OWLEntity.isOWLObjectProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.semanticweb.owlapi.model.OWLEntity的用法示例。


在下文中一共展示了OWLEntity.isOWLObjectProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import org.semanticweb.owlapi.model.OWLEntity; //导入方法依赖的package包/类
@Override
public Set<ComplexIntegerAxiom> visit(OWLDeclarationAxiom axiom) {
	Objects.requireNonNull(axiom);
	OWLEntity entity = axiom.getEntity();
	if (entity.isOWLClass()) {
		return declare(entity.asOWLClass(), axiom.getAnnotations());

	} else if (entity.isOWLObjectProperty()) {
		return declare(entity.asOWLObjectProperty(), axiom.getAnnotations());

	} else if (entity.isOWLNamedIndividual()) {
		return declare(entity.asOWLNamedIndividual(), axiom.getAnnotations());

	} else if (entity.isOWLDataProperty()) {
		return declare(entity.asOWLDataProperty(), axiom.getAnnotations());

	} else if (entity.isOWLAnnotationProperty()) {
		// FIXME add annotation property
		return Collections.emptySet();

	} else {
		throw TranslationException.newUnsupportedAxiomException(axiom);

	}
}
 
开发者ID:julianmendez,项目名称:jcel,代码行数:26,代码来源:AxiomTranslator.java

示例2: extract

import org.semanticweb.owlapi.model.OWLEntity; //导入方法依赖的package包/类
/**
 * Extracts {@link PredicateVariableExtractor} rules.
 * 
 * @param ot ontology
 * @return extracted rules
 */
@Override
public List<Rule> extract(OWLOntology ot) {
	List<Rule> list = new ArrayList<>();
	// list of predicates in ontology
	List<String> ps = new ArrayList<>();
	ps.add(TOPOBJ);
	ps.add(TOPDATA);
	OWLEntity e;
	String op;
	// check all declarations
	for (OWLDeclarationAxiom a : ot.getAxioms(AxiomType.DECLARATION)) {
		e = a.getEntity();
		if (e.isOWLObjectProperty()) {
			// if it is a object property declaration, add it to the list
			// and also add it as subproperty of owl:topObjectProperty
			op = getString(e.asOWLObjectProperty());
			ps.add(op);
			list.add(new SubPropertyOf(op, TOPOBJ));
		} else if (e.isOWLDataProperty()) {
			// if it is a data property declaration, add it to the list
			// and also add it as subproperty of owl:topDataProperty
			op = getString(e.asOWLDataProperty());
			ps.add(op);
			list.add(new SubPropertyOf(op, TOPDATA));
		}
	}
	list.add(new PredicateVariable(ps));
	return list;
}
 
开发者ID:lszeremeta,项目名称:neo4j-sparql-extension-yars,代码行数:36,代码来源:PredicateVariableExtractor.java


注:本文中的org.semanticweb.owlapi.model.OWLEntity.isOWLObjectProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。