Skip to content

Commit

Permalink
[Upd] Refactor naming convention of module parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
blcham committed Sep 14, 2021
1 parent 5705816 commit 2547742
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ protected static final Property property(String local )
public static final Property has_debug_mode_flag = property("has-debug-mode-flag");
public static final Property is_parse_text = property("is-parse-text");
public static final Property has_max_iteration_count = property("has-max-iteration-count");
public static final Property has_resource_uri = property("has-resource-uri");

/**
returns the URI for this schema
Expand Down
26 changes: 0 additions & 26 deletions s-pipes-core/src/main/java/cz/cvut/spipes/constants/KM_PARAM.java

This file was deleted.

29 changes: 0 additions & 29 deletions s-pipes-core/src/main/java/cz/cvut/spipes/constants/SEMP_LIB.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public ResourceNotFoundException(String entityId, String contextUri) {
super("Resource identified by \"" + entityId + "\" was not found in context \"" + contextUri + "\".");
}

public ResourceNotFoundException(String message) {
super(message);
}

public ResourceNotFoundException(String message, Throwable cause) {
super(message, cause);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
import cz.cvut.kbss.jopa.model.descriptors.EntityDescriptor;
import cz.cvut.kbss.ucl.MappingEccairsData2Aso;
import cz.cvut.spipes.constants.KBSS_MODULE;
import cz.cvut.spipes.constants.KM_PARAM;
import cz.cvut.spipes.engine.ExecutionContext;
import cz.cvut.spipes.engine.ExecutionContextFactory;
import cz.cvut.spipes.exception.ResourceNotFoundException;
import cz.cvut.spipes.modules.eccairs.EccairsAccessFactory;
import cz.cvut.spipes.modules.eccairs.SesameDataDao;
import cz.cvut.spipes.modules.eccairs.JopaPersistenceUtils;
import cz.cvut.spipes.modules.eccairs.SesameDataDao;
import cz.cvut.spipes.registry.StreamResource;
import cz.cvut.spipes.registry.StreamResourceRegistry;
import cz.cvut.spipes.util.JenaUtils;
Expand All @@ -29,7 +29,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.*;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.net.URI;
import java.util.Arrays;

Expand Down Expand Up @@ -144,7 +145,7 @@ public String getTypeURI() {

@Override
public void loadConfiguration() {
String e5xResourceUriStr = getEffectiveValue(KM_PARAM.has_resource_uri).asLiteral().toString();
String e5xResourceUriStr = getEffectiveValue(KBSS_MODULE.has_resource_uri).asLiteral().toString();
e5xResource = getResourceByUri(e5xResourceUriStr);
}

Expand All @@ -170,7 +171,7 @@ private StreamResource getResourceByUri(@NotNull String e5xResourceUriStr) {
StreamResource res = StreamResourceRegistry.getInstance().getResourceByUrl(e5xResourceUriStr);

if (res == null) {
throw new RuntimeException("Stream resource " + e5xResourceUriStr + " not found. "); // TODO specific exception
throw new ResourceNotFoundException("Stream resource " + e5xResourceUriStr + " not found. ");
}
return res;
}
Expand Down

0 comments on commit 2547742

Please sign in to comment.