From 7a8f258cb2b79f49055884480e866c7daa949588 Mon Sep 17 00:00:00 2001 From: Jens Pots Date: Thu, 3 Oct 2024 11:45:30 +0200 Subject: [PATCH] refactor: split files for IR arguments and parameters --- orchestrator/src/main/kotlin/RDFCException.kt | 4 +- .../main/kotlin/extensions/PropertyShape.kt | 2 +- .../src/main/kotlin/extensions/Shape.kt | 6 +- .../main/kotlin/intermediate/IRArgument.kt | 67 ++++++------------- .../main/kotlin/intermediate/IRParameter.kt | 47 ++----------- .../main/kotlin/intermediate/IRProcessor.kt | 2 +- .../src/main/kotlin/intermediate/IRRunner.kt | 10 +-- .../src/main/kotlin/intermediate/IRStage.kt | 6 +- .../kotlin/intermediate/argument/Argument.kt | 18 +++++ .../intermediate/argument/LiteralArgument.kt | 21 ++++++ .../intermediate/argument/NestedArgument.kt | 26 +++++++ .../parameter/LiteralParameter.kt | 13 ++++ .../parameter/LiteralParameterType.kt | 15 +++++ .../intermediate/parameter/NestedParameter.kt | 19 ++++++ .../intermediate/parameter/Parameter.kt | 20 ++++++ .../kotlin/intermediate/runner/RunnerType.kt | 9 +++ .../src/main/kotlin/parser/impl/JenaParser.kt | 27 ++++---- orchestrator/src/main/kotlin/runner/Runner.kt | 26 ++++--- .../main/kotlin/runner/impl/grpc/Serialize.kt | 10 +-- .../main/kotlin/runner/impl/jvm/JVMRunner.kt | 8 +-- .../src/test/kotlin/parser/ParserTest.kt | 10 +-- 21 files changed, 219 insertions(+), 147 deletions(-) create mode 100644 orchestrator/src/main/kotlin/intermediate/argument/Argument.kt create mode 100644 orchestrator/src/main/kotlin/intermediate/argument/LiteralArgument.kt create mode 100644 orchestrator/src/main/kotlin/intermediate/argument/NestedArgument.kt create mode 100644 orchestrator/src/main/kotlin/intermediate/parameter/LiteralParameter.kt create mode 100644 orchestrator/src/main/kotlin/intermediate/parameter/LiteralParameterType.kt create mode 100644 orchestrator/src/main/kotlin/intermediate/parameter/NestedParameter.kt create mode 100644 orchestrator/src/main/kotlin/intermediate/parameter/Parameter.kt create mode 100644 orchestrator/src/main/kotlin/intermediate/runner/RunnerType.kt diff --git a/orchestrator/src/main/kotlin/RDFCException.kt b/orchestrator/src/main/kotlin/RDFCException.kt index 83f036d..a9b11e3 100644 --- a/orchestrator/src/main/kotlin/RDFCException.kt +++ b/orchestrator/src/main/kotlin/RDFCException.kt @@ -1,6 +1,6 @@ package technology.idlab -import technology.idlab.intermediate.IRRunner +import technology.idlab.intermediate.runner.RunnerType abstract class RDFCException : Exception() @@ -111,7 +111,7 @@ class NoSuchRunnerException(private val runnerUri: String) : RDFCException() * * @param type The type which was used, but not implemented. */ -class UnsupportedRunnerTypeException(private val type: IRRunner.Type) : RDFCException() +class UnsupportedRunnerTypeException(private val type: RunnerType) : RDFCException() /** * Metadata was expected, but not found. diff --git a/orchestrator/src/main/kotlin/extensions/PropertyShape.kt b/orchestrator/src/main/kotlin/extensions/PropertyShape.kt index dae539c..fcb8415 100644 --- a/orchestrator/src/main/kotlin/extensions/PropertyShape.kt +++ b/orchestrator/src/main/kotlin/extensions/PropertyShape.kt @@ -6,7 +6,7 @@ import org.apache.jena.shacl.parser.PropertyShape import org.apache.jena.shacl.parser.Shape import org.apache.jena.shacl.vocabulary.SHACLM import technology.idlab.RDFC -import technology.idlab.intermediate.LiteralParameterType +import technology.idlab.intermediate.parameter.LiteralParameterType import technology.idlab.parser.ParserException /** diff --git a/orchestrator/src/main/kotlin/extensions/Shape.kt b/orchestrator/src/main/kotlin/extensions/Shape.kt index 2abc09d..bdb9da0 100644 --- a/orchestrator/src/main/kotlin/extensions/Shape.kt +++ b/orchestrator/src/main/kotlin/extensions/Shape.kt @@ -4,9 +4,9 @@ import org.apache.jena.rdf.model.Resource import org.apache.jena.shacl.parser.PropertyShape import org.apache.jena.shacl.parser.Shape import org.apache.jena.shacl.vocabulary.SHACLM -import technology.idlab.intermediate.LiteralParameter -import technology.idlab.intermediate.NestedParameter -import technology.idlab.intermediate.Parameter +import technology.idlab.intermediate.parameter.LiteralParameter +import technology.idlab.intermediate.parameter.NestedParameter +import technology.idlab.intermediate.parameter.Parameter /** * Check if the shape is closed. diff --git a/orchestrator/src/main/kotlin/intermediate/IRArgument.kt b/orchestrator/src/main/kotlin/intermediate/IRArgument.kt index b765a28..15a09fb 100644 --- a/orchestrator/src/main/kotlin/intermediate/IRArgument.kt +++ b/orchestrator/src/main/kotlin/intermediate/IRArgument.kt @@ -1,58 +1,29 @@ package technology.idlab.intermediate -sealed interface Argument { - val parameter: Parameter - - fun findAll(type: LiteralParameterType, parameter: Parameter): List -} - -class LiteralArgument( - override val parameter: LiteralParameter, - val values: MutableList = mutableListOf(), -) : Argument { - override fun findAll(type: LiteralParameterType, parameter: Parameter): List { - if (parameter !is LiteralParameter) { - return emptyList() - } - - return if (parameter.type == type) { - this.values - } else { - emptyList() - } - } -} - -class NestedArgument( - override val parameter: NestedParameter, - val values: MutableList> = mutableListOf(), -) : Argument { - override fun findAll(type: LiteralParameterType, parameter: Parameter): List { - if (parameter !is NestedParameter) { - throw IllegalStateException() - } - - val result = mutableListOf() - - for (value in this.values) { - for ((key, argument) in value) { - result.addAll(argument.findAll(type, parameter[key])) - } - } - - return result - } -} +import technology.idlab.intermediate.argument.Argument +import technology.idlab.intermediate.parameter.LiteralParameterType class IRArgument( - val parameter: IRParameter, - val values: Map = mutableMapOf(), + val root: Map = mutableMapOf(), ) { + /** + * Get the argument for a given key. + * + * @param key The key of the argument. + * @return The argument. + * @throws IllegalArgumentException If the argument is not found. + */ operator fun get(key: String): Argument { - return values[key] ?: throw IllegalArgumentException("Argument $key not found.") + return root[key] ?: throw IllegalArgumentException("Argument $key not found.") } - fun findAll(type: LiteralParameterType, parameter: Parameter): List { - return this.values.values.map { it.findAll(type, parameter) }.flatten() + /** + * Find all values of a certain type for a given parameter. + * + * @param type The type of the literal parameter to find. + * @result A flattened list of all values of the given type for the given parameter. + */ + fun findAll(type: LiteralParameterType): List { + return root.values.map { it.findAll(type) }.flatten() } } diff --git a/orchestrator/src/main/kotlin/intermediate/IRParameter.kt b/orchestrator/src/main/kotlin/intermediate/IRParameter.kt index 88230fa..22dad37 100644 --- a/orchestrator/src/main/kotlin/intermediate/IRParameter.kt +++ b/orchestrator/src/main/kotlin/intermediate/IRParameter.kt @@ -1,55 +1,18 @@ package technology.idlab.intermediate -class IRParameter( - uri: String, - type: Map, -) : - NestedParameter( - uri, - type, - single = false, - optional = false, - ) - -sealed interface Parameter { - val uri: String - val single: Boolean - val optional: Boolean -} +import technology.idlab.intermediate.parameter.Parameter -open class NestedParameter( - override val uri: String, +class IRParameter( val type: Map, - override val single: Boolean = false, - override val optional: Boolean = false -) : Parameter { +) { /** * Get the parameter with the given key. * * @param key The key of the parameter. * @return The parameter. + * @throws IllegalArgumentException If the parameter is not found. */ operator fun get(key: String): Parameter { - return type[key] ?: throw IllegalArgumentException("Parameter $key not found.") + return type[key] ?: throw IllegalArgumentException("No such parameter: $key") } } - -enum class LiteralParameterType { - BOOLEAN, - BYTE, - DATE, - DOUBLE, - FLOAT, - INT, - LONG, - STRING, - WRITER, - READER, -} - -data class LiteralParameter( - override val uri: String, - val type: LiteralParameterType, - override val single: Boolean = false, - override val optional: Boolean = false, -) : Parameter diff --git a/orchestrator/src/main/kotlin/intermediate/IRProcessor.kt b/orchestrator/src/main/kotlin/intermediate/IRProcessor.kt index 6ebc43f..504f48a 100644 --- a/orchestrator/src/main/kotlin/intermediate/IRProcessor.kt +++ b/orchestrator/src/main/kotlin/intermediate/IRProcessor.kt @@ -8,7 +8,7 @@ class IRProcessor( /** The entrypoint. */ val entrypoint: String, /** Processor parameters. */ - val parameters: IRParameter = IRParameter(uri, emptyMap()), + val parameters: IRParameter, /** Additional parameters. These may be used by the runner for any reason. */ val metadata: Map = emptyMap() ) diff --git a/orchestrator/src/main/kotlin/intermediate/IRRunner.kt b/orchestrator/src/main/kotlin/intermediate/IRRunner.kt index 2bb3e51..f48bb1b 100644 --- a/orchestrator/src/main/kotlin/intermediate/IRRunner.kt +++ b/orchestrator/src/main/kotlin/intermediate/IRRunner.kt @@ -1,15 +1,11 @@ package technology.idlab.intermediate import java.io.File +import technology.idlab.intermediate.runner.RunnerType data class IRRunner( val uri: String, val directory: File? = null, val entrypoint: String? = null, - val type: Type, -) { - enum class Type { - GRPC, - BUILT_IN, - } -} + val type: RunnerType, +) diff --git a/orchestrator/src/main/kotlin/intermediate/IRStage.kt b/orchestrator/src/main/kotlin/intermediate/IRStage.kt index 5dca30c..94632ae 100644 --- a/orchestrator/src/main/kotlin/intermediate/IRStage.kt +++ b/orchestrator/src/main/kotlin/intermediate/IRStage.kt @@ -1,5 +1,7 @@ package technology.idlab.intermediate +import technology.idlab.intermediate.parameter.LiteralParameterType + data class IRStage( // The URI of the stage. val uri: String, @@ -9,10 +11,10 @@ data class IRStage( val arguments: IRArgument, ) { fun readers(): List { - return arguments.findAll(LiteralParameterType.READER, processor.parameters) + return arguments.findAll(LiteralParameterType.READER) } fun writers(): List { - return arguments.findAll(LiteralParameterType.WRITER, processor.parameters) + return arguments.findAll(LiteralParameterType.WRITER) } } diff --git a/orchestrator/src/main/kotlin/intermediate/argument/Argument.kt b/orchestrator/src/main/kotlin/intermediate/argument/Argument.kt new file mode 100644 index 0000000..e9a15a7 --- /dev/null +++ b/orchestrator/src/main/kotlin/intermediate/argument/Argument.kt @@ -0,0 +1,18 @@ +package technology.idlab.intermediate.argument + +import technology.idlab.intermediate.parameter.LiteralParameterType +import technology.idlab.intermediate.parameter.Parameter + +/** IR representation of a concrete argument. It holds it's corresponding parameter as a field. */ +sealed interface Argument { + // The parameter that this argument corresponds to. + val parameter: Parameter + + /** + * Find all values of a certain type for a given parameter. + * + * @param type The type of the literal parameter to find. + * @return A flattened list of all values of the given type for the given parameter. + */ + fun findAll(type: LiteralParameterType): List +} diff --git a/orchestrator/src/main/kotlin/intermediate/argument/LiteralArgument.kt b/orchestrator/src/main/kotlin/intermediate/argument/LiteralArgument.kt new file mode 100644 index 0000000..d012f8c --- /dev/null +++ b/orchestrator/src/main/kotlin/intermediate/argument/LiteralArgument.kt @@ -0,0 +1,21 @@ +package technology.idlab.intermediate.argument + +import technology.idlab.intermediate.parameter.LiteralParameter +import technology.idlab.intermediate.parameter.LiteralParameterType + +/** Representation of a literal argument in IR as a list of strings. */ +class LiteralArgument( + override val parameter: LiteralParameter, + val values: MutableList = mutableListOf(), +) : Argument { + /* + * If the argument holds the correct type, we can simply return the whole list. + */ + override fun findAll(type: LiteralParameterType): List { + return if (parameter.type == type) { + values + } else { + emptyList() + } + } +} diff --git a/orchestrator/src/main/kotlin/intermediate/argument/NestedArgument.kt b/orchestrator/src/main/kotlin/intermediate/argument/NestedArgument.kt new file mode 100644 index 0000000..a1e30ef --- /dev/null +++ b/orchestrator/src/main/kotlin/intermediate/argument/NestedArgument.kt @@ -0,0 +1,26 @@ +package technology.idlab.intermediate.argument + +import technology.idlab.intermediate.parameter.LiteralParameterType +import technology.idlab.intermediate.parameter.NestedParameter + +/** Representation of a single nested argument in IR as a list of key-value pairs. */ +class NestedArgument( + override val parameter: NestedParameter, + val values: MutableList> = mutableListOf(), +) : Argument { + /* + * The function simply loops over all values in the list and recursively calls findAll on each of + * them. + */ + override fun findAll(type: LiteralParameterType): List { + val result = mutableListOf() + + for (value in this.values) { + for ((_, argument) in value) { + result.addAll(argument.findAll(type)) + } + } + + return result + } +} diff --git a/orchestrator/src/main/kotlin/intermediate/parameter/LiteralParameter.kt b/orchestrator/src/main/kotlin/intermediate/parameter/LiteralParameter.kt new file mode 100644 index 0000000..9ef1b18 --- /dev/null +++ b/orchestrator/src/main/kotlin/intermediate/parameter/LiteralParameter.kt @@ -0,0 +1,13 @@ +package technology.idlab.intermediate.parameter + +/** Representation of a (list of) literal parameter(s) in IR. */ +data class LiteralParameter( + // The path of the parameter as specified in the config. + override val path: String, + // The datatype of the parameter. + val type: LiteralParameterType, + // True if there is only one instance of the parameter at most. + override val single: Boolean = false, + // True if there may be zero instances of the parameter. + override val optional: Boolean = false, +) : Parameter diff --git a/orchestrator/src/main/kotlin/intermediate/parameter/LiteralParameterType.kt b/orchestrator/src/main/kotlin/intermediate/parameter/LiteralParameterType.kt new file mode 100644 index 0000000..b4db5dc --- /dev/null +++ b/orchestrator/src/main/kotlin/intermediate/parameter/LiteralParameterType.kt @@ -0,0 +1,15 @@ +package technology.idlab.intermediate.parameter + +/** Specifies the type of literal parameter. */ +enum class LiteralParameterType { + BOOLEAN, + BYTE, + DATE, + DOUBLE, + FLOAT, + INT, + LONG, + STRING, + WRITER, + READER, +} diff --git a/orchestrator/src/main/kotlin/intermediate/parameter/NestedParameter.kt b/orchestrator/src/main/kotlin/intermediate/parameter/NestedParameter.kt new file mode 100644 index 0000000..d6bc2d1 --- /dev/null +++ b/orchestrator/src/main/kotlin/intermediate/parameter/NestedParameter.kt @@ -0,0 +1,19 @@ +package technology.idlab.intermediate.parameter + +/** Representation of nested parameter in IR. */ +open class NestedParameter( + override val path: String, + val type: Map, + override val single: Boolean = false, + override val optional: Boolean = false +) : Parameter { + /** + * Get the parameter with the given key. + * + * @param key The key of the parameter. + * @return The parameter. + */ + operator fun get(key: String): Parameter { + return type[key] ?: throw IllegalArgumentException("Parameter $key not found.") + } +} diff --git a/orchestrator/src/main/kotlin/intermediate/parameter/Parameter.kt b/orchestrator/src/main/kotlin/intermediate/parameter/Parameter.kt new file mode 100644 index 0000000..e38910b --- /dev/null +++ b/orchestrator/src/main/kotlin/intermediate/parameter/Parameter.kt @@ -0,0 +1,20 @@ +package technology.idlab.intermediate.parameter + +/** + * Generic representation of a parameter in IR, which may be either a literal or a nested parameter. + */ +sealed interface Parameter { + // The path of the parameter as specified in the config. + val path: String + // True if there is only one instance of the parameter at most. + val single: Boolean + // True if there may be zero instances of the parameter. + val optional: Boolean + // True if there can be more than one instance of the parameter. + val list: Boolean + get() = !single + + // True if the parameter is not optional. + val required: Boolean + get() = !optional +} diff --git a/orchestrator/src/main/kotlin/intermediate/runner/RunnerType.kt b/orchestrator/src/main/kotlin/intermediate/runner/RunnerType.kt new file mode 100644 index 0000000..5845bd6 --- /dev/null +++ b/orchestrator/src/main/kotlin/intermediate/runner/RunnerType.kt @@ -0,0 +1,9 @@ +package technology.idlab.intermediate.runner + +/** The types of runner supported by the Orchestrator. */ +enum class RunnerType { + // A runner which communicates over GRPC. + GRPC, + // A runner which is built into the Orchestrator. + BuiltIn, +} diff --git a/orchestrator/src/main/kotlin/parser/impl/JenaParser.kt b/orchestrator/src/main/kotlin/parser/impl/JenaParser.kt index 48fd78f..2d1e683 100644 --- a/orchestrator/src/main/kotlin/parser/impl/JenaParser.kt +++ b/orchestrator/src/main/kotlin/parser/impl/JenaParser.kt @@ -15,7 +15,6 @@ import technology.idlab.extensions.objectOfProperty import technology.idlab.extensions.property import technology.idlab.extensions.targeting import technology.idlab.extensions.validate -import technology.idlab.intermediate.Argument import technology.idlab.intermediate.IRArgument import technology.idlab.intermediate.IRDependency import technology.idlab.intermediate.IRPackage @@ -24,11 +23,13 @@ import technology.idlab.intermediate.IRPipeline import technology.idlab.intermediate.IRProcessor import technology.idlab.intermediate.IRRunner import technology.idlab.intermediate.IRStage -import technology.idlab.intermediate.LiteralArgument -import technology.idlab.intermediate.LiteralParameter -import technology.idlab.intermediate.NestedArgument -import technology.idlab.intermediate.NestedParameter -import technology.idlab.intermediate.Parameter +import technology.idlab.intermediate.argument.Argument +import technology.idlab.intermediate.argument.LiteralArgument +import technology.idlab.intermediate.argument.NestedArgument +import technology.idlab.intermediate.parameter.LiteralParameter +import technology.idlab.intermediate.parameter.NestedParameter +import technology.idlab.intermediate.parameter.Parameter +import technology.idlab.intermediate.runner.RunnerType import technology.idlab.parser.Parser import technology.idlab.parser.ParserException import technology.idlab.util.Log @@ -65,7 +66,7 @@ class JenaParser( private fun arguments(uri: Resource, parameters: IRParameter): IRArgument { val result = arguments(uri, parameters.type) - return IRArgument(parameters, result) + return IRArgument(result) } /** @@ -76,7 +77,7 @@ class JenaParser( val result = mutableMapOf() for ((name, parameter) in parameters) { - val path = model.createProperty(parameter.uri) + val path = model.createProperty(parameter.path) val arguments = model.listObjectsOfProperty(uri, path).toList() // If the value is null, we may either skip it if it's not required or throw an exception if @@ -214,7 +215,7 @@ class JenaParser( val entrypoint = model.objectOfProperty(processor, RDFC.entrypoint)!!.toString() return IRProcessor( - processor.toString(), target.toString(), entrypoint, IRParameter("", parameters), metadata) + processor.toString(), target.toString(), entrypoint, IRParameter(parameters), metadata) } override fun packages(): List { @@ -237,7 +238,7 @@ class JenaParser( // Retrieve built in runners. val builtIn = model.listSubjectsWithProperty(RDF.type, RDFC.builtInRunner).toList() for (uri in builtIn) { - val runner = IRRunner(uri.toString(), type = IRRunner.Type.BUILT_IN) + val runner = IRRunner(uri.toString(), type = RunnerType.BuiltIn) result.add(runner) } @@ -304,14 +305,14 @@ class JenaParser( val type = when (model.objectOfProperty(runner, RDF.type)) { - RDFC.builtInRunner -> IRRunner.Type.BUILT_IN - RDFC.grpcRunner -> IRRunner.Type.GRPC + RDFC.builtInRunner -> RunnerType.BuiltIn + RDFC.grpcRunner -> RunnerType.GRPC null -> throw ParserException.NoRunnerType(runner.uri) else -> throw ParserException.UnknownRunnerType(runner.uri) } // Check if the entrypoint is valid. - if (type == IRRunner.Type.BUILT_IN && entrypoint != null) { + if (type == RunnerType.BuiltIn && entrypoint != null) { throw ParserException.InvalidEntrypoint(runner.uri) } diff --git a/orchestrator/src/main/kotlin/runner/Runner.kt b/orchestrator/src/main/kotlin/runner/Runner.kt index 6ae4d00..81c30d6 100644 --- a/orchestrator/src/main/kotlin/runner/Runner.kt +++ b/orchestrator/src/main/kotlin/runner/Runner.kt @@ -11,9 +11,9 @@ import technology.idlab.broker.Broker import technology.idlab.broker.BrokerClient import technology.idlab.intermediate.IRRunner import technology.idlab.intermediate.IRStage +import technology.idlab.intermediate.runner.RunnerType import technology.idlab.runner.impl.grpc.HostedGRPCRunner import technology.idlab.runner.impl.jvm.JVMRunner -import technology.idlab.util.Log abstract class Runner( /** The stages which the runner must execute. */ @@ -70,18 +70,16 @@ abstract class Runner( * @return A new runner instance. * @throws NoSuchRunnerException If the type of runner is not implemented. */ - fun from(runner: IRRunner, stages: Collection): Runner { - Log.shared.info("Creating runner: ${runner.uri}") - - if (runner.uri == "https://www.rdf-connect.com/#JVMRunner") { - return JVMRunner(stages) - } - - if (runner.type == IRRunner.Type.GRPC) { - return HostedGRPCRunner.create(runner, stages) - } - - throw UnsupportedRunnerTypeException(runner.type) - } + fun from(runner: IRRunner, stages: Collection): Runner = + when (runner.type) { + RunnerType.BuiltIn -> { + if (runner.uri == "https://www.rdf-connect.com/#JVMRunner") { + JVMRunner(stages) + } else { + throw UnsupportedRunnerTypeException(runner.type) + } + } + RunnerType.GRPC -> HostedGRPCRunner.create(runner, stages) + } } } diff --git a/orchestrator/src/main/kotlin/runner/impl/grpc/Serialize.kt b/orchestrator/src/main/kotlin/runner/impl/grpc/Serialize.kt index d9f688a..d101a1a 100644 --- a/orchestrator/src/main/kotlin/runner/impl/grpc/Serialize.kt +++ b/orchestrator/src/main/kotlin/runner/impl/grpc/Serialize.kt @@ -4,12 +4,12 @@ import com.google.protobuf.Timestamp import com.google.protobuf.kotlin.toByteStringUtf8 import rdfc.Intermediate as GRPC import rdfc.Intermediate -import technology.idlab.intermediate.Argument import technology.idlab.intermediate.IRProcessor import technology.idlab.intermediate.IRStage -import technology.idlab.intermediate.LiteralArgument -import technology.idlab.intermediate.LiteralParameterType -import technology.idlab.intermediate.NestedArgument +import technology.idlab.intermediate.argument.Argument +import technology.idlab.intermediate.argument.LiteralArgument +import technology.idlab.intermediate.argument.NestedArgument +import technology.idlab.intermediate.parameter.LiteralParameterType private fun serialize(arg: LiteralArgument, serialized: String): Intermediate.ArgumentLiteral = rdfc.argumentLiteral { @@ -84,7 +84,7 @@ internal fun serialize(stage: IRStage): GRPC.Stage { uri = stage.uri processor = serialize(stage.processor) - for ((key, value) in stage.arguments.values) { + for ((key, value) in stage.arguments.root) { arguments[key] = serialize(value) } } diff --git a/orchestrator/src/main/kotlin/runner/impl/jvm/JVMRunner.kt b/orchestrator/src/main/kotlin/runner/impl/jvm/JVMRunner.kt index 82a7754..225a81c 100644 --- a/orchestrator/src/main/kotlin/runner/impl/jvm/JVMRunner.kt +++ b/orchestrator/src/main/kotlin/runner/impl/jvm/JVMRunner.kt @@ -12,9 +12,9 @@ import technology.idlab.InvalidProcessorException import technology.idlab.MissingMetadataException import technology.idlab.intermediate.IRArgument import technology.idlab.intermediate.IRStage -import technology.idlab.intermediate.LiteralArgument -import technology.idlab.intermediate.LiteralParameterType -import technology.idlab.intermediate.NestedArgument +import technology.idlab.intermediate.argument.LiteralArgument +import technology.idlab.intermediate.argument.NestedArgument +import technology.idlab.intermediate.parameter.LiteralParameterType import technology.idlab.runner.Runner import technology.idlab.util.Log @@ -105,7 +105,7 @@ class JVMRunner(stages: Collection) : Runner(stages) { private fun IRArgument.unmarshall(): Map> { val result = mutableMapOf>() - for ((name, argument) in this.values) { + for ((name, argument) in this.root) { result[name] = when (argument) { is LiteralArgument -> argument.unmarshall() diff --git a/orchestrator/src/test/kotlin/parser/ParserTest.kt b/orchestrator/src/test/kotlin/parser/ParserTest.kt index 4053fe4..63226af 100644 --- a/orchestrator/src/test/kotlin/parser/ParserTest.kt +++ b/orchestrator/src/test/kotlin/parser/ParserTest.kt @@ -7,11 +7,11 @@ import kotlin.test.assertEquals import kotlin.test.assertFalse import kotlin.test.assertNotNull import kotlin.test.assertTrue -import technology.idlab.intermediate.LiteralArgument -import technology.idlab.intermediate.LiteralParameter -import technology.idlab.intermediate.LiteralParameterType -import technology.idlab.intermediate.NestedArgument -import technology.idlab.intermediate.NestedParameter +import technology.idlab.intermediate.argument.LiteralArgument +import technology.idlab.intermediate.argument.NestedArgument +import technology.idlab.intermediate.parameter.LiteralParameter +import technology.idlab.intermediate.parameter.LiteralParameterType +import technology.idlab.intermediate.parameter.NestedParameter import technology.idlab.parser.Parser import technology.idlab.parser.impl.JenaParser