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


Java OWLDifferentIndividualsAxiom类代码示例

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


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

示例1: visit

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
public Boolean visit(OWLDifferentIndividualsAxiom axiom) {
    // see OWL 2 Syntax, Sec 11.2
    // No axiom in Ax of the following form contains anonymous individuals:
    // SameIndividual, DifferentIndividuals, NegativeObjectPropertyAssertion, and NegativeDataPropertyAssertion.
    ArrayList<OWLIndividual> list=new ArrayList<OWLIndividual>(axiom.getIndividuals());
    for (OWLIndividual i : list) {
        if (i.isAnonymous()) {
            throw new IllegalArgumentException("OWLDifferentIndividualsAxiom axioms are not allowed to be used "+"with anonymous individuals (see OWL 2 Syntax Sec 11.2) but the axiom "+axiom+" cotains an anonymous individual. ");
        }
    }
    for (int i=0;i<list.size()-1;i++) {
        OWLNamedIndividual head=list.get(i).asOWLNamedIndividual();
        for (int j=i+1;j<list.size();j++) {
            OWLNamedIndividual next=list.get(j).asOWLNamedIndividual();
            if (!reasoner.hasType(head,factory.getOWLObjectComplementOf(factory.getOWLObjectOneOf(next)),false))
                return Boolean.FALSE;
        }
    }
    return Boolean.TRUE;
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:21,代码来源:EntailmentChecker.java

示例2: visit

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
public void visit(OWLDifferentIndividualsAxiom object) {
    OWLIndividual[] individuals=new OWLIndividual[object.getIndividuals().size()];
    object.getIndividuals().toArray(individuals);
    for (int i=0;i<individuals.length;i++)
        for (int j=i+1;j<individuals.length;j++)
            m_positiveFacts.add(Atom.create(Inequality.create(),getIndividual(individuals[i]),getIndividual(individuals[j])));
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:8,代码来源:OWLClausification.java

示例3: visit

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
@Override
public T visit(OWLDifferentIndividualsAxiom axiom) {
	throw new IllegalArgumentException(
			OWLDifferentIndividualsAxiom.class.getSimpleName()
					+ " cannot be converted to "
					+ getTargetClass().getSimpleName());
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:8,代码来源:AbstractOwlAxiomConverterVisitor.java

示例4: visit

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
@Override
public Set<ComplexIntegerAxiom> visit(OWLDifferentIndividualsAxiom axiom) {
	Objects.requireNonNull(axiom);
	Set<OWLIndividual> individualSet = axiom.getIndividuals();
	Set<Integer> individualIdSet = new HashSet<>();
	individualSet.forEach(individual -> {
		getTranslationRepository().addNamedIndividual(individual.asOWLNamedIndividual());
		individualIdSet.add(translateIndividual(individual));
	});
	ComplexIntegerAxiom ret = getAxiomFactory().createDifferentIndividualsAxiom(individualIdSet,
			translateAnnotations(axiom.getAnnotations()));
	return Collections.singleton(ret);
}
 
开发者ID:julianmendez,项目名称:jcel,代码行数:14,代码来源:AxiomTranslator.java

示例5: visit

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
@Override
public Void visit(OWLDifferentIndividualsAxiom axiom) {
  List<Long> nodes = transform(axiom.getIndividualsAsList(), new Function<OWLIndividual, Long>() {
    @Override
    public Long apply(OWLIndividual individual) {
      return getOrCreateNode(getIri(individual));
    }
  });
  getOrCreateRelationshipPairwise(nodes, OwlRelationships.OWL_DIFFERENT_FROM);
  return null;
}
 
开发者ID:SciGraph,项目名称:SciGraph,代码行数:12,代码来源:GraphOwlVisitor.java

示例6: visit

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
@Override
public void visit(@Nonnull OWLDifferentIndividualsAxiom axiom) {
    for (OWLIndividual ind : axiom.getIndividuals()) {
        ind.accept(this);
    }
    processAxiomAnnotations(axiom);
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:8,代码来源:AbstractEntityRegistrationManager.java

示例7: getAxiomWithoutAnnotations

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
@Override
public OWLDifferentIndividualsAxiom getAxiomWithoutAnnotations() {
    if (!isAnnotated()) {
        return this;
    }
    return new OWLDifferentIndividualsAxiomImpl(getIndividuals(),
            NO_ANNOTATIONS);
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:9,代码来源:OWLDifferentIndividualsAxiomImpl.java

示例8: asPairwiseAxioms

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
@Override
public Set<OWLDifferentIndividualsAxiom> asPairwiseAxioms() {
    List<OWLIndividual> individuals = getIndividualsAsList();
    Set<OWLDifferentIndividualsAxiom> result = new HashSet<>();
    for (int i = 0; i < individuals.size() - 1; i++) {
        for (int j = i + 1; j < individuals.size(); j++) {
            OWLIndividual indI = individuals.get(i);
            OWLIndividual indJ = individuals.get(j);
            result.add(new OWLDifferentIndividualsAxiomImpl(new HashSet<>(
                    Arrays.asList(indI, indJ)), NO_ANNOTATIONS));
        }
    }
    return result;
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:15,代码来源:OWLDifferentIndividualsAxiomImpl.java

示例9: splitToAnnotatedPairs

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
@Override
public Set<OWLDifferentIndividualsAxiom> splitToAnnotatedPairs() {
    List<OWLIndividual> individuals = getIndividualsAsList();
    if (individuals.size() == 2) {
        return Collections.<OWLDifferentIndividualsAxiom> singleton(this);
    }
    Set<OWLDifferentIndividualsAxiom> result = new HashSet<>();
    for (int i = 0; i < individuals.size() - 1; i++) {
        OWLIndividual indI = individuals.get(i);
        OWLIndividual indJ = individuals.get(i + 1);
        result.add(new OWLDifferentIndividualsAxiomImpl(new HashSet<>(
                Arrays.asList(indI, indJ)), getAnnotations()));
    }
    return result;
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:16,代码来源:OWLDifferentIndividualsAxiomImpl.java

示例10: equals

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (!super.equals(obj)) {
        return false;
    }
    return obj instanceof OWLDifferentIndividualsAxiom;
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:11,代码来源:OWLDifferentIndividualsAxiomImpl.java

示例11: visit

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
public void visit(OWLDifferentIndividualsAxiom axiom) {
    notSupported(axiom);
}
 
开发者ID:kbss-cvut,项目名称:jopa,代码行数:4,代码来源:IntegrityConstraintParser.java

示例12: visit

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
public void visit(OWLDifferentIndividualsAxiom object) {
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:3,代码来源:BuiltInPropertyManager.java

示例13: visit

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
public void visit(OWLDifferentIndividualsAxiom axiom) {
    if (axiom.containsAnonymousIndividuals())
        throw new IllegalArgumentException("The axiom "+axiom+" contains anonymous individuals, which is not allowed in OWL 2. ");
    addFact(axiom);
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:6,代码来源:OWLNormalization.java

示例14: visit

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
@Override
public OWLDifferentIndividualsAxiom visit(
		ElkDifferentIndividualsAxiom axiom) {
	return owlFactory_.getOWLDifferentIndividualsAxiom(
			toIndividualSet(axiom.getIndividuals()));
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:7,代码来源:AbstractElkObjectConverter.java

示例15: convert

import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom; //导入依赖的package包/类
@SuppressWarnings("static-method")
public ElkDifferentIndividualsAxiom convert(
		OWLDifferentIndividualsAxiom owlDifferentIndividualsAxiom) {
	return new ElkDifferentIndividualsAxiomWrap<OWLDifferentIndividualsAxiom>(
			owlDifferentIndividualsAxiom);
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:7,代码来源:OwlConverter.java


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