// Path: src/de/uni_koblenz/west/splendid/vocabulary/VOID2.java
// public enum VOID2 {
// 	
// 	// concepts
// 	Dataset,
// 	Linkset,
// 	EquiWidthHist,
// 	EuqiDepthHist,
// 	
// 	// predicates
// 	vocabulary,
// 	sparqlEndpoint,
// 	distinctSubjects,
// 	distinctObjects,
// 	triples,
// 	classes,
// 	entities,
// 	properties,
// 	classPartition,
// 	clazz("class"),
// 	propertyPartition,
// 	property,
// 	target,
// 	linkPredicate,
// 	
// 	histogram,
// 	minValue,
// 	maxValue,
// 	bucketLoad,
// 	buckets,
// 	bucketDef;
// 	
// 	public static final String NAMESPACE = "http://rdfs.org/ns/void#";
// 	
// 	private final String uri;
// 	
// 	private VOID2(String name) {
// 		this.uri = NAMESPACE + name;
// 	}
// 	
// 	private VOID2() {
// 		this.uri = NAMESPACE + super.toString();
// 	}
// 	
// 	public String toString() {
// 		return this.uri;
// 	}
// 	
// }


import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.zip.GZIPInputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.openrdf.model.BNode;
import org.openrdf.model.Literal;
import org.openrdf.model.Resource;
import org.openrdf.model.Statement;
import org.openrdf.model.URI;
import org.openrdf.model.Value;
import org.openrdf.model.ValueFactory;
import org.openrdf.model.impl.ValueFactoryImpl;
import org.openrdf.model.vocabulary.RDF;
import org.openrdf.rio.RDFFormat;
import org.openrdf.rio.RDFHandlerException;
import org.openrdf.rio.RDFParseException;
import org.openrdf.rio.RDFParser;
import org.openrdf.rio.RDFWriter;
import org.openrdf.rio.Rio;
import org.openrdf.rio.helpers.RDFHandlerBase;
import de.uni_koblenz.west.splendid.vocabulary.VOID2;
		
		lastPredicate = predicate;
	}
	
	/**
	 * Analyzes the last statements (which have the same subject)
	 * and counts the predicates per type.
	 */
	private void processStoredStatements() {
		if (lastPredicate == null)
			return;
		
		predicates.add(lastPredicate);
		
		// TODO: write predicate statistics
//		System.out.println(lastPredicate + " [" + predCount + "], distS: " + distSubject.size() + ", distObj: " + distObject.size());
		writePredicateStatToVoid(lastPredicate, predCount, distSubject.size(), distObject.size());
		
		// clear stored values;
		distSubject.clear();
		distObject.clear();
		predCount = 0;
	}
	
	private void writePredicateStatToVoid(URI predicate, long pCount, int distS, int distO) {
		BNode propPartition = vf.createBNode();
		Literal count = vf.createLiteral(String.valueOf(pCount));
		Literal distinctS  = vf.createLiteral(String.valueOf(distS));
		Literal distinctO  = vf.createLiteral(String.valueOf(distO));
		try {
// Path: src/de/uni_koblenz/west/splendid/vocabulary/VOID2.java
// public enum VOID2 {
// 	
// 	// concepts
// 	Dataset,
// 	Linkset,
// 	EquiWidthHist,
// 	EuqiDepthHist,
// 	
// 	// predicates
// 	vocabulary,
// 	sparqlEndpoint,
// 	distinctSubjects,
// 	distinctObjects,
// 	triples,
// 	classes,
// 	entities,
// 	properties,
// 	classPartition,
// 	clazz("class"),
// 	propertyPartition,
// 	property,
// 	target,
// 	linkPredicate,
// 	
// 	histogram,
// 	minValue,
// 	maxValue,
// 	bucketLoad,
// 	buckets,
// 	bucketDef;
// 	
// 	public static final String NAMESPACE = "http://rdfs.org/ns/void#";
// 	
// 	private final String uri;
// 	
// 	private VOID2(String name) {
// 		this.uri = NAMESPACE + name;
// 	}
// 	
// 	private VOID2() {
// 		this.uri = NAMESPACE + super.toString();
// 	}
// 	
// 	public String toString() {
// 		return this.uri;
// 	}
// 	
// }


// Path: src/de/uni_koblenz/west/splendid/statistics/util/VoidGenerator.java
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.zip.GZIPInputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.openrdf.model.BNode;
import org.openrdf.model.Literal;
import org.openrdf.model.Resource;
import org.openrdf.model.Statement;
import org.openrdf.model.URI;
import org.openrdf.model.Value;
import org.openrdf.model.ValueFactory;
import org.openrdf.model.impl.ValueFactoryImpl;
import org.openrdf.model.vocabulary.RDF;
import org.openrdf.rio.RDFFormat;
import org.openrdf.rio.RDFHandlerException;
import org.openrdf.rio.RDFParseException;
import org.openrdf.rio.RDFParser;
import org.openrdf.rio.RDFWriter;
import org.openrdf.rio.Rio;
import org.openrdf.rio.helpers.RDFHandlerBase;
import de.uni_koblenz.west.splendid.vocabulary.VOID2;

		
		lastPredicate = predicate;
	}
	
	/**
	 * Analyzes the last statements (which have the same subject)
	 * and counts the predicates per type.
	 */
	private void processStoredStatements() {
		if (lastPredicate == null)
			return;
		
		predicates.add(lastPredicate);
		
		// TODO: write predicate statistics
//		System.out.println(lastPredicate + " [" + predCount + "], distS: " + distSubject.size() + ", distObj: " + distObject.size());
		writePredicateStatToVoid(lastPredicate, predCount, distSubject.size(), distObject.size());
		
		// clear stored values;
		distSubject.clear();
		distObject.clear();
		predCount = 0;
	}
	
	private void writePredicateStatToVoid(URI predicate, long pCount, int distS, int distO) {
		BNode propPartition = vf.createBNode();
		Literal count = vf.createLiteral(String.valueOf(pCount));
		Literal distinctS  = vf.createLiteral(String.valueOf(distS));
		Literal distinctO  = vf.createLiteral(String.valueOf(distO));
		try {
			writer.handleStatement(vf.createStatement(dataset, vf.createURI(VOID2.propertyPartition.toString()), propPartition));