本文整理汇总了Java中org.semanticweb.owlapi.model.OWLAxiom.accept方法的典型用法代码示例。如果您正苦于以下问题:Java OWLAxiom.accept方法的具体用法?Java OWLAxiom.accept怎么用?Java OWLAxiom.accept使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLAxiom
的用法示例。
在下文中一共展示了OWLAxiom.accept方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processAxioms
import org.semanticweb.owlapi.model.OWLAxiom; //导入方法依赖的package包/类
public void processAxioms(Collection<? extends OWLAxiom> axioms) {
AxiomVisitor axiomVisitor=new AxiomVisitor();
for (OWLAxiom axiom : axioms)
axiom.accept(axiomVisitor);
// now all axioms are in NNF and converted into disjunctions wherever possible
// exact cardinalities are rewritten into at least and at most cardinalities etc
// Rules with multiple head atoms are rewritten into several rules (Lloyd-Topor transformation)
// normalize rules, this might add new concept and data range inclusions
// in case a rule atom uses a complex concept or data range
// we keep this inclusions separate because they are only applied to named individuals
RuleNormalizer ruleNormalizer=new RuleNormalizer(m_axioms.m_rules,axiomVisitor.m_classExpressionInclusionsAsDisjunctions,axiomVisitor.m_dataRangeInclusionsAsDisjunctions);
for (SWRLRule rule : axiomVisitor.m_rules)
ruleNormalizer.visit(rule);
// in normalization, we now simplify the disjuncts where possible (eliminate
// unnecessary conjuncts/disjuncts) and introduce fresh atomic concepts for complex
// concepts m_axioms.m_conceptInclusions contains the normalized axioms after the normalization
normalizeInclusions(axiomVisitor.m_classExpressionInclusionsAsDisjunctions,axiomVisitor.m_dataRangeInclusionsAsDisjunctions);
}
示例2: processAxioms
import org.semanticweb.owlapi.model.OWLAxiom; //导入方法依赖的package包/类
public void processAxioms(Collection<? extends OWLAxiom> axioms) {
AxiomVisitor axiomVisitor=new AxiomVisitor();
for (OWLAxiom axiom : axioms) {
axiom = preprocessAssertion(axiom);
axiom.accept(axiomVisitor);
}
// now all axioms are in NNF and converted into disjunctions wherever possible
// exact cardinalities are rewritten into at least and at most cardinalities etc
// Rules with multiple head atoms are rewritten into several rules (Lloyd-Topor transformation)
// normalize rules, this might add new concept and data range inclusions
// in case a rule atom uses a complex concept or data range
// we keep this inclusions separate because they are only applied to named individuals
RuleNormalizer ruleNormalizer=new RuleNormalizer(m_axioms.m_rules,axiomVisitor.m_classExpressionInclusionsAsDisjunctions,axiomVisitor.m_dataRangeInclusionsAsDisjunctions);
for (SWRLRule rule : axiomVisitor.m_rules)
ruleNormalizer.visit(rule);
// in normalization, we now simplify the disjuncts where possible (eliminate
// unnecessary conjuncts/disjuncts) and introduce fresh atomic concepts for complex
// concepts m_axioms.m_conceptInclusions contains the normalized axioms after the normalization
normalizeInclusions(axiomVisitor.m_classExpressionInclusionsAsDisjunctions,axiomVisitor.m_dataRangeInclusionsAsDisjunctions);
}
示例3: parse
import org.semanticweb.owlapi.model.OWLAxiom; //导入方法依赖的package包/类
public void parse() {
final IntegrityConstraintParser parser = new IntegrityConstraintParser();
for (final OWLAxiom a : axioms) {
a.accept(parser);
}
this.set = parser.getClassIntegrityConstraintSet();
}
示例4: entails
import org.semanticweb.owlapi.model.OWLAxiom; //导入方法依赖的package包/类
/**
* Checks entailment of a set of axioms (an ontology) against the loaded ontology.
*
* @param axioms
* the axioms that should be checked for enailment
* @return true if all axioms follow from the loaded ontology and false otherwise.
*/
public boolean entails(Set<? extends OWLAxiom> axioms) {
anonymousIndividualAxioms.clear();
for (OWLAxiom axiom : axioms) {
if (axiom.isLogicalAxiom())
if (!axiom.accept(this))
return false;
}
return checkAnonymousIndividuals();
}
示例5: removeCardinalityConstraints
import org.semanticweb.owlapi.model.OWLAxiom; //导入方法依赖的package包/类
/**
* Remove the cardinality constraints, by removing the axioms and replacing
* them with the weaker axioms without the constraints.
*
* @param ontology
*/
public static void removeCardinalityConstraints(OWLOntology ontology) {
CardinalityRemover remover = new CardinalityRemover(ontology);
for(OWLAxiom axiom : ontology.getAxioms()) {
axiom.accept(remover);
}
}
示例6: findCardinalityConstraints
import org.semanticweb.owlapi.model.OWLAxiom; //导入方法依赖的package包/类
/**
* Find the axioms with cardinality constraints. Creates also the weaker
* axioms as potential replacement.
*
* @param ontology
* @return reporter with the axiom potential changes
*/
public static CardinalityReporter findCardinalityConstraints(OWLOntology ontology) {
CardinalityReporter reporter = new CardinalityReporter(ontology);
for(OWLAxiom axiom : ontology.getAxioms()) {
axiom.accept(reporter);
}
return reporter;
}
示例7: OWLAlignmentReader
import org.semanticweb.owlapi.model.OWLAxiom; //导入方法依赖的package包/类
public OWLAlignmentReader(String owl_alignment_file) throws Exception{
//try{
OWLOntology onto_mappings = loadOntology(owl_alignment_file);
for (OWLAxiom ax : onto_mappings.getAxioms()){
//System.out.println(ax);
owlMappingAxiomVisitor.reInitValues();
ax.accept(owlMappingAxiomVisitor);
/*System.out.println(owlMappingAxiomVisitor.getIRIEntity1() + "\n" +
owlMappingAxiomVisitor.getIRIEntity2() + "\n" +
owlMappingAxiomVisitor.getMeasure() + "\n" +
owlMappingAxiomVisitor.getRelation() + "\n" +
owlMappingAxiomVisitor.getTypeMapping());
*/
if (owlMappingAxiomVisitor.getIRIEntity1()==null || owlMappingAxiomVisitor.getIRIEntity2()==null
|| owlMappingAxiomVisitor.getIRIEntity1().equals("") || owlMappingAxiomVisitor.getIRIEntity2().equals(""))
continue; //no good axioms
//Add for all axioms? I think so...
mappings.add(new MappingObjectStr(
owlMappingAxiomVisitor.getIRIEntity1(),
owlMappingAxiomVisitor.getIRIEntity2(),
owlMappingAxiomVisitor.getMeasure(),
owlMappingAxiomVisitor.getRelation(),
owlMappingAxiomVisitor.getTypeMapping()));
}
LogOutput.print("Read OWL mapping objects: " + getMappingObjectsSize());
//}
//catch (Exception e){
// System.err.println("Error reading OWL mappings file: " + e.getMessage());
//}
}
示例8: convert
import org.semanticweb.owlapi.model.OWLAxiom; //导入方法依赖的package包/类
@SuppressWarnings("static-method")
public ElkAxiom convert(OWLAxiom owlAxiom) {
return owlAxiom.accept(OWL_AXIOM_CONVERTER);
}
示例9: accept
import org.semanticweb.owlapi.model.OWLAxiom; //导入方法依赖的package包/类
@Override
public boolean accept(OWLAxiom axiom) {
Objects.requireNonNull(axiom);
return axiom.accept(this);
}
示例10: changeAxiomAnnotations
import org.semanticweb.owlapi.model.OWLAxiom; //导入方法依赖的package包/类
/**
* Update the given axiom to the new set of axiom annotation. Recreates the
* axiom with the new annotations using the given factory.
*
* @param axiom
* @param annotations
* @param factory
* @return newAxiom
*/
public static OWLAxiom changeAxiomAnnotations(OWLAxiom axiom, Set<OWLAnnotation> annotations, OWLDataFactory factory) {
final AxiomAnnotationsChanger changer = new AxiomAnnotationsChanger(annotations, factory);
final OWLAxiom newAxiom = axiom.accept(changer);
return newAxiom;
}