Skip to content

Commit 4fe1257

Browse files
authored
Merge pull request #508 from ontologyportal/Rose_5-18-26
Removed Logging Pollution and Refactored KBmanager.initializeOnce()
2 parents dabc624 + 7af6b09 commit 4fe1257

9 files changed

Lines changed: 183 additions & 297 deletions

File tree

.github/workflows/ant.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ on:
77
branches: [ "master", "main" ]
88
pull_request:
99
branches: [ "master", "main" ]
10-
10+
workflow_dispatch:
11+
1112
env:
1213
DEFAULT_DOCKER_ACCOUNT: apease
1314
SUMO_REF: 5051a4ebf1a8d1c00e602bcdabaa7b5bd3a5ed1c

src/java/com/articulate/sigma/FormulaPreprocessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ private Map<String,Set<String>> computeVariableTypesRecurse(KB kb, Formula f,
721721
if (Formula.isQuantifier(carstr)) // skip the quantified variable list
722722
start = 2;
723723
if (Formula.isLogicalOperator(carstr) && f.listLength() == 2 && f.getArgument(1).isVariable()) {
724-
System.out.println("INFO in FormulaPreprocessor.computeVariableTypesRecurse(): logical op with var arg " + f.getFormula());
724+
// System.out.println("INFO in FormulaPreprocessor.computeVariableTypesRecurse(): logical op with var arg " + f.getFormula());
725725
MapUtils.addToMap(result,f.getArgument(1).toString(),"Formula"); // When a variable is an argument to a logical operator, it's a formula
726726
}
727727
Formula farg;

src/java/com/articulate/sigma/HTMLformatter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public static String showStatistics(KB kb) {
346346
long serLastModified = kbManagerSer.exists() ? kbManagerSer.lastModified() : 0L;
347347
long cacheLastModified = cacheFile.exists() ? cacheFile.lastModified() : 0L;
348348
if (cacheFile.exists() && cacheLastModified >= serLastModified) {
349-
System.out.println("[showStatistics] Using cached HTML stats for " + kb.name);
349+
// System.out.println("[showStatistics] Using cached HTML stats for " + kb.name);
350350
return Files.readString(cacheFile.toPath(), StandardCharsets.UTF_8);
351351
}
352352
System.out.println("[showStatistics] Recomputing statistics for " + kb.name);

src/java/com/articulate/sigma/KBmanager.java

Lines changed: 172 additions & 286 deletions
Large diffs are not rendered by default.

src/java/com/articulate/sigma/parsing/FormulaAST.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,10 @@ public void read(String s) {
197197
this.isDoc = parsed.isDoc;
198198
this.isRule = parsed.isRule;
199199
this.containsNumber = parsed.containsNumber;
200-
}else{
201-
System.out.println("[FormulaAST - read] : SuokifVisitor couldn't parse the formula: " + s);
202200
}
201+
// else {
202+
// System.out.println("[FormulaAST - read] : SuokifVisitor couldn't parse the formula: " + s);
203+
// }
203204
}
204205

205206

src/java/com/articulate/sigma/trans/OWLtranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ private void writeWordNetRelationDefinitions(PrintWriter pw) throws IOException
11551155
*/
11561156
private void writeWordNetSynset(PrintWriter pw, String synset) {
11571157

1158-
System.out.println("INFO in OWLtranslator.writeWordNetSynset(): " + synset);
1158+
// System.out.println("INFO in OWLtranslator.writeWordNetSynset(): " + synset);
11591159
if (synset.startsWith("WN30-"))
11601160
synset = synset.substring(5);
11611161
ArrayList al = (ArrayList) WordNet.wn.synsetsToWords.get(synset);

src/java/com/articulate/sigma/wordNet/WordNetUtilities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ public static char posNumberToLetter(char POS) {
413413
case '4': return 'r';
414414
case '5': return 's';
415415
}
416-
System.err.println("Error in WordNetUtilities.posNumberToLetter(): bad number: " + POS);
416+
// System.err.println("Error in WordNetUtilities.posNumberToLetter(): bad number: " + POS);
417417
return 'n';
418418
}
419419

web/jsp/BrowseBody.jsp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ nonRelTerm = request.getParameter("nonrelation");
2121
relTerm = StringUtil.emptyString(relTerm) ? request.getParameter("relation") : "";
2222
2323
// ???
24-
if (!StringUtil.emptyString(filename)) {
24+
if (!StringUtil.emptyString(filename) && false) {
2525
int l = 0;
2626
if (!StringUtil.emptyString(line)) {
2727
try {l = Integer.parseInt(line);}
@@ -72,7 +72,7 @@ else if ((kb != null) && (term != null) && kb.containsTerm(term)) { // Build th
7272
Map<String, String> fm = kb.getFormatMap(lang);
7373
String fmValue = null;
7474
if (fm != null) fmValue = fm.get(term);
75-
if (fmValue == null) System.out.println("INFO in BrowseBody.jsp: No format map entry for \"" + term + "\" in language " + lang);
75+
//if (fmValue == null) System.out.println("INFO in BrowseBody.jsp: No format map entry for \"" + term + "\" in language " + lang);
7676
}
7777
else {
7878
Map<String, String> tfm = kb.getTermFormatMap(lang);
@@ -97,7 +97,6 @@ else if ((kb != null) && (term != null) && kb.containsTerm(term)) { // Build th
9797
if (!StringUtil.emptyString(verbs)) show.append("<P>" + verbs);
9898
show.append("</small></td>");
9999
}
100-
else System.out.println("INFO in BrowseBody.jsp: No synsets for term " + term);
101100
show.append("</tr></table>\n");
102101
}
103102
show.append ("</b></font></td></tr></table>\n");

web/jsp/KBs.jsp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
String baseDir = mgr.getPref("baseDir");
2323
String kbDir = mgr.getPref("kbDir");
2424
boolean isAdministrator = role.equalsIgnoreCase("admin");
25-
KBmanager.getMgr().initializeOnce();
2625
String pageName = "KBs";
2726
String pageString = "Knowledge Bases";
2827
%>

0 commit comments

Comments
 (0)