Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Search Doc Service
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
memoriav
M
Memobase 2020
S
services
elastic-services
Search Doc Service
Commits
5ec21ff8
Commit
5ec21ff8
authored
Nov 09, 2020
by
Jonas Waeber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
src/main/kotlin/builders/DateContainerBuilder.kt
src/main/kotlin/builders/DateContainerBuilder.kt
+11
-2
src/main/kotlin/model/DateContainer.kt
src/main/kotlin/model/DateContainer.kt
+2
-2
No files found.
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