labelingsystem-server  Version 0.1.0.0
ResourceInfoResource Class Reference

Public Member Functions

Response redirectToRetcat (@QueryParam("uri") String uri) throws URISyntaxException, IOException, RepositoryException, MalformedQueryException, QueryEvaluationException, SesameSparqlException, ResourceNotAvailableException, org.eclipse.rdf4j.repository.RepositoryException, org.eclipse.rdf4j.query.MalformedQueryException, org.eclipse.rdf4j.query.QueryEvaluationException, link.labeling.retcat.exceptions.ResourceNotAvailableException
 

Member Function Documentation

◆ redirectToRetcat()

Response redirectToRetcat ( @QueryParam("uri") String  uri) throws URISyntaxException, IOException, RepositoryException, MalformedQueryException, QueryEvaluationException, SesameSparqlException, ResourceNotAvailableException, org.eclipse.rdf4j.repository.RepositoryException, org.eclipse.rdf4j.query.MalformedQueryException, org.eclipse.rdf4j.query.QueryEvaluationException, link.labeling.retcat.exceptions.ResourceNotAvailableException
26  {
27  List<RetcatItem> retcatlist = LocalRetcatItems.getLocalCatalogue();
28  boolean match = false;
29  for (RetcatItem item : retcatlist) {
30  if (uri.contains(item.getPrefix())) {
31  URI targetURIForRedirection = new URI(ConfigProperties.getPropertyParam("api") + item.getLabelURL() + "?uri=" + uri + "&type=" + item.getType());
32  return Response.temporaryRedirect(targetURIForRedirection).build();
33  }
34  }
35  if (!match) {
36  URI targetURIForRedirection = new URI(ConfigProperties.getPropertyParam("api") + "/v1/rtc/info/html" + "?url=" + uri);
37  return Response.temporaryRedirect(targetURIForRedirection).build();
38  }
39  return Response.ok().build();
40  }

References LocalRetcatItems.getLocalCatalogue(), and ConfigProperties.getPropertyParam().