/** * Determines whether an IRI that represents an annotation value can be opened in a web browser. i.e. wherther or * not the IRI represents a web link. * * @param iri The iri to be tested. * @return <code>true</code> if the IRI represents a web link, other wise <code>false</code>. */ private boolean isLinkableAddress(IRI iri) { String scheme = iri.getScheme(); return scheme != null && scheme.startsWith("http"); }
/** * Determines whether an IRI that represents an annotation value can be opened in a web browser. i.e. wherther or * not the IRI represents a web link. * * @param iri The iri to be tested. * @return <code>true</code> if the IRI represents a web link, other wise <code>false</code>. */ private boolean isLinkableAddress(IRI iri) { String scheme = iri.getScheme(); return scheme != null && scheme.startsWith("http"); }
@Override public boolean isSuitable(IRI serverLocation) { return serverLocation.getScheme().equals(RMIClient.SCHEME); }
/** * Determines whether an IRI that represents an annotation value can be opened in a web browser. i.e. wherther or * not the IRI represents a web link. * @param iri The iri to be tested. * @return <code>true</code> if the IRI represents a web link, other wise <code>false</code>. */ private boolean isLinkableAddress(IRI iri) { String scheme = iri.getScheme(); return scheme != null && scheme.startsWith("http"); }
public static boolean isFreshEntity(OWLEntity entity) { IRI iri = entity.getIRI(); String scheme = iri.getScheme(); return scheme != null && FRESH_ENTITY_SCHEME.equalsIgnoreCase(scheme); }
private static OutputStream prepareActualOutput(IRI documentIRI) throws IOException { // files opened with FileOutputStream if ("file".equals(documentIRI.getScheme())) { File file = new File(documentIRI.toURI()); // Ensure that the necessary directories exist. file.getParentFile().mkdirs(); return new FileOutputStream(file); } // URLs URL url = documentIRI.toURI().toURL(); URLConnection conn = url.openConnection(); return conn.getOutputStream(); }
private static OutputStream prepareActualOutput(IRI documentIRI) throws IOException { // files opened with FileOutputStream if ("file".equals(documentIRI.getScheme())) { File file = new File(documentIRI.toURI()); // Ensure that the necessary directories exist. file.getParentFile().mkdirs(); return new FileOutputStream(file); } // URLs URL url = documentIRI.toURI().toURL(); URLConnection conn = url.openConnection(); return conn.getOutputStream(); }
private static String formatIRI(IRI iri) { if("file".equals(iri.getScheme())) { return new File(iri.toString()).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(); } }
private static String formatIRI(IRI iri) { if ("file".equalsIgnoreCase(iri.getScheme())) { return new File(iri.toURI()).toString(); } else { return iri.toString(); } }
@Override public boolean hasServerMetadata(IRI ontologyDocumentLocation) { if (!ontologyDocumentLocation.getScheme().equals("file")) { return false; } File ontologyFile = new File(ontologyDocumentLocation.toURI()); return VersionedOntologyDocumentImpl.getMetaDataFile(ontologyFile).exists(); }
private static String formatIRI(IRI iri) { if("file".equals(iri.getScheme())) { return new File(iri.toString()).toString(); } else { return iri.toString(); } }
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; }
public static File getBackingStore(OWLOntology ontology) { OWLOntologyManager manager = ontology.getOWLOntologyManager(); IRI documentLocation = manager.getOntologyDocumentIRI(ontology); if (!documentLocation.getScheme().equals("file")) { return null; } return new File(documentLocation.toURI()); }
@Override public boolean canAttemptLoading(OWLOntologyDocumentSource source) { return !source.hasAlredyFailedOnStreams() || !source.hasAlredyFailedOnIRIResolution() && parsableSchemes.contains(source.getDocumentIRI().getScheme()); }
@Override public boolean canAttemptLoading(OWLOntologyDocumentSource source) { return !source.hasAlredyFailedOnStreams() || !source.hasAlredyFailedOnIRIResolution() && parsableSchemes.contains(source.getDocumentIRI().getScheme()); }
@Override public boolean canAttemptLoading(OWLOntologyDocumentSource source) { return !source.hasAlredyFailedOnStreams() || !source.hasAlredyFailedOnIRIResolution() && parsableSchemes.contains(source.getDocumentIRI().getScheme()); }
@Override public boolean canAttemptLoading(OWLOntologyDocumentSource source) { return !source.hasAlredyFailedOnStreams() || !source.hasAlredyFailedOnIRIResolution() && parsableSchemes.contains(source.getDocumentIRI().getScheme()); }