/** * Check whenever the uri actually exists. * Existence of a URI (Resource) is bound to the existence of a * Statement referencing the Resource, so this method simply delegates to {@link #isUsed(RepositoryConnection, Resource)}. * * @param conn connection with the repository * @param uri uri of the resource to check * @return resource exists or not * @deprecated the name of this method is missleading. use {@link #isUsed(RepositoryConnection, Resource)}. */ @Deprecated public static boolean existsResource(RepositoryConnection conn, String uri) { return isUsed(conn, conn.getValueFactory().createURI(uri)); }
/** * Check whenever the uri actually exists. * Existence of a URI (Resource) is bound to the existence of a * Statement referencing the Resource, so this method simply delegates to {@link #isUsed(RepositoryConnection, Resource)}. * * @param conn connection with the repository * @param uri uri of the resource to check * @return resource exists or not * @deprecated the name of this method is missleading. use {@link #isUsed(RepositoryConnection, Resource)}. */ @Deprecated public static boolean existsResource(RepositoryConnection conn, String uri) { return isUsed(conn, conn.getValueFactory().createURI(uri)); }
/** * Retrieve the KiWiUriResource with the given URI if it exists, or return null if it doesn't exist. * A Resource exists if and only if it is used in a Statement, i.e. it is uses either as Subject, Context, Predicate or Object. * @param uri * @return the URI or null if the Resource is not used. * @deprecated this method is easy to misinterpret. Use {@link #isUsed(RepositoryConnection, Resource)}, * {@link #isSubject(RepositoryConnection, String)}, {@link #isPredicate(RepositoryConnection, String)}, * {@link #isObject(RepositoryConnection, String)} or {@link #isContext(RepositoryConnection, String)} according to your usecase. */ @Deprecated public static URI getUriResource(RepositoryConnection con, String uri) { URI rsc = con.getValueFactory().createURI(uri); if (isUsed(con, rsc)) { return rsc; } else { return null; } }
/** * Retrieve the KiWiUriResource with the given URI if it exists, or return null if it doesn't exist. * A Resource exists if and only if it is used in a Statement, i.e. it is uses either as Subject, Context, Predicate or Object. * @param uri * @return the URI or null if the Resource is not used. * @deprecated this method is easy to misinterpret. Use {@link #isUsed(RepositoryConnection, Resource)}, * {@link #isSubject(RepositoryConnection, String)}, {@link #isPredicate(RepositoryConnection, String)}, * {@link #isObject(RepositoryConnection, String)} or {@link #isContext(RepositoryConnection, String)} according to your usecase. */ @Deprecated public static URI getUriResource(RepositoryConnection con, String uri) { URI rsc = con.getValueFactory().createURI(uri); if (isUsed(con, rsc)) { return rsc; } else { return null; } }
/** * Retrieve the KiWiAnonResource with the given ID if it exists, or return null if it doesn't exist. * @param id * @return */ public static BNode getAnonResource(RepositoryConnection con, String id) { final BNode bNode = con.getValueFactory().createBNode(id); if (isUsed(con, bNode)) { return bNode; } else { return null; } }
/** * Retrieve the KiWiAnonResource with the given ID if it exists, or return null if it doesn't exist. * @param id * @return */ public static BNode getAnonResource(RepositoryConnection con, String id) { final BNode bNode = con.getValueFactory().createBNode(id); if (isUsed(con, bNode)) { return bNode; } else { return null; } }
if (r == null || !ResourceUtils.isUsed(conn, r)) { throw new HttpErrorException(Status.NOT_FOUND, resource, "the requested resource could not be found in Marmotta right now, but may be available again in the future", ImmutableMap.of(ACCEPT, mimetype));
if (r == null || !ResourceUtils.isUsed(conn, r)) { throw new HttpErrorException(Status.NOT_FOUND, resource, "the requested resource could not be found in Marmotta right now, but may be available again in the future", ImmutableMap.of(ACCEPT, mimetype));