private void importObjectProperties(OWLOntology o, Authorizations authorizations) { for (OWLObjectProperty objectProperty : o.getObjectPropertiesInSignature()) { importObjectProperty(o, objectProperty, authorizations); } }
@Override protected Relationship importObjectProperty( OWLOntology o, OWLObjectProperty objectProperty, Authorizations authorizations ) { InMemoryRelationship relationship = (InMemoryRelationship) super.importObjectProperty( o, objectProperty, authorizations ); relationshipsCache.get(PUBLIC_ONTOLOGY_CACHE_KEY).put(relationship.getIRI(), relationship); return relationship; }
private Relationship getParentObjectProperty( OWLOntology o, OWLObjectProperty objectProperty, Authorizations authorizations ) { Collection<OWLObjectPropertyExpression> superProperties = EntitySearcher.getSuperProperties(objectProperty, o); if (superProperties.size() == 0) { return getOrCreateTopObjectPropertyRelationship(authorizations); } else if (superProperties.size() == 1) { OWLObjectPropertyExpression superPropertyExpr = superProperties.iterator().next(); OWLObjectProperty superProperty = superPropertyExpr.asOWLObjectProperty(); String superPropertyUri = superProperty.getIRI().toString(); Relationship parent = getRelationshipByIRI(superPropertyUri, PUBLIC); if (parent != null) { return parent; } parent = importObjectProperty(o, superProperty, authorizations); if (parent == null) { throw new VisalloException("Could not find or create parent: " + superProperty); } return parent; } else { throw new VisalloException("Unhandled multiple super properties. Found " + superProperties.size() + ", expected 0 or 1."); } }