public static void main(String[] args) throws Throwable { if(args.length<1) { System.out.println("hdtVerify <file.hdt>"); System.exit(-1); } HDT hdt = HDTManager.mapHDT(args[0], null); checkDictionarySectionOrder(hdt.getDictionary().getSubjects().getSortedEntries()); checkDictionarySectionOrder(hdt.getDictionary().getPredicates().getSortedEntries()); checkDictionarySectionOrder(hdt.getDictionary().getObjects().getSortedEntries()); checkDictionarySectionOrder(hdt.getDictionary().getShared().getSortedEntries()); } }
public HDTGraph(HDT hdt, boolean close) { this.hdt = hdt; this.nodeDictionary = new NodeDictionary(hdt.getDictionary()); this.hdtStatistics = new HDTStatistics(this); // Must go after NodeDictionary created. this.reorderTransform=new ReorderTransformationHDT(this); // Must go after Dict and Stats this.closeAfter = close; }
public ReorderTransformationHDT(HDTGraph graph) { this.stats = graph.getStatisticsHandler(); numTriples = graph.size(); initializeMatcher(); // FIXME: Compute exactly for using the HDT Dictionary dict = graph.getHDT().getDictionary(); TERM_S = dict.getNsubjects()/Math.max(numTriples, 1); TERM_P = dict.getNpredicates()/Math.max(numTriples, 1); TERM_O = dict.getNobjects()/Math.max(numTriples, 1); }
@Override public void setUpProcess() throws LuzzuIOException { try { this.processor = HDTManager.loadIndexedHDT(datasetLocation); this.hdtDictionary = this.processor.getDictionary(); this.nodeDictionary = new NodeDictionary(this.hdtDictionary); logger.debug("Dataset {} is loaded into HDT processor.", datasetLocation); } catch (IOException e) { ExceptionOutput.output(e, "Error loading HDT File", logger); throw new LuzzuIOException(e.getMessage()); } try { loadMetrics(); this.executor = Executors.newSingleThreadExecutor(); this.isInitalised = true; } catch (ExternalMetricLoaderException e) { ExceptionOutput.output(e, "Error loading metrics", logger); } }
System.out.println("Different subjects: "+hdt.getDictionary().getNsubjects()); System.out.println("Different predicates: "+hdt.getDictionary().getNpredicates()); System.out.println("Different objects: "+hdt.getDictionary().getNobjects()); System.out.println("Common Subject/Object:"+hdt.getDictionary().getNshared());
this.triples = graph.getHDT().getTriples(); this.prefixMap = NodeDictionary.getMapping(execCxt); this.numSharedSO = graph.getHDT().getDictionary().getNshared();
} else { long pred = hdt.getDictionary().getNpredicates(); if(pred>0) { return triples.getNumberOfElements()/pred;
Dictionary dictionary = hdtg.getHDT().getDictionary(); if(countVar.equals(triple.getSubject())) { count = dictionary.getNsubjects();