Skip to content

Commit

Permalink
[Fix] Module url to match kbss-module prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
blcham committed Jun 12, 2022
1 parent 5fcb5f6 commit 4e7f30f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import cz.cvut.sforms.transformation.SForms2TextTransformer;
import cz.cvut.sforms.transformation.TextTransformerConfig;
import cz.cvut.sforms.util.FormUtils;
import cz.cvut.spipes.constants.KBSS_MODULE;
import cz.cvut.spipes.constants.SML;
import cz.cvut.spipes.engine.ExecutionContext;
import cz.cvut.spipes.engine.ExecutionContextFactory;
Expand All @@ -25,7 +26,7 @@ public class ConstructTextualViewModule extends AnnotatedAbstractModule {

private static final Logger LOG = LoggerFactory.getLogger(ConstructTextualViewModule.class);

private static final String TYPE_URI = FORM_MODULE.uri + "construct-textual-view";
private static final String TYPE_URI = KBSS_MODULE.uri + "construct-textual-view";

@Parameter(urlPrefix = SML.uri, name = "replace")
private boolean isReplace = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public class MergeFormMetadataModule extends AnnotatedAbstractModule {
private static final Random RANDOM = new Random();

private static final String TYPE_URI = KBSS_MODULE.uri + "merge-form-metadata";
private static final String QUESTION_ORGIN_HASH_VAR = "{_questionOriginHash}";
// TODO use official uri templates
private static final String QUESTION_ORIGIN_HASH_VAR = "{_questionOriginHash}";
private static final String EXECUTION_ID_VAR = "{_executionId}";

@Parameter(urlPrefix = SML.uri, name = "replace")
Expand All @@ -40,7 +41,7 @@ public class MergeFormMetadataModule extends AnnotatedAbstractModule {
private String questionInstanceTemplate =
SformsVocabularyJena.s_c_question.toString()
+ "-"
+ QUESTION_ORGIN_HASH_VAR
+ QUESTION_ORIGIN_HASH_VAR
+ "-"
+ EXECUTION_ID_VAR;

Expand All @@ -57,7 +58,7 @@ ExecutionContext executeSelf() {
q -> {
String originHash = DigestUtils.md5Hex(JenaFormUtils.getQuestionOrigin(q).toString());
String newQuestionUrl = questionInstanceTemplate
.replace(QUESTION_ORGIN_HASH_VAR, originHash)
.replace(QUESTION_ORIGIN_HASH_VAR, originHash)
.replace(EXECUTION_ID_VAR, executionId);
if (!q.equals(newQuestionUrl)) {
if (LOG.isTraceEnabled()) {
Expand Down

0 comments on commit 4e7f30f

Please sign in to comment.