Commit e50042a0 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Replace constant strings with constant vals

parent 3065d8e5
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
package org.memobase package org.memobase
import ch.memobase.rdf.NS import ch.memobase.rdf.NS
import ch.memobase.rdf.RICO
import com.beust.klaxon.JsonObject import com.beust.klaxon.JsonObject
import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.LogManager
import org.memobase.builders.AgentContainerBuilder import org.memobase.builders.AgentContainerBuilder
...@@ -56,9 +57,9 @@ class DocumentsSearchDocBuilder( ...@@ -56,9 +57,9 @@ class DocumentsSearchDocBuilder(
val record = input[JsonUtility.recordTag] ?: throw InvalidInputException("No record defined in the message.") val record = input[JsonUtility.recordTag] ?: throw InvalidInputException("No record defined in the message.")
val digitalObject = val digitalObject =
input.values.firstOrNull { it["@type"] == NS.rico + "Instantiation" && it["type"] == "digitalObject" } input.values.firstOrNull { it[Constants.atType] == RICO.Instantiation.uri && it[RICO.type.localName] == RICO.Types.Instantiation.digitalObject }
val physicalObject = val physicalObject =
input.values.firstOrNull { it["@type"] == NS.rico + "Instantiation" && it["type"] == "physicalObject" } input.values.firstOrNull { it[Constants.atType] == RICO.Instantiation.uri && it[RICO.type.localName] == RICO.Types.Instantiation.physicalObject }
val keywordIds = Extract.identifiers(record[Constants.hasSubject]) val keywordIds = Extract.identifiers(record[Constants.hasSubject])
val genreIds = Extract.identifiers(record[Constants.hasGenre]) val genreIds = Extract.identifiers(record[Constants.hasGenre])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment