/** * List all incoming edges from other resources to this resource * * @return */ public static Iterable<? extends Statement> listIncoming(RepositoryConnection con, Resource r) throws RepositoryException { return listIncoming(con, r, (URI) null); }
/** * List all incoming edges from other resources to this resource * * @return */ public static Iterable<? extends Statement> listIncoming(RepositoryConnection con, Resource r) throws RepositoryException { return listIncoming(con, r, (URI) null); }
/** * List all incoming edges from other resources to this resource. Just for the given space(context) * * @return */ public static Iterable<? extends Statement> listIncoming(RepositoryConnection con, Resource r, URI context) throws RepositoryException { return listIncoming(con, r, null, context); }
/** * List all incoming edges from other resources to this resource. Just for the given space(context) * * @return */ public static Iterable<? extends Statement> listIncoming(RepositoryConnection con, Resource r, URI context) throws RepositoryException { return listIncoming(con, r, null, context); }
/** * List incoming edges from other resources to this resource, using the property label passed * as argument. If limit is bigger than 0, then a maximum of limit triples will be returned. * Otherwise, all triples will be returned. * <p/> * The parameter propLabel is in the form of a SeRQL or SPARQL id. It can take one of the following * values: * <ul> * <li>a URI enclosed in < >, e.g. <http://www.example.com/myProp></li> * <li>a uri prefix, followed by a colon and the property name, e.g. ex:myProp</li> * <li>the value "null", in which case all outgoing edges are listed regardless of their label * (wildcard)</li> * </ul> * The result will be an iterable that allows to iterate over Statements. * * * @param r the maximum number of triples to retrieve * @param propLabel the label of the property to be queried, or null for wildcard * @return an iterable over the Statements that are incoming edges of this resource */ public static Iterable<? extends Statement> listIncoming(RepositoryConnection con, Resource r, String propLabel) throws RepositoryException { return listIncoming(con, r, propLabel, null); }
/** * List incoming edges from other resources to this resource, using the property label passed * as argument. If limit is bigger than 0, then a maximum of limit triples will be returned. * Otherwise, all triples will be returned. * <p/> * The parameter propLabel is in the form of a SeRQL or SPARQL id. It can take one of the following * values: * <ul> * <li>a URI enclosed in < >, e.g. <http://www.example.com/myProp></li> * <li>a uri prefix, followed by a colon and the property name, e.g. ex:myProp</li> * <li>the value "null", in which case all outgoing edges are listed regardless of their label * (wildcard)</li> * </ul> * The result will be an iterable that allows to iterate over Statements. * * * @param r the maximum number of triples to retrieve * @param propLabel the label of the property to be queried, or null for wildcard * @return an iterable over the Statements that are incoming edges of this resource */ public static Iterable<? extends Statement> listIncoming(RepositoryConnection con, Resource r, String propLabel) throws RepositoryException { return listIncoming(con, r, propLabel, null); }
/** * Return a list of nodes that are the sources for edges with propLabel that have this resource * as endpoint. This is mostly a convenience method that wraps listIncoming(propLabel). * * @param propLabel the label that all edges listed must have, or null for wildcard * @param context the context of the incoming nodes * @return a list of resources that are sources of edges that have this resource as endpoint */ public static Iterable<? extends Resource> listIncomingNodes(RepositoryConnection con, Resource r, String propLabel, URI context) throws RepositoryException { return Iterables.transform( listIncoming(con, r, propLabel, context), new Function<Statement, Resource>() { @Override public Resource apply(Statement input) { return input.getSubject(); } } ); }
/** * Return a list of nodes that are the sources for edges with propLabel that have this resource * as endpoint. This is mostly a convenience method that wraps listIncoming(propLabel). * * @param propLabel the label that all edges listed must have, or null for wildcard * @param context the context of the incoming nodes * @return a list of resources that are sources of edges that have this resource as endpoint */ public static Iterable<? extends Resource> listIncomingNodes(RepositoryConnection con, Resource r, String propLabel, URI context) throws RepositoryException { return Iterables.transform( listIncoming(con, r, propLabel, context), new Function<Statement, Resource>() { @Override public Resource apply(Statement input) { return input.getSubject(); } } ); }