@Test public void testTranslateFromGraphUri() throws Exception { URI result = resolver.translateFromGraphURI(new URI(annotationUrn), baseUrl); assertEquals(annotationUrl, result.toString()); }
public URI translateFromGraphURI(URI uri, String baseUrl) throws AnnotationException { if (uri.toString().startsWith("urn:annotation:")) { String annId = uri.toString().substring( uri.toString().lastIndexOf(":") + 1); try { return new URI(baseUrl + annId); } catch (URISyntaxException e) { throw new AnnotationException(e); } } return uri; }
DefaultUriResolver implements UriResolver { public URI translateFromGraphURI(URI uri, String baseUrl) throws AnnotationException { if (uri.toString().startsWith("urn:annotation:")) { String annId = uri.toString().substring( uri.toString().lastIndexOf(":") + 1); try { return new URI(baseUrl + annId); } catch (URISyntaxException e) { throw new AnnotationException(e); } } return uri; } }
DefaultUriResolver implements UriResolver { public URI translateFromGraphURI(URI uri, String baseUrl) throws AnnotationException { if (uri.toString().startsWith("urn:annotation:")) { String annId = uri.toString().substring( uri.toString().lastIndexOf(":") + 1); try { return new URI(baseUrl + annId); } catch (URISyntaxException e) { throw new AnnotationException(e); } } return uri; }  }
DefaultUriResolver implements UriResolver { public URI translateFromGraphURI(URI uri, String baseUrl) throws AnnotationException { if (uri.toString().startsWith("urn:annotation:")) { String annId = uri.toString().substring( uri.toString().lastIndexOf(":") + 1); try { return new URI(baseUrl + annId); } catch (URISyntaxException e) { throw new AnnotationException(e); } } return uri; }  String getBaseUrl(URI uri); List<URI> getSearchURI(URI uri); URI translateFromGraphURI(URI uri, String baseUrl); URI translateToGraphURI(URI uri); }
DefaultUriResolver implements UriResolver { public URI translateFromGraphURI(URI uri, String baseUrl) throws AnnotationException { if (uri.toString().startsWith("urn:annotation:")) { String annId = uri.toString().substring( uri.toString().lastIndexOf(":") + 1); try { return new URI(baseUrl + annId); } catch (URISyntaxException e) { throw new AnnotationException(e); } } return uri; }  String getBaseUrl(URI uri); List<URI> getSearchURI(URI uri); URI translateFromGraphURI(URI uri, String baseUrl); URI translateToGraphURI(URI uri);  }