@Override public Map<String, String> getMappings() { Map<String, String> mappings = new HashMap<String, String>(); mappings.putAll(prefixService.getMappings()); mappings.putAll(localNS); return Collections.unmodifiableMap(mappings); }
/** * Get all prefixes mappings * * @return all current prefixes mappings */ @GET @Produces("application/json") public Response getMappings() { Map<String, String> mappings = (prefixService != null ? prefixService.getMappings() : new HashMap<String,String>()); return Response.ok().entity(mappings).build(); }
/** * Get all prefixes mappings * * @return all current prefixes mappings */ @GET @Produces("application/json") public Response getMappings() { Map<String, String> mappings = (prefixService != null ? prefixService.getMappings() : new HashMap<String,String>()); return Response.ok().entity(mappings).build(); }
@GET @Path("/namespaces") @Produces(Namespaces.MIME_TYPE_JSON) public Map<String, String> listKnownNamespaces(@Context UriInfo info) { final PrefixService prefixService = createLocalPrefixService(info); Map<String, String> nss = new HashMap<String, String>(); try { RepositoryConnection con = sesameService.getConnection(); try { con.begin(); for (Namespace ns : iterable(con.getNamespaces())) { nss.put(ns.getPrefix(), ns.getName()); } // commit added con.commit(); } finally { con.close(); } } catch (RepositoryException e) { handleRepositoryException(e,LDPathUtilWebService.class); } for (Map.Entry<String, String> e : prefixService.getMappings().entrySet()) { nss.put(e.getKey(), e.getValue()); } nss.put(FUNCTION_PREFIX, FUNCTION_NAMESPACE); return nss; }
suggestions.add(FUNCTION_PREFIX); for (String px : prefixService.getMappings().keySet()) { if (px.startsWith(prefix)) { suggestions.add(px);
Collection<Value> cPos = ldPathService.pathQuery(rsc, path, prefixService.getMappings()); for (Value cP : cPos) { if (cP instanceof URI || cP instanceof BNode) {