Skip to content

Commit 9b7b9e8

Browse files
committed
update
1 parent 25c4fb8 commit 9b7b9e8

File tree

3 files changed

+30
-23
lines changed

3 files changed

+30
-23
lines changed

nb-configuration.xml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project-shared-configuration>
3+
<!--
4+
This file contains additional configuration written by modules in the NetBeans IDE.
5+
The configuration is intended to be shared among all the users of project and
6+
therefore it is assumed to be part of version control checkout.
7+
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
8+
-->
9+
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
10+
<!--
11+
Properties that influence various parts of the IDE, especially code formatting and the like.
12+
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
13+
That way multiple projects can share the same settings (useful for formatting rules for example).
14+
Any value defined here will override the pom.xml file value but is only applicable to the current project.
15+
-->
16+
<netbeans.compile.on.save>all</netbeans.compile.on.save>
17+
</properties>
18+
</project-shared-configuration>

pom.xml

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<dependency>
1717
<groupId>javax.servlet</groupId>
1818
<artifactId>javax.servlet-api</artifactId>
19-
<version>[4.0.1,]</version>
19+
<version>4.0.1</version>
2020
<scope>provided</scope>
2121
</dependency>
2222
<!--<dependency>
@@ -28,23 +28,23 @@
2828
<dependency>
2929
<groupId>commons-validator</groupId>
3030
<artifactId>commons-validator</artifactId>
31-
<version>[1.7,]</version>
31+
<version>1.8.0</version>
3232
</dependency>
3333
<dependency>
3434
<groupId>org.postgresql</groupId>
3535
<artifactId>postgresql</artifactId>
36-
<version>[42.3.3,]</version>
36+
<version>42.7.3</version>
3737
</dependency>
3838
<dependency>
3939
<groupId>org.apache.jena</groupId>
4040
<artifactId>apache-jena</artifactId>
4141
<type>pom</type>
42-
<version>[4.4.0,]</version>
42+
<version>4.10.0</version>
4343
</dependency>
4444
<dependency>
4545
<groupId>nz.ac.waikato.cms.weka</groupId>
4646
<artifactId>weka-stable</artifactId>
47-
<version>[3.8.6,]</version>
47+
<version>3.8.6</version>
4848
</dependency>
4949
</dependencies>
5050

@@ -67,8 +67,8 @@
6767
<artifactId>maven-compiler-plugin</artifactId>
6868
<version>3.10.1</version>
6969
<configuration>
70-
<source>18</source>
71-
<target>18</target>
70+
<source>22</source>
71+
<target>22</target>
7272
<compilerArguments>
7373
<endorseddirs>${endorsed.dir}</endorseddirs>
7474
</compilerArguments>

src/main/java/uff/ic/swlab/datasetsearch/classifier/BayesianClassifier.java

+5-16
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
/*
2-
* To change this license header, choose License Headers in Project Properties.
3-
* To change this template file, choose Tools | Templates
4-
* and open the template in the editor.
5-
*/
61
package uff.ic.swlab.datasetsearch.classifier;
72

83
import java.io.FileNotFoundException;
9-
import java.io.FileOutputStream;
104
import java.sql.Connection;
115
import java.sql.PreparedStatement;
126
import java.sql.ResultSet;
@@ -21,12 +15,10 @@
2115
import java.util.Set;
2216
import org.apache.jena.query.QueryExecution;
2317
import org.apache.jena.query.QueryExecutionFactory;
24-
import org.apache.jena.rdf.model.Literal;
2518
import org.apache.jena.rdf.model.Model;
2619
import org.apache.jena.rdf.model.ModelFactory;
2720
import org.apache.jena.rdf.model.Property;
2821
import org.apache.jena.rdf.model.Resource;
29-
import org.apache.jena.vocabulary.VCARD4;
3022

3123
/**
3224
*
@@ -41,9 +33,8 @@ public static Float GetProbability(int linkset, int dataset, Connection conn) th
4133
stm.setInt(1, linkset);
4234
stm.setInt(2, dataset);
4335
ResultSet rs = stm.executeQuery();
44-
while (rs.next()) {
36+
while (rs.next())
4537
result = rs.getFloat("prob");
46-
}
4738
rs.close();
4839
stm.close();
4940
return result;
@@ -55,9 +46,8 @@ public static Float GetProbabilityGlobal(int dataset, Connection conn) throws SQ
5546
PreparedStatement stm = conn.prepareStatement(qr);
5647
stm.setInt(1, dataset);
5748
ResultSet rs = stm.executeQuery();
58-
while (rs.next()) {
49+
while (rs.next())
5950
result = rs.getFloat("prob");
60-
}
6151
rs.close();
6252
stm.close();
6353
return result;
@@ -121,16 +111,15 @@ public int compare(Entry<String, Double> o1, Entry<String, Double> o2) {
121111
for (Map.Entry<String, Double> pair : list) {
122112

123113
int t = java.lang.Double.compare(pair.getValue(), Double.NEGATIVE_INFINITY);
124-
if (t == 0) {
114+
if (t == 0)
125115
result = -Double.MAX_VALUE;
126-
} else {
116+
else
127117
result = pair.getValue();
128-
}
129118
Resource resouce = model.createResource(pair.getKey())
130119
.addProperty(property_rank, hasRank)
131120
.addProperty(property_value, model.createTypedLiteral(result));
132121
}
133-
122+
134123
String qr = "PREFIX vrank: <http://purl.org/voc/vrank#>\n"
135124
+ "\n"
136125
+ "CONSTRUCT {?dataset a vrank:hasrank. \n"

0 commit comments

Comments
 (0)