// Path: src/main/java/org/nanopub/Nanopub.java
// public interface Nanopub {
// 
// 	// URIs in the nanopub namespace:
// 	public static final IRI NANOPUB_TYPE_URI = SimpleValueFactory.getInstance().createIRI("http://www.nanopub.org/nschema#Nanopublication");
// 	public static final IRI HAS_ASSERTION_URI = SimpleValueFactory.getInstance().createIRI("http://www.nanopub.org/nschema#hasAssertion");
// 	public static final IRI HAS_PROVENANCE_URI = SimpleValueFactory.getInstance().createIRI("http://www.nanopub.org/nschema#hasProvenance");
// 	public static final IRI HAS_PUBINFO_URI = SimpleValueFactory.getInstance().createIRI("http://www.nanopub.org/nschema#hasPublicationInfo");
// 
// 	// URIs that link nanopublications:
// 	public static final IRI SUPERSEDES = SimpleValueFactory.getInstance().createIRI("http://purl.org/nanopub/x/supersedes");
// 
// 	public IRI getUri();
// 
// 	public IRI getHeadUri();
// 
// 	public Set<Statement> getHead();
// 
// 	public IRI getAssertionUri();
// 
// 	public Set<Statement> getAssertion();
// 
// 	public IRI getProvenanceUri();
// 
// 	public Set<Statement> getProvenance();
// 
// 	public IRI getPubinfoUri();
// 
// 	public Set<Statement> getPubinfo();
// 
// 	public Set<IRI> getGraphUris();
// 
// 	// TODO: Now that we have SimpleCreatorPattern and SimpleTimestampPattern,
// 	// we might not need the following three methods anymore...
// 
// 	public Calendar getCreationTime();
// 
// 	public Set<IRI> getAuthors();
// 
// 	public Set<IRI> getCreators();
// 
// 	public int getTripleCount();
// 
// 	public long getByteCount();
// 
// }


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.CookieSpecs;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.util.EntityUtils;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Statement;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.model.vocabulary.RDF;
import org.nanopub.Nanopub;

	static {
		// Hard-coded server instances:
		bootstrapServerList.add("http://server.nanopubs.lod.labs.vu.nl/");
		bootstrapServerList.add("http://130.60.24.146:7880/");
		bootstrapServerList.add("https://server.nanopubs.knows.idlab.ugent.be/");
		bootstrapServerList.add("https://openphacts.cs.man.ac.uk/nanopub/server/");
		bootstrapServerList.add("http://server.np.scify.org/");
		bootstrapServerList.add("http://app.tkuhn.eculture.labs.vu.nl/nanopub-server-1/");
		bootstrapServerList.add("http://app.tkuhn.eculture.labs.vu.nl/nanopub-server-2/");
		bootstrapServerList.add("http://app.tkuhn.eculture.labs.vu.nl/nanopub-server-3/");
		bootstrapServerList.add("http://app.tkuhn.eculture.labs.vu.nl/nanopub-server-4/");
	}

	public static List<String> getBootstrapServerList() {
		return bootstrapServerList;
	}

	public static int getVersionValue(String versionString) {
		try {
			int major = Integer.parseInt(versionString.split("\\.")[0]);
			int minor = Integer.parseInt(versionString.split("\\.")[1]);
			return (major * 1000) + minor;
		} catch (Exception ex) {
			return 0;
		}
	}

	public static final IRI PROTECTED_NANOPUB = SimpleValueFactory.getInstance().createIRI("http://purl.org/nanopub/x/ProtectedNanopub");

// Path: src/main/java/org/nanopub/Nanopub.java
// public interface Nanopub {
// 
// 	// URIs in the nanopub namespace:
// 	public static final IRI NANOPUB_TYPE_URI = SimpleValueFactory.getInstance().createIRI("http://www.nanopub.org/nschema#Nanopublication");
// 	public static final IRI HAS_ASSERTION_URI = SimpleValueFactory.getInstance().createIRI("http://www.nanopub.org/nschema#hasAssertion");
// 	public static final IRI HAS_PROVENANCE_URI = SimpleValueFactory.getInstance().createIRI("http://www.nanopub.org/nschema#hasProvenance");
// 	public static final IRI HAS_PUBINFO_URI = SimpleValueFactory.getInstance().createIRI("http://www.nanopub.org/nschema#hasPublicationInfo");
// 
// 	// URIs that link nanopublications:
// 	public static final IRI SUPERSEDES = SimpleValueFactory.getInstance().createIRI("http://purl.org/nanopub/x/supersedes");
// 
// 	public IRI getUri();
// 
// 	public IRI getHeadUri();
// 
// 	public Set<Statement> getHead();
// 
// 	public IRI getAssertionUri();
// 
// 	public Set<Statement> getAssertion();
// 
// 	public IRI getProvenanceUri();
// 
// 	public Set<Statement> getProvenance();
// 
// 	public IRI getPubinfoUri();
// 
// 	public Set<Statement> getPubinfo();
// 
// 	public Set<IRI> getGraphUris();
// 
// 	// TODO: Now that we have SimpleCreatorPattern and SimpleTimestampPattern,
// 	// we might not need the following three methods anymore...
// 
// 	public Calendar getCreationTime();
// 
// 	public Set<IRI> getAuthors();
// 
// 	public Set<IRI> getCreators();
// 
// 	public int getTripleCount();
// 
// 	public long getByteCount();
// 
// }


// Path: src/main/java/org/nanopub/extra/server/NanopubServerUtils.java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.CookieSpecs;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.util.EntityUtils;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Statement;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.model.vocabulary.RDF;
import org.nanopub.Nanopub;


	static {
		// Hard-coded server instances:
		bootstrapServerList.add("http://server.nanopubs.lod.labs.vu.nl/");
		bootstrapServerList.add("http://130.60.24.146:7880/");
		bootstrapServerList.add("https://server.nanopubs.knows.idlab.ugent.be/");
		bootstrapServerList.add("https://openphacts.cs.man.ac.uk/nanopub/server/");
		bootstrapServerList.add("http://server.np.scify.org/");
		bootstrapServerList.add("http://app.tkuhn.eculture.labs.vu.nl/nanopub-server-1/");
		bootstrapServerList.add("http://app.tkuhn.eculture.labs.vu.nl/nanopub-server-2/");
		bootstrapServerList.add("http://app.tkuhn.eculture.labs.vu.nl/nanopub-server-3/");
		bootstrapServerList.add("http://app.tkuhn.eculture.labs.vu.nl/nanopub-server-4/");
	}

	public static List<String> getBootstrapServerList() {
		return bootstrapServerList;
	}

	public static int getVersionValue(String versionString) {
		try {
			int major = Integer.parseInt(versionString.split("\\.")[0]);
			int minor = Integer.parseInt(versionString.split("\\.")[1]);
			return (major * 1000) + minor;
		} catch (Exception ex) {
			return 0;
		}
	}

	public static final IRI PROTECTED_NANOPUB = SimpleValueFactory.getInstance().createIRI("http://purl.org/nanopub/x/ProtectedNanopub");

	public static boolean isProtectedNanopub(Nanopub np) {