Skip to content
GitLab
Menu
Projects
Groups
Snippets
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
5ec21ff8
Commit
5ec21ff8
authored
Nov 09, 2020
by
Jonas Waeber
Browse files
Fix multiple qualifiers & certainties.
parent
ab38a2f1
Pipeline
#16771
passed with stages
in 5 minutes and 52 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/main/kotlin/builders/DateContainerBuilder.kt
View file @
5ec21ff8
package
org.memobase.builders
import
com.beust.klaxon.JsonArray
import
com.beust.klaxon.JsonObject
import
org.apache.logging.log4j.LogManager
import
org.memobase.KEYS
...
...
@@ -32,8 +33,16 @@ class DateContainerBuilder(private val containedIds: List<String>) : IFieldBuild
}
else
{
null
}
val
qualifier
=
jsonObject
[
"dateQualifier"
]
as
String
?
val
certainty
=
jsonObject
[
"certainty"
]
as
String
?
val
qualifier
=
when
(
val
value
=
jsonObject
[
"dateQualifier"
])
{
is
String
->
listOf
(
value
)
is
JsonArray
<
*
>
->
value
.
mapNotNull
{
value
as
String
?
}
else
->
emptyList
()
}
val
certainty
=
when
(
val
value
=
jsonObject
[
"certainty"
])
{
is
String
->
listOf
(
value
)
is
JsonArray
<
*
>
->
value
.
mapNotNull
{
value
as
String
?
}
else
->
emptyList
()
}
val
facetList
=
when
(
jsonObject
[
"@type"
]
as
String
)
{
NS
.
rico
+
"SingleDate"
->
if
(
isNormalized
)
...
...
src/main/kotlin/model/DateContainer.kt
View file @
5ec21ff8
...
...
@@ -24,7 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude
data class
DateContainer
(
val
date
:
String
,
val
sort
:
String
?,
val
certainty
:
String
?
,
val
qualifier
:
String
?
,
val
certainty
:
List
<
String
>
,
val
qualifier
:
List
<
String
>
,
val
facet
:
List
<
String
>
)
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