Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
Elasticsearch Services
Search Doc Service
Commits
e50042a0
Commit
e50042a0
authored
Apr 16, 2021
by
Jonas Waeber
Browse files
Replace constant strings with constant vals
parent
3065d8e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/kotlin/DocumentsSearchDocBuilder.kt
View file @
e50042a0
...
@@ -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
[
"@t
ype
"
]
==
NS
.
rico
+
"
Instantiation
"
&&
it
[
"type"
]
==
"
digitalObject
"
}
input
.
values
.
firstOrNull
{
it
[
Constants
.
atT
ype
]
==
RICO
.
Instantiation
.
uri
&&
it
[
RICO
.
type
.
localName
]
==
RICO
.
Types
.
Instantiation
.
digitalObject
}
val
physicalObject
=
val
physicalObject
=
input
.
values
.
firstOrNull
{
it
[
"@t
ype
"
]
==
NS
.
rico
+
"
Instantiation
"
&&
it
[
"type"
]
==
"
physicalObject
"
}
input
.
values
.
firstOrNull
{
it
[
Constants
.
atT
ype
]
==
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
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment