Java 类org.semanticweb.owlapi.model.OWLDataOneOf 实例源码

项目:owlapi-gwt    文件:NNF.java   
@Override
public OWLDataRange visit(OWLDataOneOf node) {
    if (node.getValues().size() == 1) {
        if (negated) {
            return dataFactory.getOWLDataComplementOf(node);
        } else {
            return node;
        }
    } else {
        // Encode as a data union of and return result
        Set<OWLDataOneOf> oneOfs = new HashSet<>();
        for (OWLLiteral lit : node.getValues()) {
            oneOfs.add(dataFactory.getOWLDataOneOf(lit));
        }
        return dataFactory.getOWLDataUnionOf(oneOfs).accept(this);
    }
}
项目:OntoBench    文件:OwlDataOneOfFeature.java   
@Override
public void addToOntology() {
  OWLDatatype datatype = factory.getOWLDatatype(":DataOneOf", pm);

  OWLLiteral l1 = factory.getOWLLiteral("DataOneOf_Literal1");
  OWLLiteral l2 = factory.getOWLLiteral("DataOneOf_Literal2");
  OWLLiteral l3 = factory.getOWLLiteral("DataOneOf_Literal3");

  OWLDataOneOf owlDataOneOf = factory.getOWLDataOneOf(l1, l2, l3);
  addAxiomToOntology(factory.getOWLDatatypeDefinitionAxiom(datatype, owlDataOneOf));
}
项目:OntoBench    文件:OwlDataOneOfOwl2ELFeature.java   
@Override
public void addToOntology() {
  OWLDatatype datatype = factory.getOWLDatatype(":DataOneOf_EL", pm);
  OWLLiteral singleLiteral = factory.getOWLLiteral("DataOneOf_EL_Literal1");
  OWLDataOneOf owlDataOneOf = factory.getOWLDataOneOf(singleLiteral);

  addAxiomToOntology(factory.getOWLDatatypeDefinitionAxiom(datatype, owlDataOneOf));
}
项目:OWLAx    文件:IntegrateOntologyWithProtege.java   
/**
 * create axioms for class--dataproperty----literal relation.
 * 
 * @param src
 * @param dataprop
 * @param dest
 * @return
 */
private void getClass2DataProperty2LiteralAxioms(OWLClass src, OWLDataProperty dataprop, OWLLiteral dest) {
    // Set<OWLAxiom> tmpaxioms = new HashSet<OWLAxiom>();
    OWLAxiom axiom;
    OWLDataSomeValuesFrom owlDataSomeValuesFrom;
    OWLDataHasValue owlLDataHasValue;
    OWLDataMaxCardinality owlDataMaxCardinality;
    OWLDataOneOf owldataOneOf;

    // set domain and range
    // scoped domain
    if (editor.isGenerateDomainAxiom()) {
        owlLDataHasValue = owlDataFactory.getOWLDataHasValue(dataprop, dest);
        axiom = owlDataFactory.getOWLSubClassOfAxiom(owlLDataHasValue, src);
        domainAndRangeAxioms.add(axiom);

        owlDataSomeValuesFrom = owlDataFactory.getOWLDataSomeValuesFrom(dataprop, owlDataFactory.getTopDatatype());
        axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataSomeValuesFrom, src);
        domainAndRangeAxioms.add(axiom);
    }

    if (editor.isGenerateCardinalityAxiom()) {
        owlDataMaxCardinality = owlDataFactory.getOWLDataMaxCardinality(1, dataprop,
                owlDataFactory.getTopDatatype());
        axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataFactory.getOWLThing(), owlDataMaxCardinality);
        cardinalityAxioms.add(axiom);

        // need to verify with Adila
        owlDataMaxCardinality = owlDataFactory.getOWLDataMaxCardinality(1, dataprop,
                owlDataFactory.getTopDatatype());
        axiom = owlDataFactory.getOWLSubClassOfAxiom(src, owlDataMaxCardinality);
        cardinalityAxioms.add(axiom);
    }
    // return tmpaxioms;
}
项目:HermiT-android    文件:BuiltInPropertyManager.java   
protected void axiomatizeTopDataProperty(OWLAxioms axioms) {
    OWLDatatype anonymousConstantsDatatype=m_factory.getOWLDatatype(IRI.create("internal:anonymous-constants"));
    OWLLiteral newConstant=m_factory.getOWLLiteral("internal:constant",anonymousConstantsDatatype);
    OWLDataOneOf oneOfNewConstant=m_factory.getOWLDataOneOf(newConstant);
    OWLDataSomeValuesFrom hasTopNewConstant=m_factory.getOWLDataSomeValuesFrom(m_topDataProperty,oneOfNewConstant);
    axioms.m_conceptInclusions.add(new OWLClassExpression[] { hasTopNewConstant });
}
项目:HermiT-android    文件:OWLNormalization.java   
public void visit(OWLClassAssertionAxiom axiom) {
    OWLClassExpression classExpression=axiom.getClassExpression();
    if (classExpression instanceof OWLDataHasValue) {
        OWLDataHasValue hasValue=(OWLDataHasValue)classExpression;
        addFact(m_factory.getOWLDataPropertyAssertionAxiom(hasValue.getProperty(), axiom.getIndividual(), hasValue.getValue()));
        return;
    }
    if (classExpression instanceof OWLDataSomeValuesFrom) {
        OWLDataSomeValuesFrom someValuesFrom=(OWLDataSomeValuesFrom)classExpression;
        OWLDataRange dataRange=someValuesFrom.getFiller();
        if (dataRange instanceof OWLDataOneOf) {
            OWLDataOneOf oneOf=(OWLDataOneOf)dataRange;
            if (oneOf.getValues().size()==1) {
                addFact(m_factory.getOWLDataPropertyAssertionAxiom(someValuesFrom.getProperty(),axiom.getIndividual(),oneOf.getValues().iterator().next()));
                return;
            }
        }
    }
    classExpression=positive(classExpression);
    if (!isSimple(classExpression)) {
        OWLClassExpression definition=getDefinitionFor(classExpression,m_alreadyExists);
        if (!m_alreadyExists[0])
            m_classExpressionInclusionsAsDisjunctions.add(new OWLClassExpression[] { negative(definition),classExpression });
        classExpression=definition;
    }
    addFact(m_factory.getOWLClassAssertionAxiom(classExpression,axiom.getIndividual()));
}
项目:HermiT-android    文件:OWLClausification.java   
public Object visit(OWLDataOneOf object) {
    Set<Constant> constants=new HashSet<Constant>();
    for (OWLLiteral literal : object.getValues())
        constants.add((Constant)literal.accept(this));
    Constant[] constantsArray=new Constant[constants.size()];
    constants.toArray(constantsArray);
    return ConstantEnumeration.create(constantsArray);
}
项目:Hermit_1.3.8_android    文件:BuiltInPropertyManager.java   
protected void axiomatizeTopDataProperty(OWLAxioms axioms) {
    OWLDatatype anonymousConstantsDatatype=m_factory.getOWLDatatype(IRI.create("internal:anonymous-constants"));
    OWLLiteral newConstant=m_factory.getOWLLiteral("internal:constant",anonymousConstantsDatatype);
    OWLDataOneOf oneOfNewConstant=m_factory.getOWLDataOneOf(newConstant);
    OWLDataSomeValuesFrom hasTopNewConstant=m_factory.getOWLDataSomeValuesFrom(m_topDataProperty,oneOfNewConstant);
    axioms.m_conceptInclusions.add(new OWLClassExpression[] { hasTopNewConstant });
}
项目:Hermit_1.3.8_android    文件:OWLNormalization.java   
public void visit(OWLClassAssertionAxiom axiom) {
    OWLClassExpression classExpression=axiom.getClassExpression();
    if (classExpression instanceof OWLDataHasValue) {
        OWLDataHasValue hasValue=(OWLDataHasValue)classExpression;
        addFact(m_factory.getOWLDataPropertyAssertionAxiom(hasValue.getProperty(), axiom.getIndividual(), hasValue.getValue()));
        return;
    }
    if (classExpression instanceof OWLDataSomeValuesFrom) {
        OWLDataSomeValuesFrom someValuesFrom=(OWLDataSomeValuesFrom)classExpression;
        OWLDataRange dataRange=someValuesFrom.getFiller();
        if (dataRange instanceof OWLDataOneOf) {
            OWLDataOneOf oneOf=(OWLDataOneOf)dataRange;
            if (oneOf.getValues().size()==1) {
                addFact(m_factory.getOWLDataPropertyAssertionAxiom(someValuesFrom.getProperty(),axiom.getIndividual(),oneOf.getValues().iterator().next()));
                return;
            }
        }
    }
    classExpression=positive(classExpression);
    if (!isSimple(classExpression)) {
        OWLClassExpression definition=getDefinitionFor(classExpression,m_alreadyExists);
        if (!m_alreadyExists[0])
            m_classExpressionInclusionsAsDisjunctions.add(new OWLClassExpression[] { negative(definition),classExpression });
        classExpression=definition;
    }
    addFact(m_factory.getOWLClassAssertionAxiom(classExpression,axiom.getIndividual()));
}
项目:Hermit_1.3.8_android    文件:OWLClausification.java   
public Object visit(OWLDataOneOf object) {
    Set<Constant> constants=new HashSet<Constant>();
    for (OWLLiteral literal : object.getValues())
        constants.add((Constant)literal.accept(this));
    Constant[] constantsArray=new Constant[constants.size()];
    constants.toArray(constantsArray);
    return ConstantEnumeration.create(constantsArray);
}
项目:Wolpertinger    文件:OWLNormalization.java   
public void visit(OWLClassAssertionAxiom axiom) {
    OWLClassExpression classExpression=axiom.getClassExpression();
    if (classExpression instanceof OWLDataHasValue) {
        OWLDataHasValue hasValue=(OWLDataHasValue)classExpression;
        addFact(m_factory.getOWLDataPropertyAssertionAxiom(hasValue.getProperty(), axiom.getIndividual(), hasValue.getValue()));
        return;
    }
    if (classExpression instanceof OWLDataSomeValuesFrom) {
        OWLDataSomeValuesFrom someValuesFrom=(OWLDataSomeValuesFrom)classExpression;
        OWLDataRange dataRange=someValuesFrom.getFiller();
        if (dataRange instanceof OWLDataOneOf) {
            OWLDataOneOf oneOf=(OWLDataOneOf)dataRange;
            if (oneOf.getValues().size()==1) {
                addFact(m_factory.getOWLDataPropertyAssertionAxiom(someValuesFrom.getProperty(),axiom.getIndividual(),oneOf.getValues().iterator().next()));
                return;
            }
        }
    }
    classExpression=positive(classExpression);
    if (!isSimple(classExpression)) {
        OWLClassExpression definition=getDefinitionFor(classExpression,m_alreadyExists);
        if (!m_alreadyExists[0])
            m_classExpressionInclusionsAsDisjunctions.add(new OWLClassExpression[] { negative(definition),classExpression });
        classExpression=definition;
    }
    addFact(m_factory.getOWLClassAssertionAxiom(classExpression,axiom.getIndividual()));
}
项目:HermiT-android    文件:OWLNormalization.java   
protected static boolean isAtomic(OWLDataRange dr) {
    return dr instanceof OWLDatatype || dr instanceof OWLDatatypeRestriction || dr instanceof OWLDataOneOf;
}
项目:HermiT-android    文件:OWLNormalization.java   
public OWLDataRange visit(OWLDataOneOf node) {
    return node;
}
项目:HermiT-android    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataOneOf o) {
    return o;
}
项目:HermiT-android    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataOneOf o) {
    return m_factory.getOWLDataComplementOf(o);
}
项目:HermiT-android    文件:ExpressionManager.java   
public OWLClassExpression visit(OWLDataHasValue d) {
    OWLDataOneOf nominal=m_factory.getOWLDataOneOf(d.getValue());
    return m_factory.getOWLDataSomeValuesFrom(d.getProperty(),nominal);
}
项目:HermiT-android    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataOneOf o) {
    return o;
}
项目:HermiT-android    文件:OWLClausification.java   
public void visit(OWLDataOneOf object) {
    LiteralDataRange literalRange=m_dataRangeConverter.convertDataRange(object);
    m_headAtoms.add(Atom.create((DLPredicate)literalRange,X));
}
项目:elk-reasoner    文件:AbstractElkObjectConverter.java   
@Override
public OWLDataOneOf visit(ElkDataOneOf expression) {
    return owlFactory_
            .getOWLDataOneOf(toLiteralSet(expression.getLiterals()));
}
项目:elk-reasoner    文件:OwlConverter.java   
@SuppressWarnings("static-method")
public ElkDataOneOf convert(OWLDataOneOf owlDataOneOf) {
    return new ElkDataOneOfWrap<OWLDataOneOf>(owlDataOneOf);
}
项目:elk-reasoner    文件:OwlDataRangeConverterVisitor.java   
@Override
public ElkDataOneOf visit(OWLDataOneOf owlDataOneOf) {
    return CONVERTER.convert(owlDataOneOf);
}
项目:Hermit_1.3.8_android    文件:OWLNormalization.java   
protected static boolean isAtomic(OWLDataRange dr) {
    return dr instanceof OWLDatatype || dr instanceof OWLDatatypeRestriction || dr instanceof OWLDataOneOf;
}
项目:Hermit_1.3.8_android    文件:OWLNormalization.java   
public OWLDataRange visit(OWLDataOneOf node) {
    return node;
}
项目:Hermit_1.3.8_android    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataOneOf o) {
    return o;
}
项目:Hermit_1.3.8_android    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataOneOf o) {
    return m_factory.getOWLDataComplementOf(o);
}
项目:Hermit_1.3.8_android    文件:ExpressionManager.java   
public OWLClassExpression visit(OWLDataHasValue d) {
    OWLDataOneOf nominal=m_factory.getOWLDataOneOf(d.getValue());
    return m_factory.getOWLDataSomeValuesFrom(d.getProperty(),nominal);
}
项目:Hermit_1.3.8_android    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataOneOf o) {
    return o;
}
项目:Hermit_1.3.8_android    文件:OWLClausification.java   
public void visit(OWLDataOneOf object) {
    LiteralDataRange literalRange=m_dataRangeConverter.convertDataRange(object);
    m_headAtoms.add(Atom.create((DLPredicate)literalRange,X));
}
项目:Wolpertinger    文件:OWLNormalization.java   
protected static boolean isAtomic(OWLDataRange dr) {
    return dr instanceof OWLDatatype || dr instanceof OWLDatatypeRestriction || dr instanceof OWLDataOneOf;
}
项目:Wolpertinger    文件:OWLNormalization.java   
public OWLDataRange visit(OWLDataOneOf node) {
    return node;
}
项目:Wolpertinger    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataOneOf o) {
    return o;
}
项目:Wolpertinger    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataOneOf o) {
    return m_factory.getOWLDataComplementOf(o);
}
项目:Wolpertinger    文件:ExpressionManager.java   
public OWLClassExpression visit(OWLDataHasValue d) {
    OWLDataOneOf nominal=m_factory.getOWLDataOneOf(d.getValue());
    return m_factory.getOWLDataSomeValuesFrom(d.getProperty(),nominal);
}
项目:Wolpertinger    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataOneOf o) {
    return o;
}
项目:owlapi-gwt    文件:OWLDataVisitorExAdapter.java   
@Override
public O visit(OWLDataOneOf node) {
    return doDefault(node);
}
项目:owlapi-gwt    文件:OWLObjectVisitorAdapter.java   
@Override
public void visit(OWLDataOneOf node) {
    handleDefault(node);
}
项目:owlapi-gwt    文件:OWLObjectTypeIndexProvider.java   
@Override
public void visit(OWLDataOneOf node) {
    type = DATA_TYPE_INDEX_BASE + 3;
}
项目:owlapi-gwt    文件:HashCode.java   
@Override
public void visit(OWLDataOneOf node) {
    hashCode = primes[52];
    hashCode = hashCode * MULT + node.getValues().hashCode();
}
项目:owlapi-gwt    文件:AbstractEntityRegistrationManager.java   
@Override
public void visit(@Nonnull OWLDataOneOf node) {
    for (OWLLiteral val : node.getValues()) {
        val.accept(this);
    }
}
项目:SVoNt    文件:PelletOWL2ELProfile.java   
public Object visit(OWLDataOneOf node) {
     if (node.getValues().size() != 1) {
profileViolations.add(new UseOfDataOneOfWithMultipleLiterals(getCurrentOntology(), getCurrentAxiom(), node));
     }
     return null;
   }