• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java OWLNamedIndividualNodeSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet的典型用法代码示例。如果您正苦于以下问题:Java OWLNamedIndividualNodeSet类的具体用法?Java OWLNamedIndividualNodeSet怎么用?Java OWLNamedIndividualNodeSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OWLNamedIndividualNodeSet类属于org.semanticweb.owlapi.reasoner.impl包,在下文中一共展示了OWLNamedIndividualNodeSet类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getPropertiesWithInferenceGetsInferredProperties

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
@Test
public void getPropertiesWithInferenceGetsInferredProperties() throws Exception {
    final OWLNamedIndividual individual = dataFactory.getOWLNamedIndividual(IRI.create(PK));
    initEmptyOntology(individual);
    when(ontologyMock.dataPropertiesInSignature())
            .thenReturn(Stream.of(dataFactory.getOWLDataProperty(IRI.create(DP_ONE)),
                    dataFactory.getOWLDataProperty(IRI.create(DP_TWO))));
    when(ontologyMock.objectPropertiesInSignature())
            .thenReturn(Stream.of(dataFactory.getOWLObjectProperty(IRI.create(OP_ONE))));
    when(reasonerMock.getDataPropertyValues(eq(individual), any(OWLDataProperty.class)))
            .thenReturn(Collections.emptySet());
    when(reasonerMock.getObjectPropertyValues(eq(individual),
            any(OWLObjectProperty.class))).thenReturn(new OWLNamedIndividualNodeSet());

    final Collection<Axiom<?>> axioms = propertiesHandler.getProperties(INDIVIDUAL, true);

    assertNotNull(axioms);
    verify(reasonerMock, atLeastOnce()).getDataPropertyValues(eq(individual), any(OWLDataProperty.class));
    verify(reasonerMock, atLeastOnce()).getObjectPropertyValues(eq(individual), any(OWLObjectProperty.class));
}
 
开发者ID:kbss-cvut,项目名称:jopa,代码行数:21,代码来源:PropertiesHandlerTest.java


示例2: initReasoner

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
private void initReasoner(List<URI> items) {
    final OWLObjectProperty hasList = dataFactory.getOWLObjectProperty(IRI.create(HAS_LIST.getIdentifier()));
    final OWLObjectProperty hasNext = dataFactory.getOWLObjectProperty(IRI.create(HAS_NEXT.getIdentifier()));
    when(reasonerMock
            .getObjectPropertyValues(dataFactory.getOWLNamedIndividual(IRI.create(SUBJECT.getIdentifier())),
                    hasList))
            .thenReturn(new OWLNamedIndividualNodeSet(dataFactory.getOWLNamedIndividual(IRI.create(items.get(0)))));
    for (int i = 1; i < items.size(); i++) {
        when(reasonerMock
                .getObjectPropertyValues(dataFactory.getOWLNamedIndividual(IRI.create(items.get(i - 1))), hasNext))
                .thenReturn(
                        new OWLNamedIndividualNodeSet(dataFactory.getOWLNamedIndividual(IRI.create(items.get(i)))));
    }
    when(reasonerMock
            .getObjectPropertyValues(dataFactory.getOWLNamedIndividual(IRI.create(items.get(items.size() - 1))),
                    hasNext)).thenReturn(new OWLNamedIndividualNodeSet());
}
 
开发者ID:kbss-cvut,项目名称:jopa,代码行数:18,代码来源:SimpleListHandlerTest.java


示例3: skipsExplicitAssertionValueIfThereIsTheSameAssertionAlsoWithInference

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
@Test
public void skipsExplicitAssertionValueIfThereIsTheSameAssertionAlsoWithInference() {
    final URI opUri = URI.create("http://krizik.felk.cvut.cz/PropertyOne");
    final Assertion opAsserted = Assertion.createObjectPropertyAssertion(opUri, false);
    final Assertion opInferred = Assertion.createObjectPropertyAssertion(opUri, true);
    final OWLObjectProperty owlOp = dataFactory.getOWLObjectProperty(IRI.create(opUri));
    final Set<Node<OWLNamedIndividual>> indSet = new HashSet<>();
    final OWLNamedIndividual commonInd = dataFactory.getOWLNamedIndividual(
            IRI.create("http://krizik.felk.cvut.cz/IndividialOne"));
    indSet.add(NodeFactory.getOWLNamedIndividualNode(commonInd));
    indSet.add(NodeFactory.getOWLNamedIndividualNode(
            dataFactory.getOWLNamedIndividual(IRI.create("http://krizik.felk.cvut.cz/IndividialTwo"))));
    final NodeSet<OWLNamedIndividual> individuals = new OWLNamedIndividualNodeSet(indSet);
    when(reasonerMock.getObjectPropertyValues(individual, owlOp)).thenReturn(individuals);
    final Stream<OWLObjectPropertyAssertionAxiom> axioms = Stream.of(dataFactory.getOWLObjectPropertyAssertionAxiom(
                    dataFactory.getOWLObjectProperty(IRI.create(opUri)), individual, commonInd));
    when(ontologyMock.objectPropertyAssertionAxioms(individual)).thenReturn(axioms);
    when(ontologyMock.dataPropertyAssertionAxioms(any())).thenReturn(Stream.empty());
    when(ontologyMock.annotationAssertionAxioms(any())).thenReturn(Stream.empty());

    final Collection<Axiom<?>> result = axiomLoader.findAxioms(descriptor(opAsserted, opInferred));
    assertEquals(indSet.size(), result.size());
    for (Axiom ax : result) {
        assertEquals(opInferred, ax.getAssertion());
    }
}
 
开发者ID:kbss-cvut,项目名称:jopa,代码行数:27,代码来源:MainAxiomLoaderTest.java


示例4: getDifferentIndividuals

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
public NodeSet<OWLNamedIndividual> getDifferentIndividuals(
		OWLNamedIndividual namedIndividual) {
	checkPreConditions(namedIndividual);
	if (!m_isConsistent) {
		Node<OWLNamedIndividual> node = new OWLNamedIndividualNode(
				getAllNamedIndividuals());
		return new OWLNamedIndividualNodeSet(Collections.singleton(node));
	}
	Individual individual = H(namedIndividual);
	Tableau tableau = getTableau();
	Set<Individual> result = new HashSet<Individual>();
	for (Individual potentiallyDifferentIndividual : m_dlOntology
			.getAllIndividuals())
		if (isResultRelevantIndividual(potentiallyDifferentIndividual)
				&& !individual.equals(potentiallyDifferentIndividual))
			if (!tableau.isSatisfiable(true, true, Collections
					.singleton(Atom.create(Equality.INSTANCE, individual,
							potentiallyDifferentIndividual)), null, null,
					null, null, new ReasoningTaskDescription(true,
							"is {0} different from {1}", individual,
							potentiallyDifferentIndividual)))
				result.add(potentiallyDifferentIndividual);
	return sortBySameAsIfNecessary(result);
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:25,代码来源:Reasoner.java


示例5: getObjectPropertyValues

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
public NodeSet<OWLNamedIndividual> getObjectPropertyValues(
		OWLNamedIndividual namedIndividual,
		OWLObjectPropertyExpression propertyExpression) {
	checkPreConditions(namedIndividual, propertyExpression);
	if (!m_isConsistent) {
		Node<OWLNamedIndividual> node = new OWLNamedIndividualNode(
				getAllNamedIndividuals());
		return new OWLNamedIndividualNodeSet(Collections.singleton(node));
	}
	AtomicRole role = H(propertyExpression.getNamedProperty());
	if (!m_dlOntology.containsObjectRole(role))
		return new OWLNamedIndividualNodeSet();
	initialisePropertiesInstanceManager();
	Individual individual = H(namedIndividual);
	Set<Individual> result;
	if (propertyExpression.getSimplified().isAnonymous()) {
		// inverse role
		result = m_instanceManager.getObjectPropertySubjects(role,
				individual);
	} else {
		// named role
		result = m_instanceManager
				.getObjectPropertyValues(role, individual);
	}
	return sortBySameAsIfNecessary(result);
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:27,代码来源:Reasoner.java


示例6: getInstances

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
public NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression ce,
		boolean direct) throws InconsistentOntologyException,
		ClassExpressionNotInProfileException, FreshEntitiesException,
		ReasonerInterruptedException, TimeOutException {
	DefaultNodeSet<OWLNamedIndividual> result = new OWLNamedIndividualNodeSet();
	Set<OWLObject> subs = gw.queryDescendants(ce, true, true);
	for (OWLObject s : subs) {
		if (s instanceof OWLNamedIndividual) {
			result.addEntity((OWLNamedIndividual) s);
		}
		else {

		}
	}
	return result;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:17,代码来源:GraphReasoner.java


示例7: getInstances

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
public NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression ce, boolean direct) throws InconsistentOntologyException, ClassExpressionNotInProfileException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    ensurePrepared();
    DefaultNodeSet<OWLNamedIndividual> result = new OWLNamedIndividualNodeSet();
    if (!ce.isAnonymous()) {
        OWLClass cls = ce.asOWLClass();
        Set<OWLClass> clses = new HashSet<OWLClass>();
        clses.add(cls);
        if (!direct) {
            clses.addAll(getSubClasses(cls, false).getFlattened());
        }
        for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
            for (OWLClass curCls : clses) {
                for (OWLClassAssertionAxiom axiom : ontology.getClassAssertionAxioms(curCls)) {
                    OWLIndividual individual = axiom.getIndividual();
                    if (!individual.isAnonymous()) {
                        if (getIndividualNodeSetPolicy().equals(IndividualNodeSetPolicy.BY_SAME_AS)) {
                            result.addNode(getSameIndividuals(individual.asOWLNamedIndividual()));
                        }
                        else {
                            result.addNode(new OWLNamedIndividualNode(individual.asOWLNamedIndividual()));
                        }
                    }
                }
            }
        }
    }
    return result;
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:29,代码来源:StructuralReasoner2.java


示例8: getObjectPropertyValues

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
public NodeSet<OWLNamedIndividual> getObjectPropertyValues(OWLNamedIndividual ind, OWLObjectPropertyExpression pe) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    ensurePrepared();
    OWLNamedIndividualNodeSet result = new OWLNamedIndividualNodeSet();
    Node<OWLObjectPropertyExpression> inverses = getInverseObjectProperties(pe);
    for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
        for (OWLObjectPropertyAssertionAxiom axiom : ontology.getObjectPropertyAssertionAxioms(ind)) {
            if (!axiom.getObject().isAnonymous()) {
                if (axiom.getProperty().getSimplified().equals(pe.getSimplified())) {
                    if (getIndividualNodeSetPolicy().equals(IndividualNodeSetPolicy.BY_SAME_AS)) {
                        result.addNode(getSameIndividuals(axiom.getObject().asOWLNamedIndividual()));
                    }
                    else {
                        result.addNode(new OWLNamedIndividualNode(axiom.getObject().asOWLNamedIndividual()));
                    }
                }
            }
            // Inverse of pe
            if (axiom.getObject().equals(ind) && !axiom.getSubject().isAnonymous()) {
                OWLObjectPropertyExpression invPe = axiom.getProperty().getInverseProperty().getSimplified();
                if (!invPe.isAnonymous() && inverses.contains(invPe.asOWLObjectProperty())) {
                    if (getIndividualNodeSetPolicy().equals(IndividualNodeSetPolicy.BY_SAME_AS)) {
                        result.addNode(getSameIndividuals(axiom.getObject().asOWLNamedIndividual()));
                    }
                    else {
                        result.addNode(new OWLNamedIndividualNode(axiom.getObject().asOWLNamedIndividual()));
                    }
                }
            }

        }
    }
    // Could do other stuff like inspecting owl:hasValue restrictions
    return result;
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:35,代码来源:StructuralReasoner2.java


示例9: initReasoner

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
private void initReasoner() {
    final OWLNamedIndividual node = dataFactory.getOWLNamedIndividual(
            IRI.create(SUBJECT.toString() + ReferencedListTestHelper.SEQUENCE_NODE_SUFFIX + "0"));
    final OWLNamedIndividual owner = dataFactory.getOWLNamedIndividual(IRI.create(SUBJECT.getIdentifier()));
    final NodeSet<OWLNamedIndividual> nodeSet = new OWLNamedIndividualNodeSet(node);
    when(reasonerMock.getObjectPropertyValues(owner, hasListProperty)).thenReturn(nodeSet);
    final OWLNamedIndividual content = dataFactory.getOWLNamedIndividual(IRI.create(LIST_ITEMS.get(0)));
    final NodeSet<OWLNamedIndividual> valueSet = new OWLNamedIndividualNodeSet(content);
    when(reasonerMock.getObjectPropertyValues(node, hasContentProperty)).thenReturn(valueSet);
    when(reasonerMock.getObjectPropertyValues(node, hasNextProperty)).thenReturn(new OWLNamedIndividualNodeSet());
}
 
开发者ID:kbss-cvut,项目名称:jopa,代码行数:12,代码来源:ReferencedListHandlerTest.java


示例10: loadsInferredObjectPropertyValues

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
@Test
public void loadsInferredObjectPropertyValues() {
    final URI opUri = URI.create("http://krizik.felk.cvut.cz/PropertyOne");
    final Assertion op = Assertion.createObjectPropertyAssertion(opUri, true);
    final OWLObjectProperty owlOp = dataFactory.getOWLObjectProperty(IRI.create(opUri));
    final NodeSet<OWLNamedIndividual> individuals = new OWLNamedIndividualNodeSet(
            dataFactory.getOWLNamedIndividual(IRI.create("http://krizik.felk.cvut.cz/IndividialOne")));
    when(reasonerMock.getObjectPropertyValues(individual, owlOp)).thenReturn(individuals);

    final Collection<Axiom<?>> result = axiomLoader.findAxioms(descriptor(op));
    for (Axiom<?> ax : result) {
        assertEquals(op, ax.getAssertion());
    }
}
 
开发者ID:kbss-cvut,项目名称:jopa,代码行数:15,代码来源:MainAxiomLoaderTest.java


示例11: convertIndividualNodes

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
public OWLNamedIndividualNodeSet convertIndividualNodes(
		Iterable<? extends Node<ElkNamedIndividual>> nodes) {
	Set<org.semanticweb.owlapi.reasoner.Node<OWLNamedIndividual>> owlNodes = new HashSet<org.semanticweb.owlapi.reasoner.Node<OWLNamedIndividual>>();
	for (Node<ElkNamedIndividual> node : nodes) {
		owlNodes.add(convertIndividualNode(node));
	}
	return new OWLNamedIndividualNodeSet(owlNodes);
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:9,代码来源:ElkConverter.java


示例12: getInstances

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
public NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression classExpression,
		boolean arg1) {
	//TODO Indirect and Arbitrary Class Expr
	Set<OWLNamedIndividual> individuals = rootOntology.getIndividualsInSignature(Imports.INCLUDED);
	OWLNamedIndividualNodeSet result = new OWLNamedIndividualNodeSet ();
	for (OWLNamedIndividual individual : individuals) {
		OWLClassAssertionAxiom impl = new OWLClassAssertionAxiomImpl (individual, classExpression, new HashSet<OWLAnnotation> ());
		if(isEntailed(impl)) {
			result.addEntity(individual);
		}
	}
	return result;
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:14,代码来源:Wolpertinger.java


示例13: translateSSI

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
public NodeSet<OWLNamedIndividual> translateSSI(Set<Set<IntegerNamedIndividual>> integerObject) {
	Objects.requireNonNull(integerObject);
	Set<Node<OWLNamedIndividual>> setOfNodes = new HashSet<>();
	integerObject.forEach(intSet -> {
		setOfNodes.add(translateSI(intSet));
	});
	return new OWLNamedIndividualNodeSet(setOfNodes);
}
 
开发者ID:julianmendez,项目名称:jcel,代码行数:9,代码来源:Translator.java


示例14: getDifferentIndividuals

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
@SuppressWarnings("unused")
public NodeSet<OWLNamedIndividual> getDifferentIndividuals(OWLNamedIndividual ind) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    return new OWLNamedIndividualNodeSet();
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:5,代码来源:StructuralReasoner2.java


示例15: getObjectPropertyValues

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
public NodeSet<OWLNamedIndividual> getObjectPropertyValues(
		OWLNamedIndividual arg0, OWLObjectPropertyExpression arg1) {
	// TODO Auto-generated method stub
	return new OWLNamedIndividualNodeSet();
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:6,代码来源:Wolpertinger.java


示例16: getInstances

import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; //导入依赖的package包/类
/**
 * Gets the individuals which are instances of the specified class
 * expression. The individuals are returned a a
 * {@link NodeSet}.
 *
 * @param ce
 *            The class expression whose instances are to be retrieved.
 * @param direct
 *            Specifies if the direct instances should be retrieved (
 *            <code>true</code>), or if all instances should be retrieved (
 *            <code>false</code>).
 * @return If <code>direct</code> is <code>true</code>, a
 *         <code>NodeSet</code> containing named individuals such that for
 *         each named individual <code>j</code> in the node set, the set of
 *         reasoner axioms entails <code>DirectClassAssertion(ce, j)</code>.
 *         </p> If <code>direct</code> is <code>false</code>, a
 *         <code>NodeSet</code> containing named individuals such that for
 *         each named individual <code>j</code> in the node set, the set of
 *         reasoner axioms entails <code>ClassAssertion(ce, j)</code>. </p>
 *         </p> If ce is unsatisfiable with respect to the set of reasoner
 *         axioms then the empty <code>NodeSet</code> is returned.
 *
 * @throws InconsistentOntologyException
 *             if the imports closure of the root ontology is inconsistent
 * @throws ClassExpressionNotInProfileException
 *             if the class expression <code>ce</code> is not in the profile
 *             that is supported by this reasoner.
 * @throws FreshEntitiesException
 *             if the signature of the class expression is not contained
 *             within the signature of the imports closure of the root
 *             ontology and the undeclared entity policy of this reasoner is
 *             set to {@link FreshEntityPolicy#DISALLOW}.
 * @throws ReasonerInterruptedException
 *             if the reasoning process was interrupted for any particular
 *             reason (for example if reasoning was cancelled by a client
 *             process)
 * @throws TimeOutException
 *             if the reasoner timed out during a basic reasoning operation.
 *             See {@link #getTimeOut()}.
 * @see {@link org.semanticweb.owlapi.reasoner.IndividualNodeSetPolicy}
 */
@Override
public NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression ce,
        boolean direct) throws InconsistentOntologyException,
        ClassExpressionNotInProfileException, FreshEntitiesException,
        ReasonerInterruptedException, TimeOutException {
    return new OWLNamedIndividualNodeSet();
}
 
开发者ID:aehrc,项目名称:snorocket,代码行数:49,代码来源:SnorocketOWLReasoner.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ZSession类代码示例发布时间:2022-05-22
下一篇:
Java SetAVTransportURI类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap