/** * List all resources contained in the KiWi System, regardless of knowledge space or type. Since this * operation works directly on the triple store, there is no guarantee the result is free of duplicates. * In case the underlying connection does not directly support listing resources (i.e. is not an instance of * ResourceConnection), the method will iterate over all triples and return their subjects * * @return */ public static Iterable<Resource> listSubjects(RepositoryConnection con) { return listSubjectsInternal(con, null, null, null); }
/** * List all resources contained in the KiWi System, regardless of knowledge space or type. Since this * operation works directly on the triple store, there is no guarantee the result is free of duplicates. * In case the underlying connection does not directly support listing resources (i.e. is not an instance of * ResourceConnection), the method will iterate over all triples and return their subjects * * @return */ public static Iterable<Resource> listSubjects(RepositoryConnection con) { return listSubjectsInternal(con, null, null, null); }
/** * List all resources contained in the KiWi System, regardless of knowledge space or type. Since this * operation works directly on the triple store, there is no guarantee the result is free of duplicates. * In case the underlying connection does not directly support listing resources (i.e. is not an instance of * ResourceConnection), the method will iterate over all triples and return their subjects * * @return */ public static Iterable<Resource> listResources(RepositoryConnection con) { final ResourceConnection rcon = getWrappedResourceConnection(con); if(rcon != null) { return new Iterable<Resource>() { @Override public Iterator<Resource> iterator() { try { return ResultUtils.unwrap(rcon.getResources()); } catch (RepositoryException e) { ExceptionUtils.handleRepositoryException(e,ResourceUtils.class); return Iterators.emptyIterator(); } } }; } else { return listSubjectsInternal(con, null, null, null); } }
/** * List all resources contained in the KiWi System, regardless of knowledge space or type. Since this * operation works directly on the triple store, there is no guarantee the result is free of duplicates. * In case the underlying connection does not directly support listing resources (i.e. is not an instance of * ResourceConnection), the method will iterate over all triples and return their subjects * * @return */ public static Iterable<Resource> listResources(RepositoryConnection con) { final ResourceConnection rcon = getWrappedResourceConnection(con); if(rcon != null) { return new Iterable<Resource>() { @Override public Iterator<Resource> iterator() { try { return ResultUtils.unwrap(rcon.getResources()); } catch (RepositoryException e) { ExceptionUtils.handleRepositoryException(e,ResourceUtils.class); return Iterators.emptyIterator(); } } }; } else { return listSubjectsInternal(con, null, null, null); } }
/** * List all resources of a specific type contained in a certain knowledge space in the KiWi system * * @param context the resource identifying the knowledge space * @param type the type of the resources to list * @return */ public static Iterable<Resource> listResources(final RepositoryConnection con, final Resource type, final URI context) { URI rdf_type = con.getValueFactory().createURI(Namespaces.NS_RDF + "type"); return listSubjectsInternal(con, rdf_type, type, context); }
/** * List all resources of a specific type contained in a certain knowledge space in the KiWi system * * @param context the resource identifying the knowledge space * @param type the type of the resources to list * @return */ public static Iterable<Resource> listResources(final RepositoryConnection con, final Resource type, final URI context) { URI rdf_type = con.getValueFactory().createURI(Namespaces.NS_RDF + "type"); return listSubjectsInternal(con, rdf_type, type, context); }