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

项目:minerva    文件:CoreMolecularModelManager.java   
public void removeDataProperty(ModelContainer model,
        OWLNamedIndividual i, OWLDataProperty prop, OWLLiteral literal,
        METADATA metadata) {
    OWLAxiom toRemove = null;
    Set<OWLDataPropertyAssertionAxiom> existing = model.getAboxOntology().getDataPropertyAssertionAxioms(i);
    for (OWLDataPropertyAssertionAxiom ax : existing) {
        if (prop.equals(ax.getProperty()) && literal.equals(ax.getObject())) {
            toRemove = ax;
            break;
        }
    }

    if (toRemove != null) {
        removeAxiom(model, toRemove, metadata);
    }
}
项目:HermiT-android    文件:EntailmentChecker.java   
public void visit(OWLDataPropertyAssertionAxiom axiom) {
    if (!axiom.getSubject().isAnonymous()) {
        return; // not interesting for the anonymous individual forest
    }
    OWLAnonymousIndividual sub=axiom.getSubject().asOWLAnonymousIndividual();
    nodes.add(sub);
    OWLClassExpression c=factory.getOWLDataHasValue(axiom.getProperty(),axiom.getObject());
    if (nodelLabels.containsKey(sub)) {
        nodelLabels.get(sub).add(c);
    }
    else {
        Set<OWLClassExpression> labels=new HashSet<OWLClassExpression>();
        labels.add(c);
        nodelLabels.put(sub,labels);
    }
}
项目:Hermit_1.3.8_android    文件:EntailmentChecker.java   
public void visit(OWLDataPropertyAssertionAxiom axiom) {
    if (!axiom.getSubject().isAnonymous()) {
        return; // not interesting for the anonymous individual forest
    }
    OWLAnonymousIndividual sub=axiom.getSubject().asOWLAnonymousIndividual();
    nodes.add(sub);
    OWLClassExpression c=factory.getOWLDataHasValue(axiom.getProperty(),axiom.getObject());
    if (nodelLabels.containsKey(sub)) {
        nodelLabels.get(sub).add(c);
    }
    else {
        Set<OWLClassExpression> labels=new HashSet<OWLClassExpression>();
        labels.add(c);
        nodelLabels.put(sub,labels);
    }
}
项目:SciGraph    文件:GraphOwlVisitor.java   
@Override
public Void visit(OWLDataPropertyAssertionAxiom axiom) {
  long individual = getOrCreateNode(getIri(axiom.getSubject()));
  OWLDataProperty property = axiom.getProperty().asOWLDataProperty();
  // TODO: fix this Set<OWLDataRange> ranges = property.getRanges(ontology);
  // Except without the ontology we can't verify the range...
  String propertyName = property.getIRI().toString();
  Optional<Object> literal = OwlApiUtils.getTypedLiteralValue(axiom.getObject());

  if (literal.isPresent()) {
    graph.setNodeProperty(individual, propertyName, literal.get());
    if (mappedProperties.containsKey(propertyName)) {
      graph.addNodeProperty(individual, mappedProperties.get(propertyName), literal.get());
    }
  }
  return null;
}
项目:Pellet4Android    文件:OntologyManager.java   
/**
 * Set the following assertion DatatypePropertyAssertion( property
 * individual value ) If the properties or/and individual do not exist, they
 * will be created If the property is functional, previous values are
 * deleted.
 * 
 * @param individual
 *            owl named individual
 * @param property
 *            datatype property IRI
 * @param value
 *            datatype values as integer
 */

public void addDataTypePropertyValue(String individual, String property,
        int value) {
    OWLDataFactory factory = ontology.getOWLOntologyManager()
            .getOWLDataFactory();
    OWLDataPropertyAssertionAxiom axiom = null;
    OWLDataProperty dataProp = factory.getOWLDataProperty(IRI
            .create(property));
    OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI
            .create(individual));
    if (dataProp.isFunctional(ontology))
        deleteAllValuesOfProperty(individual, property);
    axiom = factory.getOWLDataPropertyAssertionAxiom(dataProp, ind, value);
    ontology.getOWLOntologyManager().addAxiom(ontology, axiom);
    reasoner.flush();

}
项目:Pellet4Android    文件:OntologyManager.java   
/**
 * Set the following assertion DatatypePropertyAssertion( property
 * individual value ) If the properties or/and individual do not exist, they
 * will be created If the property is functional, previous values are
 * deleted.
 * 
 * @param individual
 *            owl named individual
 * @param property
 *            datatype property IRI
 * @param value
 *            datatype values
 */

public void addDataTypePropertyValue(String individual, String property,
        float value) {
    OWLDataFactory factory = ontology.getOWLOntologyManager()
            .getOWLDataFactory();
    OWLDataPropertyAssertionAxiom axiom = null;
    OWLDataProperty dataProp = factory.getOWLDataProperty(IRI
            .create(property));
    OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI
            .create(individual));
    if (dataProp.isFunctional(ontology))
        deleteAllValuesOfProperty(individual, property);
    axiom = factory.getOWLDataPropertyAssertionAxiom(dataProp, ind, value);
    ontology.getOWLOntologyManager().addAxiom(ontology, axiom);
    reasoner.flush();

}
项目:Pellet4Android    文件:OntologyManager.java   
/**
 * Set the following assertion DatatypePropertyAssertion( property
 * individual value ) If the properties or/and individual do not exist, they
 * will be created If the property is functional, previous values are
 * deleted.
 * 
 * @param individual
 *            owl named individual
 * @param property
 *            datatype property IRI
 * @param value
 *            datatype values
 */

public void addDataTypePropertyValue(String individual, String property,
        boolean value) {
    OWLDataFactory factory = ontology.getOWLOntologyManager()
            .getOWLDataFactory();
    OWLDataPropertyAssertionAxiom axiom = null;
    OWLDataProperty dataProp = factory.getOWLDataProperty(IRI
            .create(property));
    OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI
            .create(individual));
    if (dataProp.isFunctional(ontology))
        deleteAllValuesOfProperty(individual, property);

    axiom = factory.getOWLDataPropertyAssertionAxiom(dataProp, ind, value);
    ontology.getOWLOntologyManager().addAxiom(ontology, axiom);
    reasoner.flush();

}
项目:Pellet4Android    文件:OntologyManager.java   
/**
 * Set the following assertion DatatypePropertyAssertion( property
 * individual value ) If the properties or/and individual do not exist, they
 * will be created If the property is functional, previous values are
 * deleted.
 * 
 * @param individual
 *            owl named individual
 * @param property
 *            datatype property IRI
 * @param value
 *            datatype values
 */

public void addDataTypePropertyValue(String individual, String property,
        double value) {
    OWLDataFactory factory = ontology.getOWLOntologyManager()
            .getOWLDataFactory();
    OWLDataPropertyAssertionAxiom axiom = null;
    OWLDataProperty dataProp = factory.getOWLDataProperty(IRI
            .create(property));
    OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI
            .create(individual));
    if (dataProp.isFunctional(ontology))
        deleteAllValuesOfProperty(individual, property);

    axiom = factory.getOWLDataPropertyAssertionAxiom(dataProp, ind, value);
    ontology.getOWLOntologyManager().addAxiom(ontology, axiom);
    reasoner.flush();

}
项目:Pellet4Android    文件:OntologyManager.java   
/**
 * Set the following assertion DatatypePropertyAssertion( property
 * individual value ) If the properties or/and individual do not exist, they
 * will be created If the property is functional, previous values are
 * deleted.
 * 
 * @param individual
 *            owl named individual
 * @param property
 *            datatype property IRI
 * @param value
 *            datatype values
 */

public void addDataTypePropertyValue(String individual, String property,
        String value) {
    OWLDataFactory factory = ontology.getOWLOntologyManager()
            .getOWLDataFactory();
    OWLDataPropertyAssertionAxiom axiom = null;
    OWLDataProperty dataProp = factory.getOWLDataProperty(IRI
            .create(property));
    OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI
            .create(individual));
    if (dataProp.isFunctional(ontology))
        deleteAllValuesOfProperty(individual, property);

    axiom = factory.getOWLDataPropertyAssertionAxiom(dataProp, ind, value);
    ontology.getOWLOntologyManager().addAxiom(ontology, axiom);
    reasoner.flush();

}
项目:Pellet4Android    文件:OntologyManager.java   
/**
     * Set the following assertion DatatypePropertyAssertion( property
     * individual value ) If the properties or/and individual do not exist, they
     * will be created If the property is functional, previous values are
     * deleted.
     * 
     * @param individual
     *            owl named individual
     * @param property
     *            datatype property IRI
     * @param value
     *            datatype values
     */

    public void addDataTypePropertyValue(String individual, String property,
            String value, String type) {
        OWLDataFactory factory = ontology.getOWLOntologyManager()
                .getOWLDataFactory();
        OWLDataPropertyAssertionAxiom axiom = null;
        OWLDataProperty dataProp = factory.getOWLDataProperty(IRI
                .create(property));
        OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI
                .create(individual));
        if (dataProp.isFunctional(ontology))
            deleteAllValuesOfProperty(individual, property);

//      OWLLiteral literal = new OWLLiteralImpl(factory, value,
//              factory.getOWLDatatype(IRI.create(type)));

        OWLLiteral literal  = new OWLLiteralImplNoCompression(value, "", factory.getOWLDatatype(IRI.create(type)));

        axiom = factory
                .getOWLDataPropertyAssertionAxiom(dataProp, ind, literal);
        ontology.getOWLOntologyManager().addAxiom(ontology, axiom);
        reasoner.flush();

    }
项目:jopa    文件:AxiomAdapterTest.java   
@Test
public void toOwlDataPropertyAxiomUsesLanguageTagSpecifiedInAssertion() {
    final Axiom<String> ax = new AxiomImpl<>(NamedResource.create(INDIVIDUAL),
            Assertion.createDataPropertyAssertion(PROPERTY, "cs", false), new Value<>("cestina"));
    final OWLAxiom axiom = adapter.toOwlDataPropertyAssertionAxiom(ax);
    final OWLDataPropertyAssertionAxiom dpAxiom = (OWLDataPropertyAssertionAxiom) axiom;
    final OWLLiteral literal = dpAxiom.getObject();
    assertEquals(ax.getValue().getValue(), literal.getLiteral());
    assertEquals("cs", literal.getLang());
}
项目:jopa    文件:AxiomAdapterTest.java   
@Test
public void toOwlDataPropertyAxiomUsesGloballyConfiguredLanguageWhenItIsNotSpecifiedInAssertion() {
    final Axiom<String> ax = new AxiomImpl<>(NamedResource.create(INDIVIDUAL),
            Assertion.createDataPropertyAssertion(PROPERTY, false), new Value<>("english"));
    final OWLAxiom axiom = adapter.toOwlDataPropertyAssertionAxiom(ax);
    final OWLDataPropertyAssertionAxiom dpAxiom = (OWLDataPropertyAssertionAxiom) axiom;
    final OWLLiteral literal = dpAxiom.getObject();
    assertEquals(ax.getValue().getValue(), literal.getLiteral());
    assertEquals(LANG, literal.getLang());
}
项目:HermiT-android    文件:EntailmentChecker.java   
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());
}
项目:elk-reasoner    文件:AbstractElkObjectConverter.java   
@Override
public OWLDataPropertyAssertionAxiom visit(
        ElkDataPropertyAssertionAxiom axiom) {
    return owlFactory_.getOWLDataPropertyAssertionAxiom(
            convert(axiom.getProperty()), convert(axiom.getSubject()),
            convert(axiom.getObject()));
}
项目:elk-reasoner    文件:AbstractOwlAxiomConverterVisitor.java   
@Override
public T visit(OWLDataPropertyAssertionAxiom axiom) {
    throw new IllegalArgumentException(
            OWLDataPropertyAssertionAxiom.class.getSimpleName()
                    + " cannot be converted to "
                    + getTargetClass().getSimpleName());
}
项目:Hermit_1.3.8_android    文件:EntailmentChecker.java   
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());
}
项目:jcel    文件:AxiomTranslator.java   
@Override
public Set<ComplexIntegerAxiom> visit(OWLDataPropertyAssertionAxiom axiom) {
    Objects.requireNonNull(axiom);
    Integer propertyId = translateDataProperty(asOWLDataProperty(axiom.getProperty()));
    Integer subjectId = translateIndividual(axiom.getSubject());
    Integer objectId = translateLiteral(axiom.getObject());
    ComplexIntegerAxiom ret = getAxiomFactory().createDataPropertyAssertionAxiom(propertyId, subjectId, objectId,
            translateAnnotations(axiom.getAnnotations()));
    return Collections.singleton(ret);
}
项目:owlapi-gwt    文件:HashCode.java   
@Override
public void visit(OWLDataPropertyAssertionAxiom axiom) {
    hashCode = primes[2];
    hashCode = hashCode * MULT + axiom.getSubject().hashCode();
    hashCode = hashCode * MULT + axiom.getProperty().hashCode();
    hashCode = hashCode * MULT + axiom.getObject().hashCode();
    hashCode = hashCode * MULT + axiom.getAnnotations().hashCode();
}
项目:owlapi-gwt    文件:OWLDataPropertyAssertionAxiomImpl.java   
@Override
public OWLDataPropertyAssertionAxiom getAxiomWithoutAnnotations() {
    if (!isAnnotated()) {
        return this;
    }
    return new OWLDataPropertyAssertionAxiomImpl(getSubject(),
            getProperty(), getObject(), NO_ANNOTATIONS);
}
项目:owlapi-gwt    文件:OWLDataPropertyAssertionAxiomImpl.java   
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (!super.equals(obj)) {
        return false;
    }
    return obj instanceof OWLDataPropertyAssertionAxiom;
}
项目:owlapi-gwt    文件:AbstractEntityRegistrationManager.java   
@Override
public void visit(@Nonnull OWLDataPropertyAssertionAxiom axiom) {
    axiom.getSubject().accept(this);
    axiom.getProperty().accept(this);
    axiom.getObject().accept(this);
    processAxiomAnnotations(axiom);
}
项目:jopa    文件:IntegrityConstraintParser.java   
public void visit(OWLDataPropertyAssertionAxiom axiom) {
    notSupported(axiom);
}
项目:HermiT-android    文件:BuiltInPropertyManager.java   
public void visit(OWLDataPropertyAssertionAxiom object) {
    visitProperty(object.getProperty());
}
项目:HermiT-android    文件:OWLNormalization.java   
public void visit(OWLDataPropertyAssertionAxiom axiom) {
    checkTopDataPropertyUse(axiom.getProperty(),axiom);
    addFact(axiom);
}
项目:HermiT-android    文件:OWLAxiomsExpressivity.java   
public void visit(OWLDataPropertyAssertionAxiom object) {
    m_hasDatatypes=true;
}
项目:HermiT-android    文件:OWLClausification.java   
public void visit(OWLDataPropertyAssertionAxiom object) {
    Constant targetValue=(Constant)object.getObject().accept(m_dataRangeConverter);
    m_positiveFacts.add(getRoleAtom(object.getProperty(),getIndividual(object.getSubject()),targetValue));
}
项目:HermiT-android    文件:ReducedABoxOnlyClausification.java   
public void visit(OWLDataPropertyAssertionAxiom object) {
    Constant targetValue=getConstant(object.getObject());
    m_positiveFacts.add(getRoleAtom(object.getProperty(),getIndividual(object.getSubject()),targetValue));
}
项目:elk-reasoner    文件:OwlConverter.java   
@SuppressWarnings("static-method")
public ElkDataPropertyAssertionAxiom convert(
        OWLDataPropertyAssertionAxiom owlDataPropertyAssertionAxiom) {
    return new ElkDataPropertyAssertionAxiomWrap<OWLDataPropertyAssertionAxiom>(
            owlDataPropertyAssertionAxiom);
}
项目:elk-reasoner    文件:OwlAxiomConverterVisitor.java   
@Override
public ElkAxiom visit(OWLDataPropertyAssertionAxiom axiom) {
    return CONVERTER.convert(axiom);
}
项目:elk-reasoner    文件:OwlIndividualAxiomConverterVisitor.java   
@Override
public ElkAssertionAxiom visit(OWLDataPropertyAssertionAxiom axiom) {
    return CONVERTER.convert(axiom);
}
项目:elk-reasoner    文件:FailingOwlAxiomVisitor.java   
@Override
public void visit(OWLDataPropertyAssertionAxiom axiom) {
    defaultVisit(axiom);
}
项目:Hermit_1.3.8_android    文件:BuiltInPropertyManager.java   
public void visit(OWLDataPropertyAssertionAxiom object) {
    visitProperty(object.getProperty());
}
项目:Hermit_1.3.8_android    文件:OWLNormalization.java   
public void visit(OWLDataPropertyAssertionAxiom axiom) {
    checkTopDataPropertyUse(axiom.getProperty(),axiom);
    addFact(axiom);
}
项目:Hermit_1.3.8_android    文件:OWLAxiomsExpressivity.java   
public void visit(OWLDataPropertyAssertionAxiom object) {
    m_hasDatatypes=true;
}
项目:Hermit_1.3.8_android    文件:OWLClausification.java   
public void visit(OWLDataPropertyAssertionAxiom object) {
    Constant targetValue=(Constant)object.getObject().accept(m_dataRangeConverter);
    m_positiveFacts.add(getRoleAtom(object.getProperty(),getIndividual(object.getSubject()),targetValue));
}
项目:Hermit_1.3.8_android    文件:ReducedABoxOnlyClausification.java   
public void visit(OWLDataPropertyAssertionAxiom object) {
    Constant targetValue=getConstant(object.getObject());
    m_positiveFacts.add(getRoleAtom(object.getProperty(),getIndividual(object.getSubject()),targetValue));
}
项目:owltools    文件:AxiomAnnotationTools.java   
@Override
public OWLAxiom visit(OWLDataPropertyAssertionAxiom axiom) {
    return factory.getOWLDataPropertyAssertionAxiom(axiom.getProperty(), axiom.getSubject(), axiom.getObject(), annotations);
}
项目:owltools    文件:CardinalityContraintsTools.java   
@Override
public void visit(OWLDataPropertyAssertionAxiom axiom) {
}
项目:Wolpertinger    文件:OWLNormalization.java   
public void visit(OWLDataPropertyAssertionAxiom axiom) {
    checkTopDataPropertyUse(axiom.getProperty(),axiom);
    addFact(axiom);
}
项目:born    文件:CycleDetector.java   
@Override
public Boolean visit(OWLDataPropertyAssertionAxiom axiom) {
    return true;
}