private boolean isDefaultOWLAPIDocumentIRI(IRI iri) { URI uri = iri.toURI(); String scheme = uri.getScheme(); return scheme != null && scheme.equals("owlapi"); }
private boolean isDefaultOWLAPIDocumentIRI(IRI iri) { URI uri = iri.toURI(); String scheme = uri.getScheme(); return scheme != null && scheme.equals("owlapi"); }
private String getDefaultOntologyTagValue(IRI baseIRI) { URI baseURI = baseIRI.toURI(); String baseURIPath = baseURI.getPath(); if(baseURIPath == null) { return baseIRI.toString(); } int lastSlashIndex = baseURIPath.lastIndexOf("/"); if(lastSlashIndex == -1 || lastSlashIndex + 1 == baseURIPath.length()) { return baseURIPath; } return baseURIPath.substring(lastSlashIndex + 1); }
private static String getDefaultOntologyTagValue(IRI baseIRI) { URI baseURI = baseIRI.toURI(); String baseURIPath = baseURI.getPath(); if (baseURIPath == null) { return baseIRI.toString(); } int lastSlashIndex = baseURIPath.lastIndexOf("/"); if (lastSlashIndex == -1 || lastSlashIndex + 1 == baseURIPath.length()) { return baseURIPath; } return baseURIPath.substring(lastSlashIndex + 1); }
@Override protected void actionPerformed(OWLEntity selectedEntity) { try { Desktop.getDesktop().browse(selectedEntity.getIRI().toURI()); } catch (IOException e) { logger.error("An error occurred while attempting to open the selected entity IRI in a Web browser", e); } }
private static String formatIRI(IRI iri) { if ("file".equalsIgnoreCase(iri.getScheme())) { return new File(iri.toURI()).toString(); } else { return iri.toString(); } }
private static String formatIRI(IRI iri) { if ("file".equalsIgnoreCase(iri.getScheme())) { return new File(iri.toURI()).toString(); } else { return iri.toString(); } }
public URI getOntologyPhysicalURI(OWLOntology ontology) { IRI ontologyDocumentIRI = manager.getOntologyDocumentIRI(ontology); if(isDefaultOWLAPIDocumentIRI(ontologyDocumentIRI)) { return URI.create(""); } else { return ontologyDocumentIRI.toURI(); } }
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; }
private static boolean willRedirectTotheWrongPlace(OntologyCatalogManager catalogManager, IRI importLocation, URI physicalLocation) { if (catalogManager.getRedirect(importLocation.toURI()) == null) { return !importLocation.equals(IRI.create(physicalLocation)); } else { return !physicalLocation.equals(catalogManager.getRedirect(importLocation.toURI())); } }
public IRI getDocumentIRI(IRI logicalURI) { URI u = libraryManager.getRedirect(logicalURI.toURI()); return u != null ? IRI.create(u) : null; } }
public IRI getDocumentIRI(IRI logicalURI) { URI u = libraryManager.getRedirect(logicalURI.toURI()); return u != null ? IRI.create(u) : null; } }
public IRI getDocumentIRI(IRI iri) { for(RepositoryEntry entry : entries) { if(entry.getOntologyURI().equals(iri.toURI())) { return IRI.create(entry.getPhysicalURI()); } } return null; } }
public IRI getDocumentIRI(IRI iri) { for(RepositoryEntry entry : entries) { if(entry.getOntologyURI().equals(iri.toURI())) { return IRI.create(entry.getPhysicalURI()); } } return null; } }
public void importMissing(MissingImportEvent arg0) { if (!getUnresolvedURIs().contains(arg0.getImportedOntologyURI())) getUnresolvedURIs().add( arg0.getImportedOntologyURI().toURI()); } });
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 void markSources() { for(OWLOntology ontology : modelManager.getOntologies()) { update(ontology.getOWLOntologyManager().getOntologyDocumentIRI(ontology).toURI()); } }
public void markSources() { for(OWLOntology ontology : modelManager.getOntologies()) { update(ontology.getOWLOntologyManager().getOntologyDocumentIRI(ontology).toURI()); } }
@Override public OWLOntology reloadOntology(OWLOntology ontology) throws OWLOntologyCreationException { URI physicalLocation = getOWLOntologyManager().getOntologyDocumentIRI(ontology).toURI(); mngr.removeOntology(ontology); OWLOntology ont = mngr.loadOntologyFromOntologyDocument(IRI.create(physicalLocation)); resetRootImports(); clear(); return ont; }