org.semanticweb.owlapi.model.OWLDataPropertyExpression Java Examples

The following examples show how to use org.semanticweb.owlapi.model.OWLDataPropertyExpression. 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<DataProperty> getAllClassDataProperties(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.dataPropertiesInSignature(Imports.INCLUDED)
                .filter(property -> {
                    Set<OWLDataPropertyDomainAxiom> domains = owlOntology.axioms(OWLDataPropertyDomainAxiom.class,
                            OWLDataPropertyExpression.class, property, Imports.INCLUDED,
                            Navigation.IN_SUB_POSITION).collect(Collectors.toSet());
                    return hasClassAsDomain(domains.stream(), classIRI, equivalentClasses, superClasses)
                            || hasNoDomain(domains.stream());
                })
                .map(SimpleOntologyValues::mobiDataProperty)
                .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<DataProperty> getAllNoDomainDataProperties() {
    return owlOntology.dataPropertiesInSignature(Imports.INCLUDED)
            .filter(property -> hasNoDomain(owlOntology.axioms(OWLDataPropertyDomainAxiom.class,
                    OWLDataPropertyExpression.class, property, Imports.INCLUDED,
                    Navigation.IN_SUB_POSITION)))
            .map(SimpleOntologyValues::mobiDataProperty)
            .collect(Collectors.toSet());
}
 
Example #3
Source File: ElkReasoner.java    From elk-reasoner with Apache License 2.0 5 votes vote down vote up
@Override
public NodeSet<OWLDataProperty> getDisjointDataProperties(
		OWLDataPropertyExpression arg0)
		throws InconsistentOntologyException, FreshEntitiesException,
		ReasonerInterruptedException, TimeOutException {
	LOGGER_.trace("getDisjointDataProperties(OWLDataPropertyExpression)");

	checkInterrupted();
	// TODO Provide implementation
	throw unsupportedOwlApiMethod(
			"getDisjointDataProperties(OWLDataPropertyExpression)");
}
 
Example #4
Source File: AbstractElkObjectConverter.java    From elk-reasoner with Apache License 2.0 5 votes vote down vote up
Set<OWLDataPropertyExpression> toDataPropertyExpressionSet(
		List<? extends ElkDataPropertyExpression> input) {
	Set<OWLDataPropertyExpression> result = new HashSet<OWLDataPropertyExpression>(
			input.size());
	for (ElkDataPropertyExpression next : input) {
		result.add(convert(next));
	}
	return result;
}
 
Example #5
Source File: ElkEquivalentDataPropertiesAxiomWrap.java    From elk-reasoner with Apache License 2.0 5 votes vote down vote up
@Override
public List<? extends ElkDataPropertyExpression> getDataPropertyExpressions() {
	List<ElkDataPropertyExpression> result = new ArrayList<ElkDataPropertyExpression>();
	for (OWLDataPropertyExpression dpe : this.owlObject.getProperties()) {
		result.add(converter.convert(dpe));
	}
	return result;
}
 
Example #6
Source File: ElkDisjointDataPropertiesAxiomWrap.java    From elk-reasoner with Apache License 2.0 5 votes vote down vote up
@Override
public List<? extends ElkDataPropertyExpression> getDataPropertyExpressions() {
	List<ElkDataPropertyExpression> result = new ArrayList<ElkDataPropertyExpression>();
	for (OWLDataPropertyExpression dpe : this.owlObject.getProperties()) {
		result.add(converter.convert(dpe));
	}
	return result;
}
 
Example #7
Source File: ElkHasKeyAxiomWrap.java    From elk-reasoner with Apache License 2.0 5 votes vote down vote up
@Override
public List<? extends ElkDataPropertyExpression> getDataPropertyExpressions() {
	List<ElkDataPropertyExpression> dpes = new ArrayList<ElkDataPropertyExpression>(
			this.owlObject.getDataPropertyExpressions().size());
	for (OWLDataPropertyExpression dpe : this.owlObject
			.getDataPropertyExpressions()) {
		dpes.add(converter.convert(dpe));
	}

	return dpes;
}
 
Example #8
Source File: ElkConverter.java    From elk-reasoner with Apache License 2.0 5 votes vote down vote up
@Override
public OWLDataPropertyExpression convert(ElkDataPropertyExpression input) {
	if (input instanceof ElkDataPropertyExpressionWrap<?>) {
		return ((ElkDataPropertyExpressionWrap<?>) input).getOwlObject();
	}
	// else
	return (OWLDataPropertyExpression) input.accept(this);
}
 
Example #9
Source File: GraphReasoner.java    From owltools with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public NodeSet<OWLDataProperty> getDisjointDataProperties(
		OWLDataPropertyExpression pe) throws InconsistentOntologyException,
		FreshEntitiesException, ReasonerInterruptedException,
		TimeOutException {
	// TODO Auto-generated method stub
	return null;
}
 
Example #10
Source File: OwlConverter.java    From elk-reasoner with Apache License 2.0 4 votes vote down vote up
public ElkDataPropertyExpression convert(
		OWLDataPropertyExpression owlDataPropertyExpression) {
	return this.convert(owlDataPropertyExpression.asOWLDataProperty());
}
 
Example #11
Source File: DelegatingOWLReasoner.java    From elk-reasoner with Apache License 2.0 4 votes vote down vote up
@Override
public NodeSet<OWLDataProperty> getDisjointDataProperties(
		OWLDataPropertyExpression pe) {
	return delegate_.getDisjointDataProperties(pe);
}
 
Example #12
Source File: LazyExpressionMaterializingReasoner.java    From owltools with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public NodeSet<OWLDataProperty> getDisjointDataProperties(
		OWLDataPropertyExpression pe) throws InconsistentOntologyException,
		FreshEntitiesException, ReasonerInterruptedException,
		TimeOutException {
	return getWrappedReasoner().getDisjointDataProperties(pe);
}
 
Example #13
Source File: AbstractExtractor.java    From neo4j-sparql-extension with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Returns the URI of a data property.
 *
 * @param property the data property
 * @return URI
 */
protected static String getString(OWLDataPropertyExpression property) {
	return property.asOWLDataProperty().getIRI().toURI().toASCIIString();
}
 
Example #14
Source File: AbstractElkObjectConverter.java    From elk-reasoner with Apache License 2.0 votes vote down vote up
abstract OWLDataPropertyExpression convert(ElkDataPropertyExpression input);