org.semanticweb.owlapi.model.OWLPropertyDomainAxiom Java Examples

The following examples show how to use org.semanticweb.owlapi.model.OWLPropertyDomainAxiom. 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 5 votes vote down vote up
private <T extends OWLPropertyDomainAxiom<?>> boolean hasClassAsDomain(Stream<T> stream,
                                                                       org.semanticweb.owlapi.model.IRI iri,
                                                                       Node<OWLClass> equivalentClasses,
                                                                       NodeSet<OWLClass> superClasses) {
    return stream.map(HasDomain::getDomain)
            .filter(AsOWLClass::isOWLClass)
            .map(AsOWLClass::asOWLClass)
            .anyMatch(owlClass -> owlClass.getIRI().equals(iri) || equivalentClasses.contains(owlClass)
                    || superClasses.containsEntity(owlClass));
}
 
Example #2
Source File: OWLGraphWrapperExtended.java    From owltools with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * It returns the (first) value of the domain tag
 * 
 * @param prop
 * @return domain string or null
 */
public String getDomain(OWLObjectProperty prop){
	for (OWLPropertyDomainAxiom<?> axiom : sourceOntology.getObjectPropertyDomainAxioms(prop)) {
		OWLClassExpression ce = axiom.getDomain();
		return getIdentifier(ce);
	}
	return null;
}
 
Example #3
Source File: SimpleOntology.java    From mobi with GNU Affero General Public License v3.0 4 votes vote down vote up
private <T extends OWLPropertyDomainAxiom<?>> boolean hasNoDomain(Stream<T> stream) {
    return stream.map(HasDomain::getDomain).count() == 0;
}