Changeset 2402
- Timestamp:
- 08/12/08 14:05:09 (3 months ago)
- Files:
-
- trunk/plugins/analysis/edu.iu.nwb.analysis.extractcoauthorship/src/edu/iu/nwb/analysis/extractcoauthorship/algorithms/ExtractAlgorithm.java (modified) (3 diffs)
- trunk/plugins/analysis/edu.iu.nwb.analysis.extractcoauthorship/src/edu/iu/nwb/analysis/extractcoauthorship/algorithms/ExtractAlgorithmFactory.java (modified) (1 diff)
- trunk/plugins/analysis/edu.iu.nwb.analysis.extractcoauthorship/src/edu/iu/nwb/analysis/extractcoauthorship/metadata/SupportedFileTypes.java (modified) (1 diff)
- trunk/plugins/analysis/edu.iu.nwb.analysis.extractdirectednetfromtable/src/edu/iu/nwb/analysis/extractdirectednetfromtable/algorithms/ExtractDirectedNetworkAlgorithm.java (modified) (3 diffs)
- trunk/plugins/analysis/edu.iu.nwb.analysis.extractnetfromtable/src/edu/iu/nwb/analysis/extractnetfromtable/components/GraphContainer.java (modified) (12 diffs)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/.classpath (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/.project (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/.settings (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/.settings/org.eclipse.pde.core.prefs (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/META-INF (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/META-INF/MANIFEST.MF (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/OSGI-INF (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/OSGI-INF/algorithm.properties (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/OSGI-INF/component.xml (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/OSGI-INF/l10n (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/OSGI-INF/l10n/bundle_en.properties (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/OSGI-INF/metatype (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/OSGI-INF/metatype/METADATA.XML (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/build.properties (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src/edu (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src/edu/iu (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src/edu/iu/nwb (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src/edu/iu/nwb/composite (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src/edu/iu/nwb/composite/extractauthorpapernetwork (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src/edu/iu/nwb/composite/extractauthorpapernetwork/algorithm (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src/edu/iu/nwb/composite/extractauthorpapernetwork/algorithm/ExtractAuthorPaperNetwork.java (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src/edu/iu/nwb/composite/extractauthorpapernetwork/algorithm/ExtractAuthorPaperNetworkFactory.java (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src/edu/iu/nwb/composite/extractauthorpapernetwork/metadata (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src/edu/iu/nwb/composite/extractauthorpapernetwork/metadata/SupportedFileTypes.java (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src/edu/iu/nwb/composite/extractauthorpapernetwork/metadata/bibtex.properties (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src/edu/iu/nwb/composite/extractauthorpapernetwork/metadata/endnote.properties (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src/edu/iu/nwb/composite/extractauthorpapernetwork/metadata/isi.properties (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractauthorpapernetwork/src/edu/iu/nwb/composite/extractauthorpapernetwork/metadata/scopus.properties (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/.classpath (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/.project (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/.settings (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/.settings/org.eclipse.pde.core.prefs (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/META-INF (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/META-INF/MANIFEST.MF (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/OSGI-INF (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/OSGI-INF/algorithm.properties (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/OSGI-INF/component.xml (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/OSGI-INF/l10n (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/OSGI-INF/l10n/bundle_en.properties (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/OSGI-INF/metatype (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/OSGI-INF/metatype/METADATA.XML (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/build.properties (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/src (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/src/edu (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/src/edu/iu (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/src/edu/iu/nwb (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/src/edu/iu/nwb/composite (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/src/edu/iu/nwb/composite/extractpapercitationnetwork (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/src/edu/iu/nwb/composite/extractpapercitationnetwork/algorithm (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/src/edu/iu/nwb/composite/extractpapercitationnetwork/algorithm/ExtractPaperCitationNetwork.java (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/src/edu/iu/nwb/composite/extractpapercitationnetwork/algorithm/ExtractPaperCitationNetworkFactory.java (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/src/edu/iu/nwb/composite/extractpapercitationnetwork/metadata (added)
- trunk/plugins/composite/edu.iu.nwb.composite.extractpapercitationnetwork/src/edu/iu/nwb/composite/extractpapercitationnetwork/metadata/isi.properties (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plugins/analysis/edu.iu.nwb.analysis.extractcoauthorship/src/edu/iu/nwb/analysis/extractcoauthorship/algorithms/ExtractAlgorithm.java
r2246 r2402 10 10 import org.cishell.framework.algorithm.Algorithm; 11 11 import org.cishell.framework.algorithm.AlgorithmExecutionException; 12 import org.cishell.framework.algorithm.ProgressMonitor; 13 import org.cishell.framework.algorithm.ProgressTrackable; 12 14 import org.cishell.framework.data.BasicData; 13 15 import org.cishell.framework.data.Data; … … 16 18 17 19 import edu.iu.nwb.analysis.extractcoauthorship.metadata.SupportedFileTypes; 18 import edu.iu.nwb.analysis.extractcoauthorship.metadata.SupportedFileTypes.CitationFormat;19 20 import edu.iu.nwb.analysis.extractnetfromtable.components.ExtractNetworkFromTable; 20 21 import edu.iu.nwb.analysis.extractnetfromtable.components.GraphContainer; 21 22 import edu.iu.nwb.analysis.extractnetfromtable.components.InvalidColumnNameException; 22 23 23 public class ExtractAlgorithm implements Algorithm, SupportedFileTypes {24 public class ExtractAlgorithm implements Algorithm, SupportedFileTypes,ProgressTrackable { 24 25 Data[] data; 25 26 Dictionary parameters; 26 27 CIShellContext ciContext; 27 28 LogService logger; 29 ProgressMonitor progressMonitor; 30 31 public ProgressMonitor getProgressMonitor() { 32 // TODO Auto-generated method stub 33 return this.progressMonitor; 34 } 35 36 public void setProgressMonitor(ProgressMonitor monitor) { 37 this.progressMonitor = monitor; 38 39 } 28 40 29 41 public ExtractAlgorithm(Data[] dm, Dictionary parameters, … … 57 69 try{ 58 70 String authorColumn = CitationFormat.getAuthorColumnByName(fileFormat); 59 GraphContainer gc = GraphContainer.initializeGraph(dataTable, authorColumn, authorColumn, false, metaData, this.logger );71 GraphContainer gc = GraphContainer.initializeGraph(dataTable, authorColumn, authorColumn, false, metaData, this.logger,this.progressMonitor); 60 72 final prefuse.data.Graph outputGraph = gc.buildGraph(authorColumn, authorColumn, "|", this.logger); 61 73 final Data outputData1 = new BasicData(outputGraph, trunk/plugins/analysis/edu.iu.nwb.analysis.extractcoauthorship/src/edu/iu/nwb/analysis/extractcoauthorship/algorithms/ExtractAlgorithmFactory.java
r2207 r2402 36 36 37 37 String[] supportedFormats = SupportedFileTypes.supportedFormats; 38 39 for(int i = 0; i < supportedFormats.length; i++){40 System.out.println(supportedFormats[i]);41 }42 38 43 39 definition.addAttributeDefinition(ObjectClassDefinition.REQUIRED, trunk/plugins/analysis/edu.iu.nwb.analysis.extractcoauthorship/src/edu/iu/nwb/analysis/extractcoauthorship/metadata/SupportedFileTypes.java
r2207 r2402 12 12 13 13 public class CitationFormat{ 14 String name;15 String authorColumn;16 14 private static HashMap nameToColumn = new HashMap(); 17 15 18 16 public CitationFormat(String name, String authorColumn){ 19 this.name = name; 20 this.authorColumn = authorColumn; 21 CitationFormat.nameToColumn.put(this.name, this.authorColumn); 17 CitationFormat.nameToColumn.put(name, authorColumn); 22 18 } 23 19 24 public String getName(){25 return this.name;26 }27 28 public String getAuthorColumn(){29 return this.authorColumn;30 }31 32 20 public static String getAuthorColumnByName(String name){ 33 21 return CitationFormat.nameToColumn.get(name).toString(); trunk/plugins/analysis/edu.iu.nwb.analysis.extractdirectednetfromtable/src/edu/iu/nwb/analysis/extractdirectednetfromtable/algorithms/ExtractDirectedNetworkAlgorithm.java
r2245 r2402 7 7 import org.cishell.framework.algorithm.Algorithm; 8 8 import org.cishell.framework.algorithm.AlgorithmExecutionException; 9 import org.cishell.framework.algorithm.ProgressMonitor; 10 import org.cishell.framework.algorithm.ProgressTrackable; 9 11 import org.cishell.framework.data.BasicData; 10 12 import org.cishell.framework.data.Data; … … 17 19 import edu.iu.nwb.analysis.extractnetfromtable.components.PropertyHandler; 18 20 19 public class ExtractDirectedNetworkAlgorithm implements Algorithm {21 public class ExtractDirectedNetworkAlgorithm implements Algorithm, ProgressTrackable { 20 22 Data[] data; 21 23 Dictionary parameters; 22 24 CIShellContext context; 23 25 LogService logger; 26 ProgressMonitor progressMonitor; 24 27 25 public ExtractDirectedNetworkAlgorithm(Data[] data, Dictionary parameters, CIShellContext context) { 28 29 30 public ProgressMonitor getProgressMonitor() { 31 // TODO Auto-generated method stub 32 return this.progressMonitor; 33 } 34 35 public void setProgressMonitor(ProgressMonitor monitor) { 36 this.progressMonitor = monitor; 37 } 38 39 public ExtractDirectedNetworkAlgorithm(Data[] data, Dictionary parameters, CIShellContext context) { 26 40 this.data = data; 27 41 this.parameters = parameters; … … 49 63 50 64 try{ 51 GraphContainer gc = GraphContainer.initializeGraph(dataTable, sourceColumn, targetColumn, true,functions, this.logger );65 GraphContainer gc = GraphContainer.initializeGraph(dataTable, sourceColumn, targetColumn, true,functions, this.logger,this.progressMonitor); 52 66 Graph directedNetwork = gc.buildGraph(sourceColumn, targetColumn, split, this.logger); 53 67 trunk/plugins/analysis/edu.iu.nwb.analysis.extractnetfromtable/src/edu/iu/nwb/analysis/extractnetfromtable/components/GraphContainer.java
r2251 r2402 8 8 import java.util.regex.Pattern; 9 9 10 import org.cishell.framework.algorithm.ProgressMonitor; 10 11 import org.osgi.service.log.LogService; 11 12 … … 22 23 private AggregateFunctionMappings nodeMap; 23 24 private AggregateFunctionMappings edgeMap; 25 private ProgressMonitor progMonitor = null; 24 26 25 27 public GraphContainer(Graph g, Table t, AggregateFunctionMappings nodeFunctionMap, AggregateFunctionMappings edgeFunctionMap){ … … 30 32 } 31 33 34 public GraphContainer(Graph g, Table t, AggregateFunctionMappings nodeFunctionMap, AggregateFunctionMappings edgeFunctionMap, ProgressMonitor pm){ 35 this.graph = g; 36 this.table = t; 37 this.nodeMap = nodeFunctionMap; 38 this.edgeMap = edgeFunctionMap; 39 this.progMonitor = pm; 40 } 41 32 42 public Graph buildGraph(String sourceColumnName, String targetColumnName, String splitString, LogService log){ 33 43 if(this.graph.isDirected()){ … … 37 47 } 38 48 } 39 49 40 50 private Graph buildUndirectedGraph(String sourceColumnName, String targetColumnName, String splitString, LogService log){ 41 51 boolean dupValues = false; 42 52 final HashMap dupValuesErrorMessages = new HashMap(); 43 44 45 53 int rows = this.table.getRowCount(); 54 int count = 0; 55 56 if(this.progMonitor != null){ 57 this.progMonitor.start(ProgressMonitor.WORK_TRACKABLE, rows); 58 } 59 46 60 for (Iterator it = this.table.rows(); it.hasNext();){ 47 61 Node node1 = null; … … 65 79 if(seenObject.add(objects[j])){ //no duplicate nodes. 66 80 node2 = NodeContainer.mutateNode(objects[j], this.graph, this.table, row, this.nodeMap, AggregateFunctionMappings.SOURCEANDTARGET); 67 81 68 82 } 69 83 //create or modify an edge as necessary … … 87 101 //ExtractNetworkFromTable.printNoValueToExtractError(title, columnName, this.log); 88 102 } 103 count = count+1; 104 if(this.progMonitor != null) 105 this.progMonitor.worked(count); 106 89 107 } 90 108 for(Iterator dupIter = dupValuesErrorMessages.keySet().iterator(); dupIter.hasNext();){ 91 109 log.log(LogService.LOG_WARNING, (String)dupValuesErrorMessages.get(dupIter.next())); 92 110 } 93 111 94 112 return this.graph; 95 113 } 96 114 97 115 private Graph buildDirectedGraph(String sourceColumnName, String targetColumnName, String splitString, LogService log){ 98 116 final Pattern p = Pattern.compile("\\Q" + splitString + "\\E"); … … 102 120 Node node1; 103 121 Node node2; 122 123 int rows = this.table.getRowCount(); 124 int count = 0; 125 126 if(this.progMonitor != null){ 127 this.progMonitor.start(ProgressMonitor.WORK_TRACKABLE, rows); 128 } 129 104 130 for (Iterator it = this.table.rows(); it.hasNext();){ 105 131 … … 119 145 if(seenSource.add(sources[i])){ 120 146 node1 = NodeContainer.mutateNode(sources[i],this.graph,this.table,row,this.nodeMap,AggregateFunctionMappings.SOURCE); 121 seenTarget = new HashSet();122 147 seenTarget = new HashSet(); 148 123 149 for (int j = 0; j < targets.length; j++) { 124 if(seenTarget.add(targets[j])){125 node2 = NodeContainer.mutateNode(targets[j],this.graph,this.table,row,this.nodeMap,AggregateFunctionMappings.TARGET);126 127 EdgeContainer.mutateEdge(node1,node2,this.graph,this.table,row,this.edgeMap);150 if(seenTarget.add(targets[j])){ 151 node2 = NodeContainer.mutateNode(targets[j],this.graph,this.table,row,this.nodeMap,AggregateFunctionMappings.TARGET); 152 153 EdgeContainer.mutateEdge(node1,node2,this.graph,this.table,row,this.edgeMap); 128 154 } 129 155 } 130 156 } 131 157 } 132 }133 else{158 } 159 else{ 134 160 //String title = (String)pdt.get(row,pdt.getColumnNumber("TI")); 135 161 String title = "unknown"; 136 162 //ExtractNetworkFromTable.printNoValueToExtractError(title, sourceColumnName, log); 137 163 } 164 count = count+1; 165 if(this.progMonitor != null) 166 this.progMonitor.worked(count); 138 167 } 139 168 for(Iterator dupIter = dupValuesErrorMessages.keySet().iterator(); dupIter.hasNext();){ … … 144 173 return this.graph; 145 174 } 146 175 147 176 public static GraphContainer initializeGraph(Table pdt,String sourceColumnName, String targetColumnName, boolean isDirected,Properties p, LogService log) throws InvalidColumnNameException{ 148 177 … … 151 180 if(inputSchema.getColumnIndex(sourceColumnName) < 0) 152 181 throw new InvalidColumnNameException(sourceColumnName + " was not a column in this table.\n"); 153 182 154 183 if(inputSchema.getColumnIndex(targetColumnName) < 0) 155 184 throw new InvalidColumnNameException(targetColumnName + " was not a column in this table.\n"); … … 157 186 Schema nodeSchema = createNodeSchema(); 158 187 Schema edgeSchema = createEdgeSchema(); 159 188 160 189 AggregateFunctionMappings nodeAggregateFunctionMap = new AggregateFunctionMappings(); 161 190 AggregateFunctionMappings edgeAggregateFunctionMap = new AggregateFunctionMappings(); 162 191 163 192 AggregateFunctionMappings.parseProperties(inputSchema, nodeSchema, edgeSchema, p, 164 193 nodeAggregateFunctionMap, edgeAggregateFunctionMap, log); … … 166 195 Graph outputGraph = new Graph(nodeSchema.instantiate(), 167 196 edgeSchema.instantiate(), isDirected); 168 169 197 198 170 199 171 200 return new GraphContainer(outputGraph,pdt,nodeAggregateFunctionMap,edgeAggregateFunctionMap); 201 202 } 203 204 public static GraphContainer initializeGraph(Table pdt,String sourceColumnName, String targetColumnName, boolean isDirected,Properties p, LogService log, ProgressMonitor pm) throws InvalidColumnNameException{ 205 206 final Schema inputSchema = pdt.getSchema(); 207 208 if(inputSchema.getColumnIndex(sourceColumnName) < 0) 209 throw new InvalidColumnNameException(sourceColumnName + " was not a column in this table.\n"); 210 211 if(inputSchema.getColumnIndex(targetColumnName) < 0) 212 throw new InvalidColumnNameException(targetColumnName + " was not a column in this table.\n"); 213 214 Schema nodeSchema = createNodeSchema(); 215 Schema edgeSchema = createEdgeSchema(); 216 217 AggregateFunctionMappings nodeAggregateFunctionMap = new AggregateFunctionMappings(); 218 AggregateFunctionMappings edgeAggregateFunctionMap = new AggregateFunctionMappings(); 219 220 AggregateFunctionMappings.parseProperties(inputSchema, nodeSchema, edgeSchema, p, 221 nodeAggregateFunctionMap, edgeAggregateFunctionMap, log); 222 223 Graph outputGraph = new Graph(nodeSchema.instantiate(), 224 edgeSchema.instantiate(), isDirected); 225 226 227 228 return new GraphContainer(outputGraph,pdt,nodeAggregateFunctionMap,edgeAggregateFunctionMap,pm); 172 229 173 230 }
