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

Java OWLObjectOneOf类代码示例

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

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



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

示例1: visit

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
public void visit(OWLObjectComplementOf object) {
    OWLClassExpression description=object.getOperand();
    if (description instanceof OWLObjectHasSelf) {
        OWLObjectPropertyExpression objectProperty=((OWLObjectHasSelf)description).getProperty();
        Atom roleAtom=getRoleAtom(objectProperty,X,X);
        m_bodyAtoms.add(roleAtom);
    }
    else if (description instanceof OWLObjectOneOf && ((OWLObjectOneOf)description).getIndividuals().size()==1) {
        OWLIndividual individual=((OWLObjectOneOf)description).getIndividuals().iterator().next();
        m_bodyAtoms.add(Atom.create(getConceptForNominal(individual),X));
    }
    else if (!(description instanceof OWLClass))
        throw new IllegalStateException("Internal error: invalid normal form.");
    else
        m_bodyAtoms.add(Atom.create(AtomicConcept.create(((OWLClass)description).getIRI().toString()),X));
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:17,代码来源:OWLClausification.java


示例2: visit

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
public OWLClassExpression visit(OWLObjectOneOf object) {
     	//CHANGED
OWLClass definition=getDefinitionForNegativeNominal(object,m_alreadyExists);
if (!m_alreadyExists[0]) {
    for (OWLIndividual individual : object.getIndividuals()) {
        addFact(m_factory.getOWLClassAssertionAxiom(definition,individual));
    }
}
return definition;
         /*
         for (OWLIndividual ind : object.getIndividuals())
             if (ind.isAnonymous())
                 throw new IllegalArgumentException("Error: The class expression "+object+" contains anonymous individuals, which is not allowed in OWL 2 (erratum in first OWL 2 spec, to be fixed with next publication of minor corrections). ");
         return object;
         */
     }
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:17,代码来源:OWLNormalization.java


示例3: getOneOfAuxiliaryClass

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
/**
 * For a One-of Object {a,b,c,...} create and auxiliary class oo1, and
 * and axiom <code>oo1 subSetOf guard_i_a or guard_i_b or ...</code>
 * @param objectOneOf
 * @return
 */
private OWLClass getOneOfAuxiliaryClass(OWLObjectOneOf objectOneOf) {
	if (oneOfAuxClasses.containsKey(objectOneOf))
		return oneOfAuxClasses.get(objectOneOf);

	OWLClass auxOneOf = new OWLClassImpl(IRI.create(INTERNAL_IRI_PREFIX + "#oneOfaux" + (oneOfAuxClasses.size()+1)));
	OWLClassExpression[] inclusion = new OWLClassExpression[2];

	inclusion[0] = new OWLObjectComplementOfImpl(auxOneOf);
	inclusion[1] = objectOneOf;

	//translateInclusion(inclusion);
	newInclusions.add(inclusion);

	// add to the set of class which needs to be guessed
	// auxClasses.add(auxOneOf);
	oneOfAuxClasses.put(objectOneOf, auxOneOf);
	return auxOneOf;
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:25,代码来源:DebugTranslation.java


示例4: getOneOfAuxiliaryClass

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
/**
 * For a One-of Object {a,b,c,...} create and auxiliary class oo1, and
 * and axiom <code>oo1 subSetOf guard_i_a or guard_i_b or ...</code>
 * @param objectOneOf
 * @return
 */
private OWLClass getOneOfAuxiliaryClass(OWLObjectOneOf objectOneOf) {
	if (oneOfAuxClasses.containsKey(objectOneOf))
		return oneOfAuxClasses.get(objectOneOf);

	OWLClass auxOneOf = new OWLClassImpl(IRI.create(INTERNAL_IRI_PREFIX + "#oneofaux" + (oneOfAuxClasses.size()+1)));
	OWLClassExpression[] inclusion = new OWLClassExpression[2];

	inclusion[0] = new OWLObjectComplementOfImpl(auxOneOf);
	inclusion[1] = objectOneOf;

	//translateInclusion(inclusion);
	newInclusions.add(inclusion);

	// add to the set of class which needs to be guessed
	// auxClasses.add(auxOneOf);
	oneOfAuxClasses.put(objectOneOf, auxOneOf);
	return auxOneOf;
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:25,代码来源:NaiveTranslation.java


示例5: visit

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
@Override
public OWLClassExpression visit(OWLObjectSomeValuesFrom ce) {
	OWLClassExpression filler = ce.getFiller();
	OWLClassExpression shortenedFiller = filler.accept(this);
	if(shortenedFiller.isOWLNothing()){// \exists r.\bottom \equiv \bottom
		return df.getOWLNothing();
	} else if(!filler.equals(shortenedFiller)){
		return df.getOWLObjectSomeValuesFrom(ce.getProperty(), shortenedFiller);
	}

	// convert r some {a} to r value a
	if(shortenedFiller instanceof OWLObjectOneOf && ((OWLObjectOneOf) shortenedFiller).getIndividuals().size() == 1) {
		return df.getOWLObjectHasValue(ce.getProperty(), ((OWLObjectOneOf) shortenedFiller).getIndividuals().iterator().next());
	}
	return ce;
}
 
开发者ID:SmartDataAnalytics,项目名称:OWL2SPARQL,代码行数:17,代码来源:OWLClassExpressionMinimizer.java


示例6: addToOntology

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
@Override
public void addToOntology() {
  OWLNamedIndividual i1 = factory.getOWLNamedIndividual(":ObjectOneOf_Individual1", pm);
  OWLNamedIndividual i2 = factory.getOWLNamedIndividual(":ObjectOneOf_Individual2", pm);
  OWLObjectOneOf oneOf = factory.getOWLObjectOneOf(i1, i2);

  OWLClass oneOfClass = featurePool.getExclusiveClass(":ObjectOneOf");

  addAxiomToOntology(factory.getOWLEquivalentClassesAxiom(oneOfClass, oneOf));
}
 
开发者ID:VisualDataWeb,项目名称:OntoBench,代码行数:11,代码来源:OwlObjectOneOfFeature.java


示例7: addToOntology

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
@Override
public void addToOntology() {
  OWLNamedIndividual i1 = factory.getOWLNamedIndividual(":ObjectOneOf_RL_Individual1", pm);
  OWLNamedIndividual i2 = factory.getOWLNamedIndividual(":ObjectOneOf_RL_Individual2", pm);
  OWLObjectOneOf oneOf = factory.getOWLObjectOneOf(i1, i2);

  OWLClass oneOfClass = featurePool.getExclusiveClass(":ObjectOneOf_RL");

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(oneOf, oneOfClass));
}
 
开发者ID:VisualDataWeb,项目名称:OntoBench,代码行数:11,代码来源:OwlObjectOneOfOwl2RlFeature.java


示例8: addToOntology

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
@Override
public void addToOntology() {
  OWLNamedIndividual individual = factory.getOWLNamedIndividual(":ObjectOneOf_EL_Individual", pm);
  OWLObjectOneOf oneOf = factory.getOWLObjectOneOf(individual);

  OWLClass oneOfClass = featurePool.getExclusiveClass(":ObjectOneOf_EL");

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(oneOfClass, oneOf));
}
 
开发者ID:VisualDataWeb,项目名称:OntoBench,代码行数:10,代码来源:OwlObjectOneOfOwl2ElFeature.java


示例9: axiomatizeTopObjectProperty

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
protected void axiomatizeTopObjectProperty(OWLAxioms axioms) {
    // TransitiveObjectProperty( owl:topObjectProperty )
    axioms.m_complexObjectPropertyInclusions.add(new OWLAxioms.ComplexObjectPropertyInclusion(m_topObjectProperty));
    // SymmetricObjectProperty( owl:topObjectProperty )
    axioms.m_simpleObjectPropertyInclusions.add(new OWLObjectPropertyExpression[] { m_topObjectProperty,m_topObjectProperty.getInverseProperty() });
    // SubClassOf( owl:Thing ObjectSomeValuesFrom( owl:topObjectProperty ObjectOneOf( <internal:nam#topIndividual> ) ) )
    OWLIndividual newIndividual=m_factory.getOWLNamedIndividual(IRI.create("internal:nam#topIndividual"));
    OWLObjectOneOf oneOfNewIndividual=m_factory.getOWLObjectOneOf(newIndividual);
    OWLObjectSomeValuesFrom hasTopNewIndividual=m_factory.getOWLObjectSomeValuesFrom(m_topObjectProperty,oneOfNewIndividual);
    axioms.m_conceptInclusions.add(new OWLClassExpression[] { hasTopNewIndividual });
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:12,代码来源:BuiltInPropertyManager.java


示例10: OWLNormalization

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
public OWLNormalization(OWLDataFactory factory,OWLAxioms axioms,int firstReplacementIndex) {
    m_factory=factory;
    m_axioms=axioms;
    m_firstReplacementIndex=firstReplacementIndex;
    m_definitions=new HashMap<OWLClassExpression,OWLClassExpression>();
    m_definitionsForNegativeNominals=new HashMap<OWLObjectOneOf,OWLClass>();
    m_expressionManager=new ExpressionManager(m_factory);
    m_plVisitor=new PLVisitor();
    m_dataRangeDefinitions=new HashMap<OWLDataRange,OWLDatatype>();
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:11,代码来源:OWLNormalization.java


示例11: isNegatedOneNominal

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
protected static boolean isNegatedOneNominal(OWLClassExpression description) {
    if (!(description instanceof OWLObjectComplementOf))
        return false;
    OWLClassExpression operand=((OWLObjectComplementOf)description).getOperand();
    if (!(operand instanceof OWLObjectOneOf))
        return false;
    return ((OWLObjectOneOf)operand).getIndividuals().size()==1;
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:9,代码来源:OWLNormalization.java


示例12: getDefinitionForNegativeNominal

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
protected OWLClass getDefinitionForNegativeNominal(OWLObjectOneOf nominal,boolean[] alreadyExists) {
    OWLClass definition=m_definitionsForNegativeNominals.get(nominal);
    if (definition==null) {
        definition=m_factory.getOWLClass(IRI.create("internal:nnq#"+m_definitionsForNegativeNominals.size()));
        m_definitionsForNegativeNominals.put(nominal,definition);
        alreadyExists[0]=false;
    }
    else
        alreadyExists[0]=true;
    return definition;
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:12,代码来源:OWLNormalization.java


示例13: visit

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
public OWLClassExpression visit(OWLObjectComplementOf object) {
    if (isNominal(object.getOperand())) {
        OWLObjectOneOf objectOneOf=(OWLObjectOneOf)object.getOperand();
        OWLClass definition=getDefinitionForNegativeNominal(objectOneOf,m_alreadyExists);
        if (!m_alreadyExists[0])
            for (OWLIndividual individual : objectOneOf.getIndividuals())
                addFact(m_factory.getOWLClassAssertionAxiom(definition,individual));
        return m_factory.getOWLObjectComplementOf(definition);
    }
    else
        return object;
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:13,代码来源:OWLNormalization.java


示例14: OWLNormalization

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
public OWLNormalization(OWLDataFactory factory,OWLAxioms axioms,int firstReplacementIndex) {
    m_factory=factory;
    m_axioms=axioms;
    m_firstReplacementIndex=firstReplacementIndex;
    m_definitions=new HashMap<OWLClassExpression,OWLClassExpression>();
    m_definitionsForNegativeNominals=new HashMap<OWLObjectOneOf,OWLClass>();
    m_expressionManager=new ExpressionManager(m_factory);
    m_plVisitor=new PLVisitor();
    m_dataRangeDefinitions=new HashMap<OWLDataRange,OWLDatatype>();
    m_domain = new HashSet<OWLNamedIndividual>();
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:12,代码来源:OWLNormalization.java


示例15: visit

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
/**
 * We assume that we deal with a normalized axioms, i.e. they are in NNF and structural transformation took place.
 *
 * Thereofre we test here whether the operand
 * @see org.semanticweb.owlapi.model.OWLClassExpressionVisitor#visit(org.semanticweb.owlapi.model.OWLObjectComplementOf)
 */

public void visit(OWLObjectComplementOf objComplementOf) {
	OWLClassExpression operand = objComplementOf.getOperand();
	if (operand instanceof OWLClass) {
		OWLClass owlClass = operand.asOWLClass();
		String predicateName = mapper.getPredicateName(owlClass);

		writer.print(predicateName);
		writer.print(ASP2CoreSymbols.BRACKET_OPEN);
		writer.print(var.currentVar());
		writer.print(ASP2CoreSymbols.BRACKET_CLOSE);

		if (isAuxiliaryClass(owlClass)) auxClasses.add(owlClass);
	}
	//
	else if (operand instanceof OWLObjectHasSelf) {
		OWLObjectHasSelf owlHasSelf = (OWLObjectHasSelf) operand;
		OWLObjectProperty property = owlHasSelf.getProperty().asOWLObjectProperty();
		String propertyName = mapper.getPredicateName(property);
		String cVar = var.currentVar();

		// r(X,X)
		writer.print(propertyName);
		writer.print(ASP2CoreSymbols.BRACKET_OPEN);
		writer.print(cVar);
		writer.print(ASP2CoreSymbols.ARG_SEPERATOR);
		writer.print(cVar);
		writer.print(ASP2CoreSymbols.BRACKET_CLOSE);
	}
	else if (operand instanceof OWLObjectOneOf) {
		throw new NotImplementedException();
	}
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:40,代码来源:DebugTranslation.java


示例16: visit

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
/**
 * We assume that we deal with a normalized axioms, i.e. they are in NNF and structural transformation took place.
 *
 * Thereofre we test here whether the operand
 * @see org.semanticweb.owlapi.model.OWLClassExpressionVisitor#visit(org.semanticweb.owlapi.model.OWLObjectComplementOf)
 */

public void visit(OWLObjectComplementOf objComplementOf) {
	OWLClassExpression operand = objComplementOf.getOperand();

	if (operand instanceof OWLClass) {
		OWLClass owlClass = operand.asOWLClass();
		String predicateName = mapper.getPredicateName(owlClass);

		writer.print(predicateName);
		writer.print(ASP2CoreSymbols.BRACKET_OPEN);
		writer.print(var.currentVar());
		writer.print(ASP2CoreSymbols.BRACKET_CLOSE);

		if (isAuxiliaryClass(owlClass)) auxClasses.add(owlClass);
	}
	else if (operand instanceof OWLObjectHasSelf) {
		OWLObjectHasSelf owlHasSelf = (OWLObjectHasSelf) operand;
		OWLObjectProperty property = owlHasSelf.getProperty().asOWLObjectProperty();
		String propertyName = mapper.getPredicateName(property);
		String cVar = var.currentVar();

		// r(X,X)
		writer.print(propertyName);
		writer.print(ASP2CoreSymbols.BRACKET_OPEN);
		writer.print(cVar);
		writer.print(ASP2CoreSymbols.ARG_SEPERATOR);
		writer.print(cVar);
		writer.print(ASP2CoreSymbols.BRACKET_CLOSE);
	}
	else if (operand instanceof OWLObjectOneOf) {
		throw new NotImplementedException();
	}
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:40,代码来源:NaiveTranslation.java


示例17: visit

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
@Override
public IntegerClassExpression visit(OWLObjectOneOf ce) {
	Objects.requireNonNull(ce);
	Set<OWLIndividual> indivSet = ce.getIndividuals();
	if (indivSet.isEmpty()) {
		throw new TranslationException("It is not possible to translate ObjectOneOf with empty set.");
	}
	if (indivSet.size() > 1) {
		throw new TranslationException(
				"It is not possible to translate ObjectOneOf with multiple individuals: '" + indivSet + "'.");
	}
	return getDataTypeFactory().createObjectOneOf(translateIndividual(indivSet.iterator().next()));
}
 
开发者ID:julianmendez,项目名称:jcel,代码行数:14,代码来源:ClassExpressionTranslator.java


示例18: visit

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
@Override
public OWLAxiom visit(NominalAxiom axiom) {
	Objects.requireNonNull(axiom);
	OWLNamedIndividual owlIndividual = translator.getTranslationRepository()
			.getOWLNamedIndividual(axiom.getIndividual());
	OWLClass owlClass = translator.getTranslationRepository().getOWLClass(axiom.getClassExpression());
	Set<OWLAnnotation> owlAnnotations = translateAnnotations(axiom.getAnnotations());
	OWLDataFactory dataFactory = ontology.getOWLOntologyManager().getOWLDataFactory();
	OWLObjectOneOf owlObjectOneOf = dataFactory.getOWLObjectOneOf(owlIndividual);
	Set<OWLClassExpression> owlClassExpressions = new HashSet<>();
	owlClassExpressions.add(owlObjectOneOf);
	owlClassExpressions.add(owlClass);
	return dataFactory.getOWLEquivalentClassesAxiom(owlClassExpressions, owlAnnotations);
}
 
开发者ID:julianmendez,项目名称:jcel,代码行数:15,代码来源:ReverseAxiomTranslator.java


示例19: visit

import org.semanticweb.owlapi.model.OWLObjectOneOf; //导入依赖的package包/类
@Override
public OWLClassExpression visit(OWLObjectOneOf ce) {
    if (ce.getIndividuals().size() == 1) {
        if (negated) {
            return getNegation(ce);
        } else {
            return ce;
        }
    } else {
        return ce.asObjectUnionOf().accept(this);
    }
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:13,代码来源:NNF.java


示例20: equals

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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