Extraction( TripleBoundary b, Graph toUpdate, Graph extractFrom ) { this.toUpdate = toUpdate; this.extractFrom = extractFrom; this.active = CollectionFactory.createHashedSet(); this.b = b; }
/** Answer a Set formed from the elements of the List <code>L</code>. */ public static <T> Set<T> listToSet( List<T> L ) { return CollectionFactory.createHashedSet( L ); }
/** * Answer a Set formed from the elements of the List <code>L</code>. */ public static <T> Set<T> listToSet(List<T> L) { return CollectionFactory.createHashedSet(L); }
/** * make a single-element set. * * @param element * the single element to contain * @return a set whose only element == element */ private Set<String> set( final String element ) { final Set<String> s = CollectionFactory.createHashedSet(); s.add(element); return s; }
/** * Answer a set of the elements of <code>Foo</code>. */ public static <T> Set<T> arrayToSet(T[] A) { return CollectionFactory.createHashedSet(Arrays.asList(A)); }
/** Answer a set of the elements of <code>A</code>. */ public <T> Set<T> arrayToSet( T [] A ) { return CollectionFactory.createHashedSet( Arrays.asList( A ) ); }
/** * Answer a set of the elements of <code>Foo</code>. */ public static <T> Set<T> arrayToSet(T[] A) { return CollectionFactory.createHashedSet(Arrays.asList(A)); }
public void testHashSetCopy() { Set<String> s = new HashSet<>(); s.add( "jelly" ); s.add( "concrete" ); Set<String> copy = CollectionFactory.createHashedSet( s ); assertEquals( s, copy ); } }
private Iterator<Node> listTypes() { Set<Node> types = CollectionFactory.createHashedSet(); ClosableIterator<Triple> it = graph.find( null, RDF.type.asNode(), null ); while (it.hasNext()) types.add( it.next().getObject() ); return types.iterator(); }
public void testHashSetCopy() { Set<String> s = new HashSet<>(); s.add( "jelly" ); s.add( "concrete" ); Set<String> copy = CollectionFactory.createHashedSet( s ); assertEquals( s, copy ); } }
/** Answer a set of the nodes described (as per <code>node()</code>) by the space-separated substrings of <code>nodes</code>. */ public Set<Node> nodeSet( String nodes ) { Set<Node> result = CollectionFactory.createHashedSet(); StringTokenizer st = new StringTokenizer( nodes ); while (st.hasMoreTokens()) result.add( node( st.nextToken() ) ); return result; }
/** * Answer a set of the nodes described (as per <code>node()</code>) by the * space-separated substrings of <code>nodes</code>. */ public static Set<Node> nodeSet(String nodes) { Set<Node> result = CollectionFactory.createHashedSet(); StringTokenizer st = new StringTokenizer(nodes); while (st.hasMoreTokens()) result.add(node(st.nextToken())); return result; }
private Iterator<Node> listTypes() { Set<Node> types = CollectionFactory.createHashedSet(); ClosableIterator<Triple> it = graph.find( null, RDF.type.asNode(), null ); while (it.hasNext()) types.add( it.next().getObject() ); return types.iterator(); }
/** Answer a set of the nodes described (as per <code>node()</code>) by the space-separated substrings of <code>nodes</code>. */ public Set<Node> nodeSet( String nodes ) { Set<Node> result = CollectionFactory.createHashedSet(); StringTokenizer st = new StringTokenizer( nodes ); while (st.hasMoreTokens()) result.add( node( st.nextToken() ) ); return result; }
/** * Answer a set of the nodes described (as per <code>node()</code>) by the * space-separated substrings of <code>nodes</code>. */ public static Set<Node> nodeSet(String nodes) { Set<Node> result = CollectionFactory.createHashedSet(); StringTokenizer st = new StringTokenizer(nodes); while (st.hasMoreTokens()) result.add(node(st.nextToken())); return result; }
@Override public NsIterator listNameSpaces() { Set<String> nameSpaces = CollectionFactory.createHashedSet(); updateNamespace( nameSpaces, listPredicates() ); updateNamespace( nameSpaces, listTypes() ); return new NsIteratorImpl(nameSpaces.iterator(), nameSpaces); }
@Override public NsIterator listNameSpaces() { Set<String> nameSpaces = CollectionFactory.createHashedSet(); updateNamespace( nameSpaces, listPredicates() ); updateNamespace( nameSpaces, listTypes() ); return new NsIteratorImpl(nameSpaces.iterator(), nameSpaces); }
/** To find in the union, find in the components, concatenate the results, and omit duplicates. That last is a performance penalty, but I see no way to remove it unless we know the graphs do not overlap. */ @Override protected ExtendedIterator<Triple> _graphBaseFind( final Triple t ) { Set<Triple> seen = CollectionFactory.createHashedSet(); return recording( L.find( t ), seen ).andThen( rejecting( R.find( t ), seen ) ); // return L.find( t ) .andThen( rejecting( R.find( t ), L ) ); } }
/** To find in the union, find in the components, concatenate the results, and omit duplicates. That last is a performance penalty, but I see no way to remove it unless we know the graphs do not overlap. */ @Override protected ExtendedIterator<Triple> _graphBaseFind( final Triple t ) { Set<Triple> seen = CollectionFactory.createHashedSet(); return recording( L.find( t ), seen ).andThen( rejecting( R.find( t ), seen ) ); // return L.find( t ) .andThen( rejecting( R.find( t ), L ) ); } }
public void testEmptyToEmptySet() { assertEquals( CollectionFactory.createHashedSet(), IteratorCollection.iteratorToSet( NullIterator.instance() ) ); }