org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom Java Examples

The following examples show how to use org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom. 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: AbstractOwlAxiomConverterVisitor.java    From elk-reasoner with Apache License 2.0 5 votes vote down vote up
@Override
public T visit(OWLSubObjectPropertyOfAxiom axiom) {
	throw new IllegalArgumentException(
			OWLSubObjectPropertyOfAxiom.class.getSimpleName()
					+ " cannot be converted to "
					+ getTargetClass().getSimpleName());
}
 
Example #2
Source File: InferredSubObjectPropertyAxiomGeneratorIncludingIndirect.java    From robot with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
protected void addAxioms(
    @Nonnull OWLObjectProperty entity,
    @Nonnull OWLReasoner reasoner,
    @Nonnull OWLDataFactory dataFactory,
    @Nonnull Set<OWLSubObjectPropertyOfAxiom> result,
    @Nonnull Set<OWLObjectPropertyExpression> nonSimpleProperties) {
  for (OWLObjectPropertyExpression prop :
      reasoner.getSuperObjectProperties(entity, false).getFlattened()) {
    result.add(dataFactory.getOWLSubObjectPropertyOfAxiom(entity, prop));
  }
}
 
Example #3
Source File: OwlHelper.java    From owltools with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static Set<OWLObjectPropertyExpression> getSuperProperties(OWLObjectPropertyExpression prop, OWLOntology ont) {
	Set<OWLObjectPropertyExpression> result = new HashSet<>();
	Set<OWLSubObjectPropertyOfAxiom> axioms = ont.getObjectSubPropertyAxiomsForSubProperty(prop);
	for (OWLSubPropertyAxiom<OWLObjectPropertyExpression> axiom : axioms) {
		result.add(axiom.getSuperProperty());
	}
	return result;
}
 
Example #4
Source File: OwlHelper.java    From owltools with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static Set<OWLObjectPropertyExpression> getSubProperties(OWLObjectPropertyExpression prop, OWLOntology ont) {
	Set<OWLObjectPropertyExpression> results = new HashSet<>();
	Set<OWLSubObjectPropertyOfAxiom> axioms = ont.getObjectSubPropertyAxiomsForSuperProperty(prop);
	for (OWLSubObjectPropertyOfAxiom axiom : axioms) {
		results.add(axiom.getSubProperty());
	}
	return results;
}
 
Example #5
Source File: OWLGraphWrapperEdges.java    From owltools with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * returns parent properties of p in all ontologies
 * @param p
 * @return set of properties
 */
public Set<OWLObjectPropertyExpression> getSuperPropertiesOf(OWLObjectPropertyExpression p) {
	Set<OWLObjectPropertyExpression> ps = new HashSet<OWLObjectPropertyExpression>();
	for (OWLOntology ont : getAllOntologies()) {
		for (OWLSubObjectPropertyOfAxiom a : ont.getObjectSubPropertyAxiomsForSubProperty(p)) {
			ps.add(a.getSuperProperty());
		}
	}
	return ps;
}
 
Example #6
Source File: OWLGraphWrapperEdgesExtended.java    From owltools with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Returns the direct child properties of <code>prop</code> in all ontologies.
 * @param prop 		The <code>OWLObjectPropertyExpression</code> for which 
 * 					we want the direct sub-properties.
 * @return 			A <code>Set</code> of <code>OWLObjectPropertyExpression</code>s 
 * 					that are the direct sub-properties of <code>prop</code>.
    * 
    * @see #getSubPropertyClosureOf(OWLObjectPropertyExpression)
    * @see #getSubPropertyReflexiveClosureOf(OWLObjectPropertyExpression)
 */
public Set<OWLObjectPropertyExpression> getSubPropertiesOf(
		OWLObjectPropertyExpression prop) {
	Set<OWLObjectPropertyExpression> subProps = new HashSet<OWLObjectPropertyExpression>();
	for (OWLOntology ont : this.getAllOntologies()) {
		for (OWLSubObjectPropertyOfAxiom axiom : 
			    ont.getObjectSubPropertyAxiomsForSuperProperty(prop)) {
			subProps.add(axiom.getSubProperty());
		}
	}
	return subProps;
}
 
Example #7
Source File: SubPropertyOfExtractor.java    From neo4j-sparql-extension with GNU General Public License v3.0 5 votes vote down vote up
private void addAxiom(List<Rule> list, OWLSubObjectPropertyOfAxiom a) {
	if (!(a.getSubProperty().isAnonymous() ||
	      a.getSuperProperty().isAnonymous())) {
		String op1 = getString(a.getSubProperty());
		String op2 = getString(a.getSuperProperty());
		list.add(new SubPropertyOf(op1, op2));
	}
}
 
Example #8
Source File: GraphOwlVisitor.java    From SciGraph with Apache License 2.0 5 votes vote down vote up
@Override
public Void visit(OWLSubObjectPropertyOfAxiom axiom) {
  long subProperty = getOrCreateNode(getIri(axiom.getSubProperty()));
  long superProperty = getOrCreateNode(getIri(axiom.getSuperProperty()));
  getOrCreateRelationship(subProperty, superProperty, OwlRelationships.RDFS_SUB_PROPERTY_OF);
  return null;
}
 
Example #9
Source File: OWLQLNormalizer.java    From quetzal with Eclipse Public License 2.0 5 votes vote down vote up
public Set<OWLSubObjectPropertyOfAxiom> asSubObjectPropertyOfAxioms(OWLEquivalentObjectPropertiesAxiom eop ) {
	List<OWLObjectPropertyExpression> props = new ArrayList<OWLObjectPropertyExpression>(eop.getProperties());
    Set<OWLSubObjectPropertyOfAxiom> axs = new HashSet<OWLSubObjectPropertyOfAxiom>();
    for(int i = 0; i < props.size() - 1; i++) {
    	for(int j = i + 1; j < props.size(); j++) {
    		axs.add(fac.getOWLSubObjectPropertyOfAxiom(props.get(i), props.get(j)));
    		axs.add(fac.getOWLSubObjectPropertyOfAxiom(props.get(j), props.get(i)));
    	}
    }
    return axs;
}
 
Example #10
Source File: OwlConverter.java    From elk-reasoner with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("static-method")
public ElkSubObjectPropertyOfAxiom convert(
		OWLSubObjectPropertyOfAxiom owlSubObjectPropertyOfAxiom) {
	return new ElkSubObjectPropertyOfAxiomWrap<OWLSubObjectPropertyOfAxiom>(
			owlSubObjectPropertyOfAxiom);
}
 
Example #11
Source File: OwlAxiomConverterVisitor.java    From elk-reasoner with Apache License 2.0 4 votes vote down vote up
@Override
public ElkAxiom visit(
		OWLSubObjectPropertyOfAxiom owlSubObjectPropertyOfAxiom) {
	return CONVERTER.convert(owlSubObjectPropertyOfAxiom);
}
 
Example #12
Source File: OwlObjectPropertyAxiomConverterVisitor.java    From elk-reasoner with Apache License 2.0 4 votes vote down vote up
@Override
public ElkObjectPropertyAxiom visit(
		OWLSubObjectPropertyOfAxiom owlSubObjectPropertyOfAxiom) {
	return CONVERTER.convert(owlSubObjectPropertyOfAxiom);
}
 
Example #13
Source File: FailingOwlAxiomVisitor.java    From elk-reasoner with Apache License 2.0 4 votes vote down vote up
@Override
public void visit(OWLSubObjectPropertyOfAxiom axiom) {
	defaultVisit(axiom);
}
 
Example #14
Source File: AxiomAnnotationTools.java    From owltools with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public OWLAxiom visit(OWLSubObjectPropertyOfAxiom axiom) {
	return factory.getOWLSubObjectPropertyOfAxiom(axiom.getSubProperty(), axiom.getSuperProperty(), annotations);
}
 
Example #15
Source File: CardinalityContraintsTools.java    From owltools with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void visit(OWLSubObjectPropertyOfAxiom axiom) {
}
 
Example #16
Source File: SubPropertyOfExtractor.java    From neo4j-sparql-extension with GNU General Public License v3.0 4 votes vote down vote up
private void addObjectAxioms(List<Rule> list,
		Set<OWLSubObjectPropertyOfAxiom> axs) {
	for (OWLSubObjectPropertyOfAxiom a : axs) {
		addAxiom(list, a);
	}
}