Skip to content

Commit

Permalink
fixed javadoc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
anbo-de committed Jun 15, 2024
1 parent 0e44692 commit fe2012e
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 8 deletions.
2 changes: 1 addition & 1 deletion qanary-component-NED-DBpediaSpotlight/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.wdaqua.qanary.component</groupId>
<artifactId>qanary-component-NED-DBpediaSpotlight</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>

<parent>
<groupId>eu.wdaqua.qanary</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,28 @@ public class Application {

private static final Logger logger = LoggerFactory.getLogger(Application.class);


/**
* default main
* defalt main
*
* @param args
*/
public static void main(String[] args) {
applicationContext = SpringApplication.run(Application.class, args);
}

/**
* get configuration of configuration
*
* @param myDBpediaSpotlightServiceFetcher
* @param testQuestion
* @param confidenceMinimum
* @param endpoint
* @param performLiveCheckOnComponentStart
* @param ignore
* @return
* @throws DBpediaSpotlightServiceNotAvailable
*/
@Bean
public DBpediaSpotlightConfiguration myDBpediaSpotlightConfiguration( //
@Autowired DBpediaSpotlightServiceFetcher myDBpediaSpotlightServiceFetcher, //
Expand Down Expand Up @@ -80,6 +95,11 @@ private void checkSpotlightServiceAvailability(String testQuestion, String endpo
}
}

/**
* specific configuration of OpenAPI documentation
*
* @return
*/
@Bean
public OpenAPI customOpenAPI() {
String appVersion = getClass().getPackage().getImplementationVersion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,13 @@ public DBpediaSpotlightServiceFetcher(
this.minimumConfidence = minimumConfidence;
}


/**
* fetch data from the configured DBpedia Spotlight endpoint
*
*
* @param myQuestion
* @param endpoint
* @param minimumConfidence
* @return
* @throws Exception
* @throws ClientProtocolException
* @throws IOException
*/
public JsonArray getJsonFromService(String myQuestion) throws Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ public class FoundDBpediaResource {
public int support;
public double similarityScore;

/**
* constructor
*
* @param surfaceForm
* @param offset
* @param similarityScore
* @param support
* @param resource
*/
public FoundDBpediaResource(String surfaceForm, int offset, double similarityScore, int support, URI resource) {
this.begin = offset;
this.end = offset + surfaceForm.length();
Expand All @@ -23,6 +32,13 @@ public FoundDBpediaResource(String surfaceForm, int offset, double similaritySco
this.resource = resource;
}


/**
* constructor create from JSON
*
* @param jsonElement
* @throws URISyntaxException
*/
public FoundDBpediaResource(JsonElement jsonElement) throws URISyntaxException {
this(jsonElement.getAsJsonObject().get("surfaceForm").getAsString(),
jsonElement.getAsJsonObject().get("offset").getAsInt(),
Expand All @@ -31,22 +47,47 @@ public FoundDBpediaResource(JsonElement jsonElement) throws URISyntaxException {
new URI(jsonElement.getAsJsonObject().get("URI").getAsString()));
}

/**
* get begin index
*
* @return
*/
public int getBegin() {
return begin;
}

/**
* get end index
*
* @return
*/
public int getEnd() {
return end;
}

/**
* get DBpedia resource
*
* @return
*/
public URI getResource() {
return resource;
}

/**
* get support score
*
* @return
*/
public int getSupport() {
return support;
}


/**
* get similarity score
*
* @return
*/
public double getSimilarityScore() {
return similarityScore;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
package eu.wdaqua.qanary.component.dbpediaspotlight.ned.exceptions;

/**
* exception thrown when the DBpedia Spotlight service is not available
*/
public class DBpediaSpotlightServiceNotAvailable extends Exception {
private static final long serialVersionUID = 1L;

/**
* constructor
*
* @param message
*/
public DBpediaSpotlightServiceNotAvailable(String message) {
super(message);
}
Expand Down

0 comments on commit fe2012e

Please sign in to comment.