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


Java OWLDataFactory.getOWLTopDataProperty方法代碼示例

本文整理匯總了Java中org.semanticweb.owlapi.model.OWLDataFactory.getOWLTopDataProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java OWLDataFactory.getOWLTopDataProperty方法的具體用法?Java OWLDataFactory.getOWLTopDataProperty怎麽用?Java OWLDataFactory.getOWLTopDataProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.semanticweb.owlapi.model.OWLDataFactory的用法示例。


在下文中一共展示了OWLDataFactory.getOWLTopDataProperty方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: TranslationRepository

import org.semanticweb.owlapi.model.OWLDataFactory; //導入方法依賴的package包/類
/**
 * Constructs a new translation repository.
 * 
 * @param dataFactory
 *            OWL ontology
 * @param manager
 *            entity manager
 */
public TranslationRepository(OWLDataFactory dataFactory, IntegerEntityManager manager) {
	Objects.requireNonNull(dataFactory);
	Objects.requireNonNull(manager);
	this.entityManager = manager;

	this.bottomClass = dataFactory.getOWLNothing();
	this.topClass = dataFactory.getOWLThing();
	this.bottomObjectProperty = dataFactory.getOWLBottomObjectProperty();
	this.topObjectProperty = dataFactory.getOWLTopObjectProperty();
	this.bottomDataProperty = dataFactory.getOWLBottomDataProperty();
	this.topDataProperty = dataFactory.getOWLTopDataProperty();

	initializeMaps();
}
 
開發者ID:julianmendez,項目名稱:jcel,代碼行數:23,代碼來源:TranslationRepository.java

示例2: getDisjointDataProperties

import org.semanticweb.owlapi.model.OWLDataFactory; //導入方法依賴的package包/類
public NodeSet<OWLDataProperty> getDisjointDataProperties(
		OWLDataPropertyExpression propertyExpression) {
	checkPreConditions(propertyExpression);
	if (m_dlOntology.hasDatatypes()) {
		classifyDataProperties();
		if (!m_isConsistent)
			return new OWLDataPropertyNodeSet();
		Set<HierarchyNode<AtomicRole>> result = new HashSet<HierarchyNode<AtomicRole>>();
		if (propertyExpression.isOWLTopDataProperty()) {
			result.add(m_dataRoleHierarchy.getBottomNode());
			return dataPropertyHierarchyNodesToNodeSet(result);
		} else if (propertyExpression.isOWLBottomDataProperty()) {
			HierarchyNode<AtomicRole> node = m_dataRoleHierarchy
					.getTopNode();
			result.add(node);
			result.addAll(node.getDescendantNodes());
			return dataPropertyHierarchyNodesToNodeSet(result);
		}
		AtomicRole atomicRole = H(propertyExpression.asOWLDataProperty());
		Individual freshIndividual = Individual.create("fresh-individual");
		Constant freshConstant = Constant.createAnonymous("fresh-constant");
		Atom atomicRoleAssertion = atomicRole.getRoleAssertion(
				freshIndividual, freshConstant);
		Tableau tableau = getTableau();
		Set<HierarchyNode<AtomicRole>> nodesToTest = new HashSet<HierarchyNode<AtomicRole>>();
		nodesToTest
				.addAll(m_dataRoleHierarchy.getTopNode().getChildNodes());
		while (!nodesToTest.isEmpty()) {
			HierarchyNode<AtomicRole> nodeToTest = nodesToTest.iterator()
					.next();
			nodesToTest.remove(nodeToTest);
			AtomicRole atomicRoleToTest = nodeToTest.getRepresentative();
			Atom atomicRoleToTestAssertion = atomicRoleToTest
					.getRoleAssertion(freshIndividual, freshConstant);
			Set<Atom> perTestAtoms = new HashSet<Atom>(2);
			perTestAtoms.add(atomicRoleAssertion);
			perTestAtoms.add(atomicRoleToTestAssertion);
			if (!tableau.isSatisfiable(false, perTestAtoms, null, null,
					null, null, new ReasoningTaskDescription(true,
							"disjointness of {0} and {1}", atomicRole,
							atomicRoleToTest)))
				// disjoint
				result.addAll(nodeToTest.getDescendantNodes());
			else
				// maybe some children are disjoint
				nodesToTest.addAll(nodeToTest.getChildNodes());
		}
		if (result.isEmpty())
			result.add(m_dataRoleHierarchy.getBottomNode());
		return dataPropertyHierarchyNodesToNodeSet(result);
	} else {
		OWLDataFactory factory = getDataFactory();
		if (propertyExpression.isOWLTopDataProperty() && isConsistent())
			return new OWLDataPropertyNodeSet(new OWLDataPropertyNode(
					factory.getOWLBottomDataProperty()));
		else if (propertyExpression.isOWLBottomDataProperty()
				&& isConsistent())
			return new OWLDataPropertyNodeSet(new OWLDataPropertyNode(
					factory.getOWLTopDataProperty()));
		else
			return new OWLDataPropertyNodeSet();
	}
}
 
開發者ID:robertoyus,項目名稱:HermiT-android,代碼行數:64,代碼來源:Reasoner.java


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