/** Get triples with the same subject */ public static Collection<Triple> triplesOfSubject(Graph graph, Node subj) { return triples(graph, subj, Node.ANY, Node.ANY); }
public static Collection<Triple> triplesOfSubject(Graph graph, Node subj) { return triples(graph, subj, Node.ANY, Node.ANY) ; }
private void findLists() { List<Triple> tails = RiotLib.triples(graph, Node.ANY, RDF_Rest, RDF_Nil) ; for ( Triple t : tails ) { // Returns the elements, reversed. Collection<Node> listElts2 = new HashSet<Node>() ; Pair<Node, List<Node>> p = followTailToHead(t.getSubject(), listElts2) ; if ( p != null ) { Node headElt = p.getLeft() ; // Free standing?private List<Node> elts = p.getRight() ; long numLinks = RiotLib.countTriples(graph, null, null, headElt) ; if ( numLinks == 1 ) lists.put(headElt, elts) ; else if ( numLinks == 0 ) // 0 connected lists freeLists.put(headElt, elts) ; else // Two triples to this list. nLinkedLists.put(headElt, elts) ; listElts.addAll(listElts2) ; } } }
List<Triple> acc2 = RiotLib.triples(graph, null, null, x) ; long numRest = RiotLib.countTriples(graph, null, RDF_Rest, x) ; if ( numRest != 1 )