Skip to content

Commit

Permalink
[#218] Improve documentation of parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
blcham committed Sep 30, 2023
1 parent d864986 commit 799f61d
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import java.util.Collections;
import java.util.Optional;

@SPipesModule(label = "get dataset descriptors v1", comment = "Retrieve dataset descriptor for dataset with dataset-iri in endpoint-url.")
@SPipesModule(label = "get dataset descriptors v1", comment = "Retrieve dataset descriptor for dataset" +
" with dataset-iri in endpoint-url.")
public class GetDatasetDescriptorsModule extends AbstractModule {

private static final Logger LOG = LoggerFactory.getLogger(GetDatasetDescriptorsModule.class);
Expand All @@ -35,7 +36,8 @@ public class GetDatasetDescriptorsModule extends AbstractModule {
@Parameter(urlPrefix = PARAM_URI, name = "p-dataset-iri", comment = "IRI of the dataset.")// TODO - revise comment
private String prpDatasetIri;

@Parameter(urlPrefix = PARAM_URI, name = "endpoint-url", comment = "URL of the SPARQL endpoint. Default value is 'http://onto.fel.cvut.cz/rdf4j-server/repositories/descriptors-metadata'")
@Parameter(urlPrefix = PARAM_URI, name = "endpoint-url", comment = "URL of the SPARQL endpoint. Default value" +
" is 'http://onto.fel.cvut.cz/rdf4j-server/repositories/descriptors-metadata'")
private String endpointUrl = "http://onto.fel.cvut.cz/rdf4j-server/repositories/descriptors-metadata";

private static Property getParameter(final String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public class FetchPossibleValuesModule extends AnnotatedAbstractModule {
private static final Logger LOG = LoggerFactory.getLogger(FetchPossibleValuesModule.class);
private static final String TYPE_URI = KBSS_MODULE.uri + "fetch-possible-values";

@Parameter(urlPrefix = SML.uri, name = "replace", comment = "Replace context flag, default is false.") //TODO - revise comment
@Parameter(urlPrefix = SML.uri, name = "replace", comment = "Specifies whether a module should overwrite triples" +
" from its predecessors. When set to true (default is false), it prevents" +
" passing through triples from the predecessors.")
private boolean isReplace = false;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

@SPipesModule(label = "merge form metadata", comment =
"Merges form metadata. Inputs are sample form and Q&A model. Questions from both models are remapped to new" +
"IRIs based on question origin combined with executionId. New question instances are created using" +
"questionInstanceTemplate which defaults to \"doc:question-{_questionOriginHash}-{_executionId}\"."
" IRIs based on question origin combined with executionId. New question instances are created using" +
" question-instance-template property which defaults to \"doc:question-{_questionOriginHash}-{_executionId}\"."
)
public class MergeFormMetadataModule extends AnnotatedAbstractModule {

Expand All @@ -31,13 +31,14 @@ public class MergeFormMetadataModule extends AnnotatedAbstractModule {
private static final String QUESTION_ORIGIN_HASH_VAR = "{_questionOriginHash}";
private static final String EXECUTION_ID_VAR = "{_executionId}";

@Parameter(urlPrefix = SML.uri, name = "replace", comment = "Replace context flag. Default value is false.") // TODO - revise comment
@Parameter(urlPrefix = SML.uri, name = "replace", comment = "Specifies whether a module should overwrite triples" +
" from its predecessors. When set to true (default is false), it prevents" +
" passing through triples from the predecessors.")
private boolean isReplace = false;

@Parameter(name = "execution-id", comment = "Execution id that will be used to construct question IRIs")
private String executionId = DigestUtils.md5Hex(Long.toString(RANDOM.nextLong()));

// TODO - revise comment
@Parameter(name = "question-instance-template", comment = "URL Template to create URL for question instances. " +
"Default is 'http://onto.fel.cvut.cz/ontologies/documentation/question-{_questionOriginHash}-{_executionId}'")
private String questionInstanceTemplate =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
import java.util.List;
import java.util.stream.Collectors;

@SPipesModule(label = "rdf4j update", comment = "Updates sparql endpoint configured in rdf4jServerURL using specified updateQueries.")
@SPipesModule(label = "rdf4j update", comment = "Updates sparql endpoint configured in rdf4jServerURL" +
" using specified list updateQueries. The list of queries can be executed multiple times specified by " +
" `has-max-iteration-count` property.")
public class Rdf4jUpdateModule extends AbstractModule {
private static final Logger LOG = LoggerFactory.getLogger(Rdf4jUpdateModule.class.getName());
private static final String TYPE_URI = KBSS_MODULE.uri + "rdf4j-update";
Expand All @@ -42,18 +44,25 @@ public class Rdf4jUpdateModule extends AbstractModule {
@Parameter(urlPrefix = PROPERTY_PREFIX_URI + "/", name = "p-rdf4j-repository-name", comment = "Rdf4j repository ID")
private String rdf4jRepositoryName;

@Parameter(urlPrefix = SML.uri, name = "updateQuery", comment = "A list of SPARQL Update queries. Queries strings are read from sp:text.")// TODO - revise comment
/**
* List of SPARQL Update queries that will be executed in this order.
*/
@Parameter(urlPrefix = SML.uri, name = "updateQuery", comment = "SPARQL Update query (sp:Update) that should" +
" be executed by this module. The query is read from sp:text property.")
private List<String> updateQueries;

static final Property P_RDF4J_STOP_ITERATION_ON_STABLE_TRIPLE_COUNT =
getParameter("p-stop-iteration-on-stable-triple-count");

@Parameter(urlPrefix = PROPERTY_PREFIX_URI + "/", name = "p-stop-iteration-on-stable-triple-count",
comment = "Stops iteration on if triple count did not change. Default is false.") // TODO - revise comment
comment = "Stops iteration (i.e. execution of list of queries) if triple count " +
"in the last iteration did not change. Default is false.")
private boolean onlyIfTripleCountChanges;

@Parameter(urlPrefix = PROPERTY_PREFIX_URI + "/", name = "has-max-iteration-count",
comment = "Limits the number of iterations to the specified value. Default value is 1.") // TODO - revise comment
comment = "Limits the number of iterations (i.e. executions of list of queries)" +
" to the specified value. Default value is 1, which means that all" +
" update queries are executed only once.")
private int iterationCount;

private Repository updateRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ public abstract class ApplyConstructAbstractModule extends AnnotatedAbstractModu
private static final String PROPERTY_PREFIX_URI = KBSS_MODULE.uri + "";
//sml:constructQuery
// TODO - this parameter is reused in ApplyConstructWithChunkedValuesAndScrollableCursorModule. There the comment should be extended by a note, i.e. "The construct queries with markers #${VALUES} and #${LIMIT_OFFSET}."
@Parameter(urlPrefix = SML.uri, name = "constructQuery", comment = "List of construct queries the output of which is returned by the module.") //TODO - revise comment
@Parameter(urlPrefix = SML.uri, name = "constructQuery", comment = "SPARQL Construct query (sp:Construct)" +
" that should be executed by this module. The query is read from sp:text property." +
" The output of query execution is returned by the module.")
protected List<Resource> constructQueries;

//sml:replace
@Parameter(urlPrefix = SML.uri, name = "replace", comment = "Replace context flag, default is false.")
@Parameter(urlPrefix = SML.uri, name = "replace", comment = "Specifies whether a module should overwrite triples" +
" from its predecessors. When set to true (default is false), it prevents" +
" passing through triples from the predecessors.")
protected boolean isReplace;

//kbss:parseText
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,13 @@ public class TabularModule extends AbstractModule {
private final Property P_PROCESS_SPECIFIC_SHEET_IN_XLS_FILE = getSpecificParameter("process-specific-sheet-in-xls-file");

//sml:replace
@Parameter(urlPrefix = SML.uri, name = "replace", comment = "Replace context flag. Default is false.")// TODO - revise comment
@Parameter(urlPrefix = SML.uri, name = "replace", comment = "Specifies whether a module should overwrite triples" +
" from its predecessors. When set to true (default is false), it prevents" +
" passing through triples from the predecessors.")
private boolean isReplace;

@Parameter(urlPrefix = PARAM_URL_PREFIX, name = "source-resource-uri", comment = "Resource URI of the source table.") // TODO - revise comment
@Parameter(urlPrefix = PARAM_URL_PREFIX, name = "source-resource-uri", comment = "URI of resource" +
" that represent tabular data (e.g. resource representing CSV file).")
//:source-resource-uri
private StreamResource sourceResource;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ public class ExtractTermOccurrencesModule extends AnnotatedAbstractModule {
private static final String TYPE_URI = KBSS_MODULE.uri + "extract-term-occurrences";
private static final String TYPE_PREFIX = TYPE_URI + "/";

@Parameter(urlPrefix = SML.uri, name = "replace", comment = "Indicates whether the existing RDF should be overwritten. Default false.") // TODO - revise comment
@Parameter(urlPrefix = SML.uri, name = "replace", comment = "Specifies whether a module should overwrite triples" +
" from its predecessors. When set to true (default is false), it prevents" +
" passing through triples from the predecessors.")
private boolean isReplace;

Extraction extraction = new Extraction();
Expand Down

0 comments on commit 799f61d

Please sign in to comment.