public boolean equals(Object obj) { if(obj == this) { return true; } if(!(obj instanceof OWLImportsDeclaration)) { return false; } OWLImportsDeclaration other = (OWLImportsDeclaration) obj; return this.iri.equals(other.getIRI()); }
private OWLOntology loadImports(OWLImportsDeclaration declaration) throws OWLOntologyCreationException { importsLoadCount++; OWLOntology ont = null; try { ont = loadOntology(declaration.getIRI()); } catch (OWLOntologyCreationException e) { if (!silentMissingImportsHandling) { throw e; } else { // Silent MissingImportEvent evt = new MissingImportEvent(declaration.getURI(), e); fireMissingImportEvent(evt); } } finally { importsLoadCount--; } return ont; }
private String getMismatchedImportMessage() { StringBuilder sb = new StringBuilder(); sb.append("<html><body>"); sb.append("The imports URI:<br>"); sb.append("<font color=\"blue\">"); sb.append(decl.getURI()); sb.append("</font>"); sb.append("<br>"); sb.append("does not match the URI of the ontology that has been imported:<br>"); sb.append("<font color=\"blue\">"); OWLOntology ont = eKit.getOWLModelManager().getOWLOntologyManager().getImportedOntology(decl); // @@TODO what about anonymous ontologies? sb.append(ont == null ? "(Not loaded)" : ont.getOntologyID().getDefaultDocumentIRI()); sb.append("</font><br><br>"); sb.append("Do you want to fix the mismatch by modifying the imports statement?"); sb.append("</body></html>"); return sb.toString(); }
private String getMismatchedImportMessage() { StringBuilder sb = new StringBuilder(); sb.append("<html><body>"); sb.append("The imports URI:<br>"); sb.append("<font color=\"blue\">"); sb.append(decl.getURI()); sb.append("</font>"); sb.append("<br>"); sb.append("does not match the URI of the ontology that has been imported:<br>"); sb.append("<font color=\"blue\">"); OWLOntology ont = eKit.getOWLModelManager().getOWLOntologyManager().getImportedOntology(decl); // @@TODO what about anonymous ontologies? sb.append(ont == null ? "(Not loaded)" : ont.getOntologyID().getDefaultDocumentIRI()); sb.append("</font><br><br>"); sb.append("Do you want to fix the mismatch by modifying the imports statement?"); sb.append("</body></html>"); return sb.toString(); }
/** * Gets the set of IRIs corresponding to the IRIs of the ontology documents that are directly imported by this ontology. * This corresponds to the IRIs defined by the directlyImportsDocuments relation as discussed in Section 3 of the * OWL 2 Structural specification. * @return A set of IRIs where each IRI represents the IRI of an ontology document that was directly imported by this * ontology. * @throws org.semanticweb.owlapi.model.UnknownOWLOntologyException * If this ontology is no longer managed by its manager because it was * removed from the manager. */ public Set<IRI> getDirectImportsDocuments() throws UnknownOWLOntologyException { Set<IRI> result = new HashSet<IRI>(); for(OWLImportsDeclaration importsDeclaration : importsDeclarations) { result.add(importsDeclaration.getIRI()); } return result; }
public void visit(OWLOntology ontology) { for (OWLImportsDeclaration decl : ontology.getImportsDeclarations()) { writer.writeStartElement(IMPORT); writer.writeTextContent(decl.getURI().toString()); writer.writeEndElement(); } for(OWLAnnotation annotation : ontology.getAnnotations()) { annotation.accept(this); } List<OWLAxiom> axioms = new ArrayList<OWLAxiom>(ontology.getAxioms()); Collections.sort(axioms); for (OWLAxiom ax : axioms) { ax.accept(this); } }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (!(obj instanceof OWLImportsDeclaration)) { return false; } OWLImportsDeclaration other = (OWLImportsDeclaration) obj; return iri.equals(other.getIRI()); }
@Override public void visit(OWLOntology ontology) { for (OWLImportsDeclaration decl : ontology.getImportsDeclarations()) { writer.writeStartElement(IMPORT); writer.writeTextContent(decl.getURI().toString()); writer.writeEndElement(); } for (OWLAnnotation annotation : ontology.getAnnotations()) { annotation.accept(this); } List<OWLAxiom> axioms = new ArrayList<OWLAxiom>(ontology.getAxioms()); Collections.sort(axioms); for (OWLAxiom ax : axioms) { ax.accept(this); } }
/** * Builder initialized from an existing object. * * @param expected the existing object * @param df data factory */ public BuilderImportsDeclaration(OWLImportsDeclaration expected, OWLDataFactory df) { this(df); withImportedOntology(expected.getIRI()); }
/** * Builder initialized from an existing object. * * @param expected the existing object * @param df data factory */ public BuilderImportsDeclaration(OWLImportsDeclaration expected, OWLDataFactory df) { this(df); withImportedOntology(expected.getIRI()); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (!(obj instanceof OWLImportsDeclaration)) { return false; } OWLImportsDeclaration other = (OWLImportsDeclaration) obj; return iri.equals(other.getIRI()); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (!(obj instanceof OWLImportsDeclaration)) { return false; } OWLImportsDeclaration other = (OWLImportsDeclaration) obj; return iri.equals(other.getIRI()); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (!(obj instanceof OWLImportsDeclaration)) { return false; } OWLImportsDeclaration other = (OWLImportsDeclaration) obj; return iri.equals(other.getIRI()); }
/** * Builder initialized from an existing object. * * @param expected * the existing object * @param df * data factory */ public BuilderImportsDeclaration(OWLImportsDeclaration expected, OWLDataFactory df) { this(df); withImportedOntology(expected.getIRI()); }
/** * Builder initialized from an existing object. * * @param expected the existing object * @param df data factory */ public BuilderImportsDeclaration(OWLImportsDeclaration expected, OWLDataFactory df) { this(df); withImportedOntology(expected.getIRI()); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof OWLImportsDeclaration)) { return false; } OWLImportsDeclaration other = (OWLImportsDeclaration) obj; return iri.equals(other.getIRI()); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof OWLImportsDeclaration)) { return false; } OWLImportsDeclaration other = (OWLImportsDeclaration) obj; return this.iri.equals(other.getIRI()); }
@Override public int compareTo(OWLImportsDeclaration o) { return iri.compareTo(o.getIRI()); }
@Override public int compareTo(OWLImportsDeclaration o) { return iri.compareTo(o.getIRI()); }
public int compareTo(OWLImportsDeclaration o) { return iri.compareTo(o.getIRI()); }