Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
🚀
This server has been upgraded to GitLab release
15.7
.
🚀
Open sidebar
memoriav
Memobase 2020
libraries
Normalizer Service Configuration
Commits
f7a48b28
Commit
f7a48b28
authored
Mar 19, 2021
by
Jonas Waeber
Browse files
Update test definitions.
parent
be35681d
Pipeline
#23474
passed with stage
in 2 minutes and 12 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/test/kotlin/ch/memobase/LocalTestRun.kt
View file @
f7a48b28
...
...
@@ -96,6 +96,7 @@ class LocalTestRun {
val
outputFolder
=
"/home/jonas/memobase/data/test/step-4"
val
mappingFile
=
"/config/localTransforms.yml"
val
global
=
GlobalTransformsLoader
(
"src/test/resources/global/transforms.yml"
)
global
.
parse
()
val
local
=
LocalTransformsLoader
(
File
(
folder
+
mappingFile
).
readBytes
())
local
.
parse
(
"test-key"
)
val
transformConfigs
=
local
.
get
()
+
global
.
get
()
...
...
src/test/kotlin/ch/memobase/TestDates.kt
View file @
f7a48b28
...
...
@@ -24,6 +24,7 @@ import ch.memobase.transform.DateNormalizationTransform
import
org.assertj.core.api.Assertions.assertThat
import
org.junit.jupiter.api.Test
import
org.junit.jupiter.api.TestInstance
import
org.junit.jupiter.api.assertAll
@TestInstance
(
TestInstance
.
Lifecycle
.
PER_CLASS
)
class
TestDates
{
...
...
@@ -34,14 +35,27 @@ class TestDates {
val
feb
=
Date
.
validateMonthValue
(
"févr."
)
val
march
=
Date
.
validateMonthValue
(
"5"
)
val
nullDate
=
Date
.
validateMonthValue
(
null
)
assertThat
(
dez
)
.
isEqualTo
(
"12"
)
assertThat
(
feb
)
.
isEqualTo
(
"02"
)
assertThat
(
march
)
.
isEqualTo
(
"05"
)
assertThat
(
nullDate
)
.
isEqualTo
(
null
)
assertAll
(
""
,
{
assertThat
(
dez
)
.
isEqualTo
(
"12"
)
},
{
assertThat
(
feb
)
.
isEqualTo
(
"02"
)
},
{
assertThat
(
march
)
.
isEqualTo
(
"05"
)
},
{
assertThat
(
nullDate
)
.
isEqualTo
(
null
)
}
)
}
@Test
...
...
@@ -55,7 +69,9 @@ class TestDates {
)
resource
.
addLiteral
(
RICO
.
expressedDate
,
value
)
val
transforms
=
GlobalTransformsLoader
(
TestUtils
.
pathGlobalTransformSettings
).
get
()
val
transformLoader
=
GlobalTransformsLoader
(
TestUtils
.
pathGlobalTransformSettings
)
transformLoader
.
parse
()
val
transforms
=
transformLoader
.
get
()
val
dateNormalizer
=
transforms
.
first
{
it
is
DateNormalizationTransform
}
dateNormalizer
as
DateNormalizationTransform
...
...
src/test/resources/global/facets/date-range-matchers.txt
View file @
f7a48b28
(?<singleYear>[0-2][0-9]{3})
(?<fromYear>\d{4})[-](?<fromMonth>\d{2})[-](?<fromDay>\d{2})/(?<untilYear>\d{4})[-](?<untilMonth>\d{2})[-](?<untilDay>\d{2})
(?<fromYear>[0-2][0-9]{3})[-/](?<untilYear>[0-2][0-9]{3})
(?<fromYear>[0-2][0-9]{3})-(?<untilYear>[0-2][0-9]{3})
(?<fromYear>[0-2][0-9]{3})/(?<untilYear>[0-2][0-9]{3})
(?<fromDay>[0-3]?[0-9])[.-](?<fromMonth>[0-1]?[0-9])?[.-]?(?<fromYear>[0-2][0-9]{3})?[.-]?[.-](?<untilDay>[0-3]?[0-9])[.-](?<untilMonth>[0-1]?[0-9])[.-](?<untilYear>[0-2][0-9]{3})
(?<fromYear>\?)/(?<untilYear>[0-2][0-9]{3})
(?<fromYear>\?)/(?<untilYear>\d{4})[-](?<untilMonth>\d{2})[-](?<untilDay>\d{2})
\ No newline at end of file
src/test/resources/tmp/turtle-output-language-normalization.ttl
View file @
f7a48b28
...
...
@@ -28,14 +28,10 @@ _:b0 a rico:Language ;
rico:
resultsFrom
_:
b1
;
rico:
type
"caption"
.
_:
b2
a
rico:
Language
;
rico:
name
"Deutsch"
;
rico:
type
"caption"
.
_:
b1
a
rico:
Activity
;
rico:
affects
_:
b2
;
rico:
beginningDate
"2021-0
2-0
9T1
0
:0
2:53
+0000"
^^
xsd:
dateTime
;
rico:
endDate
"2021-0
2-0
9T1
0
:0
2:53
+0000"
^^
xsd:
dateTime
;
rico:
beginningDate
"2021-0
4-1
9T1
2
:0
4:29
+0000"
^^
xsd:
dateTime
;
rico:
endDate
"2021-0
4-1
9T1
2
:0
4:29
+0000"
^^
xsd:
dateTime
;
rico:
performedBy
[
a
rico:
Mechanism
;
rico:
name
"LanguagesNormalizer"
;
rico:
performs
_:
b1
...
...
@@ -43,6 +39,10 @@ _:b1 a rico:Activity ;
rico:
resultsIn
_:
b0
;
rico:
type
"enrichment"
.
_:
b2
a
rico:
Language
;
rico:
name
"Deutsch"
;
rico:
type
"caption"
.
[
a
rico:
Record
;
rico:
hasLanguage
_:
b0
,
_:
b2
]
.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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