org.semanticweb.owlapi.model.OWLObjectPropertyDomainAxiom Java Examples

The following examples show how to use org.semanticweb.owlapi.model.OWLObjectPropertyDomainAxiom. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SimpleOntology.java    From mobi with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public Set<ObjectProperty> getAllClassObjectProperties(IRI iri) {
    org.semanticweb.owlapi.model.IRI classIRI = SimpleOntologyValues.owlapiIRI(iri);
    if (owlOntology.containsClassInSignature(classIRI)) {
        OWLClass owlClass = owlManager.getOWLDataFactory().getOWLClass(classIRI);
        Node<OWLClass> equivalentClasses = owlReasoner.getEquivalentClasses(owlClass);
        NodeSet<OWLClass> superClasses = owlReasoner.getSuperClasses(owlClass);
        return owlOntology.objectPropertiesInSignature(Imports.INCLUDED)
                .filter(property -> {
                    Set<OWLObjectPropertyDomainAxiom> domains = owlOntology.axioms(
                            OWLObjectPropertyDomainAxiom.class, OWLObjectPropertyExpression.class, property,
                            Imports.INCLUDED, Navigation.IN_SUB_POSITION).collect(Collectors.toSet());
                    return hasClassAsDomain(domains.stream(), classIRI, equivalentClasses, superClasses)
                            || hasNoDomain(domains.stream());
                })
                .map(SimpleOntologyValues::mobiObjectProperty)
                .collect(Collectors.toSet());
    }
    throw new IllegalArgumentException("Class not found in ontology");
}
 
Example #2
Source File: SimpleOntology.java    From mobi with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public Set<ObjectProperty> getAllNoDomainObjectProperties() {
    return owlOntology.objectPropertiesInSignature(Imports.INCLUDED)
            .filter(property -> hasNoDomain(owlOntology.axioms(OWLObjectPropertyDomainAxiom.class,
                    OWLObjectPropertyExpression.class, property, Imports.INCLUDED, Navigation.IN_SUB_POSITION)))
            .map(SimpleOntologyValues::mobiObjectProperty)
            .collect(Collectors.toSet());
}
 
Example #3
Source File: AbstractOwlAxiomConverterVisitor.java    From elk-reasoner with Apache License 2.0 5 votes vote down vote up
@Override
public T visit(OWLObjectPropertyDomainAxiom axiom) {
	throw new IllegalArgumentException(
			OWLObjectPropertyDomainAxiom.class.getSimpleName()
					+ " cannot be converted to "
					+ getTargetClass().getSimpleName());
}
 
Example #4
Source File: AbstractElkObjectConverter.java    From elk-reasoner with Apache License 2.0 4 votes vote down vote up
@Override
public OWLObjectPropertyDomainAxiom visit(
		ElkObjectPropertyDomainAxiom axiom) {
	return owlFactory_.getOWLObjectPropertyDomainAxiom(
			convert(axiom.getProperty()), convert(axiom.getDomain()));
}
 
Example #5
Source File: OwlConverter.java    From elk-reasoner with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("static-method")
public ElkObjectPropertyDomainAxiom convert(
		OWLObjectPropertyDomainAxiom owlObjectPropertyDomainAxiom) {
	return new ElkObjectPropertyDomainAxiomWrap<OWLObjectPropertyDomainAxiom>(
			owlObjectPropertyDomainAxiom);
}
 
Example #6
Source File: OwlAxiomConverterVisitor.java    From elk-reasoner with Apache License 2.0 4 votes vote down vote up
@Override
public ElkAxiom visit(
		OWLObjectPropertyDomainAxiom owlObjectPropertyDomainAxiom) {
	return CONVERTER.convert(owlObjectPropertyDomainAxiom);
}
 
Example #7
Source File: OwlObjectPropertyAxiomConverterVisitor.java    From elk-reasoner with Apache License 2.0 4 votes vote down vote up
@Override
public ElkObjectPropertyAxiom visit(
		OWLObjectPropertyDomainAxiom owlObjectPropertyDomainAxiom) {
	return CONVERTER.convert(owlObjectPropertyDomainAxiom);
}
 
Example #8
Source File: FailingOwlAxiomVisitor.java    From elk-reasoner with Apache License 2.0 4 votes vote down vote up
@Override
public void visit(OWLObjectPropertyDomainAxiom axiom) {
	defaultVisit(axiom);
}
 
Example #9
Source File: AxiomAnnotationTools.java    From owltools with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public OWLAxiom visit(OWLObjectPropertyDomainAxiom axiom) {
	return factory.getOWLObjectPropertyDomainAxiom(axiom.getProperty(), axiom.getDomain(), annotations);
}
 
Example #10
Source File: CardinalityContraintsTools.java    From owltools with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void visit(OWLObjectPropertyDomainAxiom axiom) {
}