@Test public void testGetRDFTypes() throws Exception { RemoteCursor cursor = kb.getRDFTypes(); while (cursor.next()) { int typeIndex = cursor.getInt(1); String typeURI = kb.getURI(typeIndex); assertEquals(kb.getUriIndex(typeURI), typeIndex); } cursor.close(); }
@Override public ResultSetCursor getRDFTypes() throws Exception { if (typeIndex == -1) { typeIndex = getUriIndex(RDF.TYPE.toString()); } String sql = "SELECT DISTINCT object FROM relations WHERE (predicate = " + typeIndex + ")"; try { PreparedStatement pstmt = connection.prepareStatement(sql); ResultSet rs = executeQuery(pstmt, sql); return new ResultSetCursor(rs); } catch (Exception e) { log.log(Level.SEVERE, "an error occurred in executing SQL query: " + sql, e); throw e; } }
PostgresKB implements KnowledgeBase { @Override public ResultSetCursor getRDFTypes() throws Exception { if (typeIndex == -1) { typeIndex = getUriIndex(RDF.TYPE.toString()); } String sql = "SELECT DISTINCT object FROM relations WHERE (predicate = " + typeIndex + ")"; try { PreparedStatement pstmt = connection.prepareStatement(sql); ResultSet rs = executeQuery(pstmt, sql); return new ResultSetCursor(rs); } catch (Exception e) { log.log(Level.SEVERE, "an error occurred in executing SQL query: " + sql, e); throw e; } } }
PostgresKB implements KnowledgeBase { @Override public ResultSetCursor getRDFTypes() throws Exception { if (typeIndex == -1) { typeIndex = getUriIndex(RDF.TYPE.toString()); } String sql = "SELECT DISTINCT object FROM relations WHERE (predicate = " + typeIndex + ")"; try { PreparedStatement pstmt = connection.prepareStatement(sql); ResultSet rs = executeQuery(pstmt, sql); return new ResultSetCursor(rs); } catch (Exception e) { log.log(Level.SEVERE, "an error occurred in executing SQL query: " + sql, e); throw e; } } PostgresKB(Connection connection, String session, URI uri); protected  PostgresKB(Connection connection, String session, URI uri, String dbSchema, String indexSchema); }
PostgresKB implements KnowledgeBase { @Override public ResultSetCursor getRDFTypes() throws Exception { if (typeIndex == -1) { typeIndex = getUriIndex(RDF.TYPE.toString()); } String sql = "SELECT DISTINCT object FROM relations WHERE (predicate = " + typeIndex + ")"; try { PreparedStatement pstmt = connection.prepareStatement(sql); ResultSet rs = executeQuery(pstmt, sql); return new ResultSetCursor(rs); } catch (Exception e) { log.log(Level.SEVERE, "an error occurred in executing SQL query: " + sql, e); throw e; } } PostgresKB(Connection connection, String session, URI uri); protected  PostgresKB(Connection connection, String session, URI uri, String dbSchema, String indexSchema); @Override URI getUri(); @Override ResultSetCursor getDatatypePropertyValues(
			int[] datatypePropertyFilter, SuffixArray suffixArray); @Override ResultSetCursor getInstanceCandidates(
			Map<Integer, Set<Integer>> literalKeys); @Override ResultSetCursor dbSort(List<String> index, int maxLength); @Override int getLiteralIndex(String literal); @Override String getURI(int index); @Override String getLiteral(int index); @Override int getUriIndex(String uri); @Override ResultSetCursor getOutgoingRelations(int[] instances); @Override ResultSetCursor getIncomingRelations(int[] instances); @Override ResultSetCursor getRDFTypesForInstances(int[] subjects); @Override ResultSetCursor getInstancesOfTypes(int type, int count); @Override ResultSetCursor getRDFTypes(); @Override int[] getClusters(); @Override int[] getDatatypePropertyByClass(int cluster, double t); @Override Collection<int[]> getConnectingClusters(int objectProperty, double t); @Override int getCluster(int[] types); @Override int getPropertyType(int property); @Override void preprocessRdfData(InputStream[] datasets,
			MediaType rdfMimeType, MediaType fileMimeType,
			String absoluteBaseURI, LiteralHashing hashing); @Override void calculateCardinalities(); @Override double getSubjectCardinality(int p); @Override void calculateMarkovChain(int[] blackListedProperties,
			int sampleCount); @Override double getMarkovProbability(int subject, int predicate, int object); @Override List<double[]> getMaxMarkovProbability(int subject, int object, int k); @Override TIntObjectHashMap<TIntObjectHashMap<double[]>> getCoverageAmbiguity(); @Override void calculateProperNameStatistics(TextCorpus corpus, Pipeline pipe); @Override DoubleMatrix getTypeCorrelations(int samples); @Override void clusterCorrelatingClasses(int samples, double biasThreshold,
			double pruningThreshold); @Override void calculateRegexDistributions(String[] regexs); @Override TIntDoubleHashMap getDatatypePropertiesForRegex(String regex); @Override String[] getRegexs(); }
PostgresKB implements KnowledgeBase { @Override public ResultSetCursor getRDFTypes() throws Exception { if (typeIndex == -1) { typeIndex = getUriIndex(RDF.TYPE.toString()); } String sql = "SELECT DISTINCT object FROM relations WHERE (predicate = " + typeIndex + ")"; try { PreparedStatement pstmt = connection.prepareStatement(sql); ResultSet rs = executeQuery(pstmt, sql); return new ResultSetCursor(rs); } catch (Exception e) { log.log(Level.SEVERE, "an error occurred in executing SQL query: " + sql, e); throw e; } } PostgresKB(Connection connection, String session, URI uri); protected  PostgresKB(Connection connection, String session, URI uri, String dbSchema, String indexSchema); @Override URI getUri(); @Override ResultSetCursor getDatatypePropertyValues(
			int[] datatypePropertyFilter, SuffixArray suffixArray); @Override ResultSetCursor getInstanceCandidates(
			Map<Integer, Set<Integer>> literalKeys); @Override ResultSetCursor dbSort(List<String> index, int maxLength); @Override int getLiteralIndex(String literal); @Override String getURI(int index); @Override String getLiteral(int index); @Override int getUriIndex(String uri); @Override ResultSetCursor getOutgoingRelations(int[] instances); @Override ResultSetCursor getIncomingRelations(int[] instances); @Override ResultSetCursor getRDFTypesForInstances(int[] subjects); @Override ResultSetCursor getInstancesOfTypes(int type, int count); @Override ResultSetCursor getRDFTypes(); @Override int[] getClusters(); @Override int[] getDatatypePropertyByClass(int cluster, double t); @Override Collection<int[]> getConnectingClusters(int objectProperty, double t); @Override int getCluster(int[] types); @Override int getPropertyType(int property); @Override void preprocessRdfData(InputStream[] datasets,
			MediaType rdfMimeType, MediaType fileMimeType,
			String absoluteBaseURI, LiteralHashing hashing); @Override void calculateCardinalities(); @Override double getSubjectCardinality(int p); @Override void calculateMarkovChain(int[] blackListedProperties,
			int sampleCount); @Override double getMarkovProbability(int subject, int predicate, int object); @Override List<double[]> getMaxMarkovProbability(int subject, int object, int k); @Override TIntObjectHashMap<TIntObjectHashMap<double[]>> getCoverageAmbiguity(); @Override void calculateProperNameStatistics(TextCorpus corpus, Pipeline pipe); @Override DoubleMatrix getTypeCorrelations(int samples); @Override void clusterCorrelatingClasses(int samples, double biasThreshold,
			double pruningThreshold); @Override void calculateRegexDistributions(String[] regexs); @Override TIntDoubleHashMap getDatatypePropertiesForRegex(String regex); @Override String[] getRegexs();  }