diff --git a/jena/JenaGraph/build.xml b/jena/JenaGraph/build.xml index 60e89449..e1d35570 100644 --- a/jena/JenaGraph/build.xml +++ b/jena/JenaGraph/build.xml @@ -93,11 +93,9 @@ - - + - + diff --git a/jena/JenaGraph/test/com/bbn/parliament/jena/graph/union/ComplexUnionGraphTest.java b/jena/JenaGraph/test/com/bbn/parliament/jena/graph/union/ComplexUnionGraphTest.java index 9a0fb73d..15047fe2 100644 --- a/jena/JenaGraph/test/com/bbn/parliament/jena/graph/union/ComplexUnionGraphTest.java +++ b/jena/JenaGraph/test/com/bbn/parliament/jena/graph/union/ComplexUnionGraphTest.java @@ -38,9 +38,10 @@ public class ComplexUnionGraphTest { private static final String ONT_RSRC = "univ-bench.owl"; private static final File INPUT_DATA_FILE = new File( - System.getProperty("test.data.path"), "gendata-80.zip"); + System.getProperty("test.data.path"), "univ-bench-03.zip"); private static final File KB_DATA_DIR = new File("./union-test-kb-data"); + @SuppressWarnings("unused") private static final String QUERY1 = "" + "PREFIX rdf: " + "PREFIX ub: " + @@ -62,6 +63,7 @@ public class ComplexUnionGraphTest { " ub:emailAddress ?y2 ; " + " ub:telephone ?y3 . " + "}"; + @SuppressWarnings("unused") private static final String QUERY3 = "" + "PREFIX rdf: " + "PREFIX ub: " + @@ -80,13 +82,18 @@ public class ComplexUnionGraphTest { " ?x a ub:GraduateStudent ; " + " ub:name ?y . " + "}"; - private static final String[] QUERYS = { QUERY1, QUERY2, QUERY3, QUERY4 }; + private static final String[] QUERYS = { + //QUERY1, + QUERY2, + //QUERY3, + QUERY4 + }; private static final Logger LOG = LoggerFactory.getLogger(ComplexUnionGraphTest.class); @SuppressWarnings("static-method") @Test - public void testCreateUnionGraph() throws IOException { + public void testComplexUnionGraph() throws IOException { try ( KbGraph bigGraph = createGraph(KB_DATA_DIR, "big"); KbGraph graph0 = createGraph(KB_DATA_DIR, "0"); @@ -134,8 +141,13 @@ private static KbGraph createGraph(File rootDir, String relativeDirectory) { File dir = new File(rootDir, relativeDirectory); dir.mkdirs(); KbConfig config = new KbConfig(); + KbConfig defaultConfig = new KbConfig(); config.readFromFile(); config.m_kbDirectoryPath = dir.getPath(); + config.m_initialRsrcCapacity = defaultConfig.m_initialRsrcCapacity; + config.m_initialStmtCapacity = defaultConfig.m_initialStmtCapacity; + config.m_rsrcGrowthIncrement = defaultConfig.m_rsrcGrowthIncrement; + config.m_stmtGrowthIncrement = defaultConfig.m_stmtGrowthIncrement; KbInstance.deleteKb(config, null); return new KbGraph(config, relativeDirectory, OptimizationMethod.DefaultOptimization); } @@ -155,6 +167,7 @@ private static Model createModel(KbGraph g) throws IOException { private static void loadUniversityData(Model m1, Model m2, int univNum) throws IOException { LOG.info("Loading university #{}:", univNum); + long start = System.currentTimeMillis(); Pattern pattern = Pattern.compile( String.format("^.*/University%1$d_.*$", univNum), Pattern.CASE_INSENSITIVE); try (ZipFile zipFile = new ZipFile(INPUT_DATA_FILE)) { @@ -164,15 +177,22 @@ private static void loadUniversityData(Model m1, Model m2, int univNum) throws I if (!zipEntry.isDirectory() && pattern.matcher(zipEntry.getName()).matches()) { Model tmpModel = ModelFactory.createDefaultModel(); RDFFormat rdfFmt = RDFFormat.parseFilename(zipEntry.getName()); + long parseStart = System.currentTimeMillis(); try (InputStream strm = zipFile.getInputStream(zipEntry)) { tmpModel.read(strm, null, rdfFmt.toString()); } + long parseDuration = System.currentTimeMillis() - parseStart; + long addStart = System.currentTimeMillis(); m1.add(tmpModel); m2.add(tmpModel); - LOG.info(" Loaded {} statements from file '{}'", tmpModel.size(), zipEntry.getName()); + long addDuration = System.currentTimeMillis() - addStart; + LOG.info(" Loaded {} statements from file '{}' in {} ms, added in {} ms", + tmpModel.size(), zipEntry.getName(), parseDuration, addDuration); } } } + long duration = System.currentTimeMillis() - start; + LOG.info("Loaded university #{} in {} ms", univNum, duration); } private static long timeCount(String modelName, String query, Model model) { diff --git a/jena/TemporalIndexProcessor_old/.classpath b/jena/TemporalIndexProcessor_old/.classpath index 869b63db..571537a3 100644 --- a/jena/TemporalIndexProcessor_old/.classpath +++ b/jena/TemporalIndexProcessor_old/.classpath @@ -5,6 +5,7 @@ - + +