/** * @param iri the iri to check * @return true if the input iri matches the default document iri */ public boolean matchDocument(IRI iri) { return iri.equals(getDefaultDocumentIRI().orElse(null)); }
/** * @param iri the iri to check * @return true if the input iri matches the default document iri */ public boolean matchDocument(IRI iri) { return iri.equals(getDefaultDocumentIRI().orElse(null)); }
/** * @param iri the iri to check * @return true if the input iri matches the default document iri */ public boolean matchDocument(IRI iri) { return iri.equals(getDefaultDocumentIRI().orElse(null)); }
protected IRI getIRI(String s) { try { final Optional<IRI> defaultDocURI = ontology.getOntologyID().getDefaultDocumentIRI(); return IRI.create(new URI(defaultDocURI.get().getScheme(), defaultDocURI.get().toURI().getSchemeSpecificPart(), s)); } catch (Exception e) { LoggerFactory.getLogger(AbstractOWLObjectHierarchyCreator.class) .error("An error occurred whilst creating an IRI: {}", e); } return null; }
protected IRI getIRI(String s) { try { final Optional<IRI> defaultDocURI = ontology.getOntologyID().getDefaultDocumentIRI(); return IRI.create(new URI(defaultDocURI.get().getScheme(), defaultDocURI.get().toURI().getSchemeSpecificPart(), s)); } catch (Exception e) { LoggerFactory.getLogger(AbstractOWLObjectHierarchyCreator.class) .error("An error occurred whilst creating an IRI: {}", e); } return null; }
protected IRI computeDocumentIRI(OWLOntologyID ontologyID) { IRI documentIRI = getDocumentIRIFromMappers(ontologyID); if (documentIRI == null) { if (!ontologyID.isAnonymous()) { documentIRI = ontologyID.getDefaultDocumentIRI().orElse(null); } else { documentIRI = IRI.generateDocumentIRI(); } } return documentIRI; }
protected IRI computeDocumentIRI(OWLOntologyID ontologyID) { IRI documentIRI = getDocumentIRIFromMappers(ontologyID); if (documentIRI == null) { if (!ontologyID.isAnonymous()) { documentIRI = ontologyID.getDefaultDocumentIRI().orElse(null); } else { documentIRI = IRI.generateDocumentIRI(); } } return documentIRI; }
private IRI getImportIRIForOntology(OWLOntology root) { if (root.isAnonymous()){ // TODO need a workaround as this will not work // see OWL API bug - https://sourceforge.net/tracker/?func=detail&aid=3110834&group_id=90989&atid=595534 return mngr.getOntologyDocumentIRI(root); } return root.getOntologyID().getDefaultDocumentIRI().orNull(); }
protected IRI computeDocumentIRI(OWLOntologyID ontologyID) { IRI documentIRI = getDocumentIRIFromMappers(ontologyID); if (documentIRI == null) { if (!ontologyID.isAnonymous()) { documentIRI = ontologyID.getDefaultDocumentIRI().orElse(null); } else { documentIRI = IRI.generateDocumentIRI(); } } return documentIRI; }
protected IRI getIRI(String s) { try { final URI defaultDocURI = ontology.getOntologyID().getDefaultDocumentIRI().toURI(); return IRI.create(new URI(defaultDocURI.getScheme(), defaultDocURI.getSchemeSpecificPart(), s)); } catch (Exception e) { ProtegeApplication.getErrorLog().logError(e); } return null; }
public List<MListButton> getAdditionalButtons() { OWLOntology ont = eKit.getOWLModelManager().getOWLOntologyManager().getImportedOntology(decl); if(ont == null) { return Collections.emptyList(); } Optional<IRI> defaultDocumentIRI = ont.getOntologyID().getDefaultDocumentIRI(); if (Optional.of(decl.getIRI()).equals(defaultDocumentIRI)) { return Collections.emptyList(); } return Collections.singletonList(fixImportsButton); }
protected IRI getIRI(String s) { try { final URI defaultDocURI = ontology.getOntologyID().getDefaultDocumentIRI().toURI(); return IRI.create(new URI(defaultDocURI.getScheme(), defaultDocURI.getSchemeSpecificPart(), s)); } catch (Exception e) { ProtegeApplication.getErrorLog().logError(e); } return null; }
public List<MListButton> getAdditionalButtons() { OWLOntology ont = eKit.getOWLModelManager().getOWLOntologyManager().getImportedOntology(decl); // @@TODO what about anonymous ontologies? if (ont != null && !decl.getIRI().equals(ont.getOntologyID().getDefaultDocumentIRI())) { return Collections.singletonList(fixImportsButton); } return Collections.EMPTY_LIST; }
@Override public boolean handleNewRequest() throws Exception { OWLOntologyID id = createDefaultOntologyId(); OWLOntology ont = getModelManager().createNewOntology(id, URI.create(id.getDefaultDocumentIRI().get().toString())); OWLOntologyManager owlOntologyManager = getModelManager().getOWLOntologyManager(); owlOntologyManager.setOntologyFormat(ont, new RDFXMLDocumentFormat()); return true; }
public List<MListButton> getAdditionalButtons() { OWLOntology ont = eKit.getOWLModelManager().getOWLOntologyManager().getImportedOntology(decl); // @@TODO what about anonymous ontologies? if (ont != null && !decl.getIRI().equals(ont.getOntologyID().getDefaultDocumentIRI())) { return Collections.singletonList(fixImportsButton); } return Collections.EMPTY_LIST; }
private String renderOntology(OWLOntology ontology) { if (ontology.isAnonymous()){ return ontology.getOntologyID().toString(); } // shows the version uri or the ont uri if there is no version IRI iri = ontology.getOntologyID().getDefaultDocumentIRI(); return ontURISFP.getShortForm(iri); }
public static String getOntologyLabelText(OWLOntology ont, OWLModelManager mngr) { if (ont.getOntologyID().isAnonymous()) { return ont.getOntologyID().toString(); } final Optional<IRI> iri = ont.getOntologyID().getDefaultDocumentIRI(); return getOntologyLabelText(iri, mngr); }
public static String getOntologyLabelText(OWLOntology ont, OWLModelManager mngr) { if (ont.getOntologyID().isAnonymous()) { return ont.getOntologyID().toString(); } final Optional<IRI> iri = ont.getOntologyID().getDefaultDocumentIRI(); return getOntologyLabelText(iri, mngr); }
public static String getOntologyLabelText(OWLOntology ont, OWLModelManager mngr) { if (ont.getOntologyID().isAnonymous()) { return ont.getOntologyID().toString(); } final IRI iri = ont.getOntologyID().getDefaultDocumentIRI(); return getOntologyLabelText(iri, mngr); }
public boolean handleNewRequest() throws Exception { OWLOntologyID id = createDefaultOntologyId(); OWLOntology ont = getModelManager().createNewOntology(id, id.getDefaultDocumentIRI().toURI()); OWLOntologyManager owlOntologyManager = getModelManager().getOWLOntologyManager(); owlOntologyManager.setOntologyFormat(ont, new RDFXMLOntologyFormat()); return true; }