Skip to content

Commit

Permalink
[#274] Replace the invocation of loadConfiguration() with loadManualC…
Browse files Browse the repository at this point in the history
…onfiguration() in all methods that use it.

Refactor the code.
  • Loading branch information
palagdan committed Sep 27, 2024
1 parent 17e56c1 commit b92e542
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,9 @@ public class DatasetDiscoveryModule extends AnnotatedAbstractModule {

private static final String TYPE_URI = KBSS_MODULE.uri + "dataset-discovery-v1";

private static final Property P_USER_INPUT = getParameter("prp-user-input");
@Parameter(iri = TYPE_URI + "/" + "prp-user-input", comment = "Keywords query. Keywords are separated by space.")
private String userInput;

private static Property getParameter(final String name) {
return ResourceFactory.createProperty(TYPE_URI + "/" + name);
}

private List<String> getDatasetsForQuery(final String s, final String endpoint) {
final List<String> datasets = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class SUTimeModuleNew extends AnnotatedAbstractModule {
private static final Property P_PAGE_SIZE = ResourceFactory.createProperty(TYPE_PREFIX + "page-size");

@Parameter(iri = TYPE_PREFIX + "page-size", comment = "Page size. Default value is 10000.")
private Integer pageSize = DEFAULT_PAGE_SIZE;
private int pageSize = DEFAULT_PAGE_SIZE;

@Parameter(iri = SML.constructQuery,
comment = "List of construct queries. The module annotates the lexical form of objects of the output statements of these queries.")// TODO - revise comment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,23 +137,9 @@ protected String substituteQueryMarkers(int currentIteration, String queryStr) {
return queryStr;
}

// @Override
// public void loadConfiguration() {
//
// // TODO sparql expressions
// // TODO load default values from configuration
//
// // TODO does not work with string query as object is not RDF resource ???
// constructQueries = getResourcesByProperty(SML.JENA.constructQuery);
//
// log.debug("Loaded {} spin construct queries.", constructQueries.size());
//
// //TODO default value must be taken from template definition
// isReplace = this.getPropertyValue(SML.JENA.replace, false);
//
// parseText = this.getPropertyValue(KBSS_MODULE.JENA.is_parse_text, true);
// iterationCount = this.getPropertyValue(KBSS_MODULE.JENA.has_max_iteration_count, -1);
// }

@Override
public void loadManualConfiguration(){
log.debug("Loaded {} spin construct queries.", constructQueries.size());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public String getTypeURI() {

@Override
public void loadManualConfiguration() {
super.loadConfiguration();
super.loadManualConfiguration();
iterationCount = this.getPropertyValue(KBSS_MODULE.JENA.has_max_iteration_count, 1);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ protected String substituteQueryMarkers(int currentIteration, String queryStr) {

@Override
public void loadManualConfiguration() {
super.loadConfiguration();
super.loadManualConfiguration();
//iterationCount = this.getPropertyValue(KBSS_MODULE.JENA.s_max_iteration_count, 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected String substituteQueryMarkers(int currentIteration, String queryStr) {

@Override
public void loadManualConfiguration() {
super.loadConfiguration();
super.loadManualConfiguration();
//iterationCount = this.getPropertyValue(KBSS_MODULE.JENA.s_max_iteration_count, 1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected String substituteQueryMarkers(int currentIteration, String queryStr) {

@Override
public void loadManualConfiguration() {
super.loadConfiguration();
super.loadManualConfiguration();
//iterationCount = this.getPropertyValue(KBSS_MODULE.JENA.s_max_iteration_count, 1);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class DownloadGraphModule extends AnnotatedAbstractModule {
private String outputResourceVariable;

@Parameter(iri = TYPE_PREFIX + "page-size", comment = "Page size. Default value is 10000.")
private Integer pageSize = DEFAULT_PAGE_SIZE;
private int pageSize = DEFAULT_PAGE_SIZE;

protected long numberOfDownloadedTriples;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public String getTypeURI() {

@Override
public void loadManualConfiguration() {
super.loadConfiguration();
super.loadManualConfiguration();
}

private @NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class RetrieveGraphModule extends AnnotatedAbstractModule {
private String endpointUrl;

@Parameter(iri = TYPE_PREFIX + "page-size", comment = "Page size. Default is 10000.")
private Integer pageSize = DEFAULT_PAGE_SIZE;
private int pageSize = DEFAULT_PAGE_SIZE;

public String getTypeURI() {
return TYPE_URI;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,6 @@ private String annotateObjectLiteral(String objectValue) {
return annotatedText;
}

@Override
public void loadManualConfiguration() {
super.loadConfiguration();
}

@Override
public String getTypeURI() {
return TYPE_URI;
Expand Down

0 comments on commit b92e542

Please sign in to comment.