@Override protected int graphBaseSize() { return (int)hdt.getTriples().getNumberOfElements(); }
@Override protected ExtendedIterator<Triple> graphBaseFind(Triple jenaTriple) { TripleID triplePatID = nodeDictionary.getTriplePatID(jenaTriple); // System.out.println("Triple Pattern: "+jenaTriple+" as IDs: "+triplePatID); IteratorTripleID hdtIterator = hdt.getTriples().search( triplePatID ); numSearches++; return new HDTJenaIterator(nodeDictionary, hdtIterator); }
if(patternID.isEmpty()) { count = hdtg.getHDT().getTriples().getNumberOfElements(); } else if(!patternID.isNoMatch()) { IteratorTripleID it = hdtg.getHDT().getTriples().search(patternID); if(it.numResultEstimation()==ResultEstimationType.EXACT) { count = it.estimatedNumResults();
@Override public void load(Triples triples, ProgressListener listener) { this.clear(); IteratorTripleID it = triples.searchAll(); while(it.hasNext()) { TripleID triple = it.next(); this.insert(triple.getSubject(), triple.getPredicate(), triple.getObject()); } sorted = false; }
triples.populateHeader(header, triplesNode); header.insert(statisticsNode, HDTVocabulary.HDT_SIZE, getDictionary().size()+getTriples().size());
System.out.println("Total Triples: "+hdt.getTriples().getNumberOfElements()); System.out.println("Different subjects: "+hdt.getDictionary().getNsubjects()); System.out.println("Different predicates: "+hdt.getDictionary().getNpredicates());
IteratorTripleID iterTripleIDSearch = triples.search(patternID); Iter<TripleID> it = Iter.iter(iterTripleIDSearch);