-
Notifications
You must be signed in to change notification settings - Fork 35
/
WNDiag.jsp
106 lines (90 loc) · 4.57 KB
/
WNDiag.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<%@ include file="Prelude.jsp" %>
<html>
<head><title> WordNet Diagnostics </title></head>
<body BGCOLOR="#FFFFFF">
<%
/** This code is copyright Articulate Software (c) 2003. Some portions
copyright Teknowledge (c) 2003 and reused under the terms of the GNU license.
This software is released under the GNU Public License <http://www.gnu.org/copyleft/gpl.html>.
Users of this code also consent, by use of this code, to credit Articulate Software
and Teknowledge in any writings, briefings, publications, presentations, or
other representations of any software which incorporates, builds on, or uses this
code. Please cite the following article in any publication with references:
Pease, A., (2003). The Sigma Ontology Development Environment,
in Working Notes of the IJCAI-2003 Workshop on Ontology and Distributed Systems,
August 9, Acapulco, Mexico. See also http://github.com/ontologyportal
*/
if (!role.equals("admin") && !role.equals("user")) {
response.sendRedirect("KBs.jsp");
return;
}
StringBuffer show = new StringBuffer(); // Variable to contain the HTML page generated.
String kbHref = null;
String htmlDivider = "<table ALIGN='LEFT' WIDTH='50%'><tr><TD BGCOLOR='#A8BACF'><IMG SRC='pixmaps/1pixel.gif' width=1 height=1 border=0></TD></tr></table><BR><BR>\n";
String formattedFormula = null;
Map theMap = null;
kbHref = HTMLformatter.createHrefStart() + "/sigma/WordNet.jsp?lang=" + language + "&kb=" + kbName;
try {
WordNet.initOnce();
}
catch (Exception e) {
System.out.println("Error in WNDiag.jsp:" + e.getMessage());
e.printStackTrace();
out.print("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=KBs.jsp\">");
}
%>
<FORM action="WNDiag.jsp">
<%
String pageName = "WNDiag";
String pageString = "WordNet Diagnostics";
%>
<%@include file="CommonHeader.jsp" %>
<%
out.println(WordNetUtilities.printStatistics());
ArrayList synsetsWithoutTerms = WNdiagnostics.synsetsWithoutTerms();
ArrayList nonRelationTermsWithoutSynsets = WNdiagnostics.nonRelationTermsWithoutSynsets();
ArrayList synsetsWithoutFoundTerms = WNdiagnostics.synsetsWithoutFoundTerms(kb);
ArrayList nonMatchingTaxonomy = WNdiagnostics.nonMatchingTaxonomy(kbName,language);
boolean isError = !(synsetsWithoutTerms.isEmpty() &&
synsetsWithoutFoundTerms.isEmpty() &&
nonMatchingTaxonomy.isEmpty());
if (!isError)
out.println("<br><b> No errors found</b>");
else {
if (!nonRelationTermsWithoutSynsets.isEmpty()) {
show.setLength(0);
out.println("<table ALIGN=\"LEFT\" WIDTH=\"50%\"><tr><td BGCOLOR=\"#A8BACF\"><img src=\"pixmaps/1pixel.gif\" width=\"1\" height=\"1\" border=\"0\"></td></tr></table><p>");
show.append(HTMLformatter.synsetList(nonRelationTermsWithoutSynsets,kbHref));
out.println("<br><b> Error: nonRelationTermsWithoutSynsets</b>");
out.println(show.toString() + "<br>");
}
if (!synsetsWithoutTerms.isEmpty()) {
show.setLength(0);
out.println("<table ALIGN=\"LEFT\" WIDTH=\"50%\"><tr><td BGCOLOR=\"#A8BACF\"><img src=\"pixmaps/1pixel.gif\" width=\"1\" height=\"1\" border=\"0\"></td></tr></table><p>");
show.append(HTMLformatter.synsetList(synsetsWithoutTerms,kbHref));
out.println("<br><b> Error: synsetsWithoutTerms</b>");
out.println(show.toString() + "<br>");
}
if (!synsetsWithoutFoundTerms.isEmpty()) {
show.setLength(0);
out.println("<table ALIGN=\"LEFT\" WIDTH=\"50%\"><tr><td BGCOLOR=\"#A8BACF\"><img src=\"pixmaps/1pixel.gif\" width=\"1\" height=\"1\" border=\"0\"></td></tr></table><p>");
show.append(HTMLformatter.synsetList(synsetsWithoutFoundTerms,kbHref));
out.println("<br><b> Error: synsetsWithoutFoundTerms</b>");
out.println(show.toString() + "<br>");
}
if (!nonMatchingTaxonomy.isEmpty()) {
show.setLength(0);
out.println("<table ALIGN=\"LEFT\" WIDTH=\"50%\"><tr><td BGCOLOR=\"#A8BACF\"><img src=\"pixmaps/1pixel.gif\" width=\"1\" height=\"1\" border=\"0\"></td></tr></table><p>");
for (int i = 0; i < nonMatchingTaxonomy.size(); i++) {
show.append((String) nonMatchingTaxonomy.get(i));
}
out.println("<br><b> Error: nonMatchingTaxonomy</b>");
out.println(show.toString() + "<br>");
}
out.println("<table ALIGN=\"LEFT\" WIDTH=\"50%\"><tr><td BGCOLOR=\"#A8BACF\"><img src=\"pixmaps/1pixel.gif\" width=\"1\" height=\"1\" border=\"0\"></td></tr></table><p>");
}
%>
<p>
<%@ include file="Postlude.jsp" %>
</body>
</html>