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


Java OWLIndividual.isAnonymous方法代码示例

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


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

示例1: visit

import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
public void visit(SWRLDifferentIndividualsAtom atom) {
    Set<OWLNamedIndividual> inds=new HashSet<OWLNamedIndividual>();
    for (SWRLArgument arg : atom.getAllArguments()) {
        if (!(arg instanceof SWRLIndividualArgument))
            throwVarError(atom);
        OWLIndividual ind=((SWRLIndividualArgument)arg).getIndividual();
        if (ind.isAnonymous())
            throwAnonIndError(atom);
        inds.add(ind.asOWLNamedIndividual());
    }
    addFact(m_factory.getOWLDifferentIndividualsAxiom(inds));
}
 
开发者ID:evalincius,项目名称:Hermit_1.3.8_android,代码行数:13,代码来源:OWLNormalization.java

示例2: getSameIndividuals

import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
public Node<OWLNamedIndividual> getSameIndividuals(OWLNamedIndividual ind) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    ensurePrepared();
    Set<OWLNamedIndividual> inds = new HashSet<OWLNamedIndividual>();
    Set<OWLSameIndividualAxiom> processed = new HashSet<OWLSameIndividualAxiom>();
    List<OWLNamedIndividual> stack = new ArrayList<OWLNamedIndividual>();
    stack.add(ind);
    while (!stack.isEmpty()) {
        OWLNamedIndividual currentInd = stack.remove(0);
        for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
            for (OWLSameIndividualAxiom axiom : ontology.getSameIndividualAxioms(currentInd)) {
                if (!processed.contains(axiom)) {
                    processed.add(axiom);
                    for (OWLIndividual i : axiom.getIndividuals()) {
                        if (!i.isAnonymous()) {
                            OWLNamedIndividual namedInd = i.asOWLNamedIndividual();
                            if (!inds.contains(namedInd)) {
                                inds.add(namedInd);
                                stack.add(namedInd);
                            }
                        }
                    }
                }
            }
        }
    }

    return new OWLNamedIndividualNode(inds);
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:29,代码来源:StructuralReasoner2.java

示例3: isDefined

import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
public boolean isDefined(OWLIndividual owlIndividual) {
	Individual individual;
	if (owlIndividual.isAnonymous())
		individual = Individual.createAnonymous(owlIndividual
				.asOWLAnonymousIndividual().getID().toString());
	else
		individual = Individual.create(owlIndividual.asOWLNamedIndividual()
				.getIRI().toString());
	return m_dlOntology.containsIndividual(individual);
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:11,代码来源:Reasoner.java

示例4: visit

import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
public Boolean visit(OWLObjectPropertyAssertionAxiom axiom) {
    OWLIndividual sub=axiom.getSubject();
    OWLIndividual obj=axiom.getObject();
    if (sub.isAnonymous()||obj.isAnonymous()) {
        anonymousIndividualAxioms.add(axiom);
        return true; // will be checked afterwards by rolling-up
    }
    return reasoner.hasObjectPropertyRelationship(sub.asOWLNamedIndividual(),axiom.getProperty(),obj.asOWLNamedIndividual());
}
 
开发者ID:evalincius,项目名称:Hermit_1.3.8_android,代码行数:10,代码来源:EntailmentChecker.java

示例5: visit

import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
public void visit(SWRLDataPropertyAtom atom) {
    if (!(atom.getSecondArgument() instanceof SWRLLiteralArgument))
        throwVarError(atom);
    if (!(atom.getFirstArgument() instanceof SWRLIndividualArgument))
        throwVarError(atom);
    OWLIndividual ind=((SWRLIndividualArgument)atom.getFirstArgument()).getIndividual();
    if (ind.isAnonymous())
        throwAnonIndError(atom);
    OWLLiteral lit=((SWRLLiteralArgument)atom.getSecondArgument()).getLiteral();
    addFact(m_factory.getOWLDataPropertyAssertionAxiom(atom.getPredicate().asOWLDataProperty(),ind.asOWLNamedIndividual(),lit));
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:12,代码来源:OWLNormalization.java

示例6: getIndividual

import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
protected Individual getIndividual(OWLIndividual individual) {
    Individual ind;
    if (individual.isAnonymous())
        ind=Individual.createAnonymous(individual.asOWLAnonymousIndividual().getID().toString());
    else
        ind=Individual.create(individual.asOWLNamedIndividual().getIRI().toString());
    m_allIndividuals.add(ind);
    return ind;
}
 
开发者ID:evalincius,项目名称:Hermit_1.3.8_android,代码行数:10,代码来源:ReducedABoxOnlyClausification.java

示例7: visit

import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
public Boolean visit(OWLDataPropertyAssertionAxiom axiom) {
    OWLIndividual sub=axiom.getSubject();
    if (sub.isAnonymous()) {
        anonymousIndividualAxioms.add(axiom);
        return true; // will be checked afterwards by rolling-up
    }
    return reasoner.hasDataPropertyRelationship(sub.asOWLNamedIndividual(),axiom.getProperty().asOWLDataProperty(),axiom.getObject());
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:9,代码来源:EntailmentChecker.java

示例8: getIndividual

import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
protected static Individual getIndividual(OWLIndividual individual) {
    if (individual.isAnonymous())
        return Individual.createAnonymous(individual.asOWLAnonymousIndividual().getID().toString());
    else
        return Individual.create(individual.asOWLNamedIndividual().getIRI().toString());
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:7,代码来源:OWLClausification.java


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