Commit 872db9c4 authored by Jonas Waeber's avatar Jonas Waeber

Fix transform test

parent 2b4d08db
Pipeline #10788 passed with stages
in 10 minutes and 33 seconds
......@@ -31,6 +31,7 @@ import java.nio.charset.Charset
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class Test {
private val log = LogManager.getLogger("TestLogger")
private val regex = Regex("(_:B[A-Za-z0-9]+)")
private val resourcePath = "src/test/resources/data"
private fun readFile(fileName: String): String {
......@@ -64,10 +65,18 @@ class Test {
StringDeserializer()
)
assertThat(record.value())
val sortedResult = record.value().lines().map {
var replacedString = it
for (matchResult in regex.findAll(it)) {
replacedString = replacedString.replace(matchResult.groups[0]?.value.orEmpty(), "_:B")
}
replacedString
}.sorted().reduce { acc, s -> acc + "\n" + s }
assertThat(sortedResult)
.isEqualTo(readFile("1/output.nt"))
assertThat(record.key())
.isEqualTo("")
.isEqualTo("https://memobase.ch/institution/test")
}
}
_:B20812738X2Db181X2D46eaX2Da65cX2D72b85dbc6553 <https://www.ica.org/standards/RiC/ontology#identifier> "test" .
_:B20812738X2Db181X2D46eaX2Da65cX2D72b85dbc6553 <https://www.ica.org/standards/RiC/ontology#type> "main" .
_:B20812738X2Db181X2D46eaX2Da65cX2D72b85dbc6553 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Identifier> .
<https://memobase.ch/institution/test> <http://www.wikidata.org/prop/direct/P856> "http://www.plansfixes.ch/" .
<https://memobase.ch/institution/test> <https://www.ica.org/standards/RiC/ontology#descriptiveNote> "<p>Association Films Plans-Fixes</p>"@it .
<https://memobase.ch/institution/test> <https://www.ica.org/standards/RiC/ontology#descriptiveNote> "<p>Association Films Plans-Fixes</p>"@fr .
<https://memobase.ch/institution/test> <https://www.ica.org/standards/RiC/ontology#descriptiveNote> "<p>Association Films Plans-Fixes</p>"@de .
<https://memobase.ch/institution/test> <http://www.wikidata.org/prop/direct/P2699> "http://www.plansfixes.ch/indexation/" .
<https://memobase.ch/institution/test> <https://www.ica.org/standards/RiC/ontology#identifiedBy> _:B20812738X2Db181X2D46eaX2Da65cX2D72b85dbc6553 .
<https://memobase.ch/institution/test> <https://www.ica.org/standards/RiC/ontology#name> "Association Films Plans-Fixes"@it .
<https://memobase.ch/institution/test> <https://www.ica.org/standards/RiC/ontology#name> "Association Films Plans-Fixes"@fr .
<https://memobase.ch/institution/test> <https://www.ica.org/standards/RiC/ontology#name> "Association Films Plans-Fixes"@de .
<https://memobase.ch/institution/test> <http://www.wikidata.org/prop/direct/P6375> _:B .
<https://memobase.ch/institution/test> <http://www.wikidata.org/prop/direct/P6375> _:B .
<https://memobase.ch/institution/test> <http://www.wikidata.org/prop/direct/P791> "12345" .
<https://memobase.ch/institution/test> <http://www.wikidata.org/prop/direct/P856> "http://www.plansfixes.ch/" .
<https://memobase.ch/institution/test> <http://www.wikidata.org/prop/direct/P968> "info@plans-fixess.ch" .
<https://memobase.ch/institution/test> <http://www.wikidata.org/prop/direct/P6375> _:B7da6890eX2Dc176X2D4ad4X2D9413X2D61c872645dfd .
<https://memobase.ch/institution/test> <http://www.wikidata.org/prop/direct/P6375> _:B5dd20314X2D0d4bX2D4fdaX2D9e4aX2D0b8e789e167d .
_:B7da6890eX2Dc176X2D4ad4X2D9413X2D61c872645dfd <http://www.wikidata.org/prop/direct/P281> "10409" .
_:B7da6890eX2Dc176X2D4ad4X2D9413X2D61c872645dfd <http://www.wikidata.org/prop/direct/P670> "107" .
_:B7da6890eX2Dc176X2D4ad4X2D9413X2D61c872645dfd <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.wikidata.org/entity/Q17334923> .
_:B7da6890eX2Dc176X2D4ad4X2D9413X2D61c872645dfd <http://www.wikidata.org/prop/direct/P17> <http://www.wikidata.org/entity/Q39> .
_:B7da6890eX2Dc176X2D4ad4X2D9413X2D61c872645dfd <http://www.wikidata.org/prop/direct/P6375> "Ostseestraße 107"@it .
_:B7da6890eX2Dc176X2D4ad4X2D9413X2D61c872645dfd <http://www.wikidata.org/prop/direct/P6375> "Ostseestraße 107"@fr .
_:B7da6890eX2Dc176X2D4ad4X2D9413X2D61c872645dfd <http://www.wikidata.org/prop/direct/P6375> "Ostseestraße 107"@de .
_:B7da6890eX2Dc176X2D4ad4X2D9413X2D61c872645dfd <http://www.wikidata.org/prop/direct/P669> "Ostseestraße"@it .
_:B7da6890eX2Dc176X2D4ad4X2D9413X2D61c872645dfd <http://www.wikidata.org/prop/direct/P669> "Ostseestraße"@fr .
_:B7da6890eX2Dc176X2D4ad4X2D9413X2D61c872645dfd <http://www.wikidata.org/prop/direct/P669> "Ostseestraße"@de .
_:B5dd20314X2D0d4bX2D4fdaX2D9e4aX2D0b8e789e167d <http://www.wikidata.org/prop/direct/P6375> "Straßenname 12\nZusätzliche Adressinformationen"@it .
_:B5dd20314X2D0d4bX2D4fdaX2D9e4aX2D0b8e789e167d <http://www.wikidata.org/prop/direct/P6375> "Straßenname 12\nZusätzliche Adressinformationen"@fr .
_:B5dd20314X2D0d4bX2D4fdaX2D9e4aX2D0b8e789e167d <http://www.wikidata.org/prop/direct/P6375> "Straßenname 12\nZusätzliche Adressinformationen"@de .
_:B5dd20314X2D0d4bX2D4fdaX2D9e4aX2D0b8e789e167d <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.wikidata.org/entity/Q17334923> .
_:B5dd20314X2D0d4bX2D4fdaX2D9e4aX2D0b8e789e167d <http://www.wikidata.org/prop/direct/P281> "1002" .
_:B5dd20314X2D0d4bX2D4fdaX2D9e4aX2D0b8e789e167d <http://www.wikidata.org/prop/direct/P670> "12" .
_:B5dd20314X2D0d4bX2D4fdaX2D9e4aX2D0b8e789e167d <http://www.wikidata.org/prop/direct/P17> <http://www.wikidata.org/entity/Q39> .
_:B5dd20314X2D0d4bX2D4fdaX2D9e4aX2D0b8e789e167d <http://www.wikidata.org/prop/direct/P669> "Straßenname"@it .
_:B5dd20314X2D0d4bX2D4fdaX2D9e4aX2D0b8e789e167d <http://www.wikidata.org/prop/direct/P669> "Straßenname"@fr .
_:B5dd20314X2D0d4bX2D4fdaX2D9e4aX2D0b8e789e167d <http://www.wikidata.org/prop/direct/P669> "Straßenname"@de .
\ No newline at end of file
<https://memobase.ch/institution/test> <https://www.ica.org/standards/RiC/ontology#descriptiveNote> "<p>Association Films Plans-Fixes</p>"@de .
<https://memobase.ch/institution/test> <https://www.ica.org/standards/RiC/ontology#descriptiveNote> "<p>Association Films Plans-Fixes</p>"@fr .
<https://memobase.ch/institution/test> <https://www.ica.org/standards/RiC/ontology#descriptiveNote> "<p>Association Films Plans-Fixes</p>"@it .
<https://memobase.ch/institution/test> <https://www.ica.org/standards/RiC/ontology#identifiedBy> _:B .
<https://memobase.ch/institution/test> <https://www.ica.org/standards/RiC/ontology#name> "Association Films Plans-Fixes"@de .
<https://memobase.ch/institution/test> <https://www.ica.org/standards/RiC/ontology#name> "Association Films Plans-Fixes"@fr .
<https://memobase.ch/institution/test> <https://www.ica.org/standards/RiC/ontology#name> "Association Films Plans-Fixes"@it .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.wikidata.org/entity/Q17334923> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.wikidata.org/entity/Q17334923> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Identifier> .
_:B <http://www.wikidata.org/prop/direct/P131> <http://www.wikidata.org/entity/Q1034> .
_:B <http://www.wikidata.org/prop/direct/P131> <http://www.wikidata.org/entity/Q1034> .
_:B <http://www.wikidata.org/prop/direct/P131> <http://www.wikidata.org/entity/Q11911> .
_:B <http://www.wikidata.org/prop/direct/P131> <http://www.wikidata.org/entity/Q11911> .
_:B <http://www.wikidata.org/prop/direct/P17> <http://www.wikidata.org/entity/Q39> .
_:B <http://www.wikidata.org/prop/direct/P17> <http://www.wikidata.org/entity/Q39> .
_:B <http://www.wikidata.org/prop/direct/P281> "2502" .
_:B <http://www.wikidata.org/prop/direct/P281> "2502" .
_:B <http://www.wikidata.org/prop/direct/P625> "Point(7.247222222 47.137222222)" .
_:B <http://www.wikidata.org/prop/direct/P625> "Point(7.247222222 47.137222222)" .
_:B <http://www.wikidata.org/prop/direct/P6375> "Ostseestraße 107"@de .
_:B <http://www.wikidata.org/prop/direct/P6375> "Ostseestraße 107"@fr .
_:B <http://www.wikidata.org/prop/direct/P6375> "Ostseestraße 107"@it .
_:B <http://www.wikidata.org/prop/direct/P6375> "Straßenname 12\nZusätzliche Adressinformationen"@de .
_:B <http://www.wikidata.org/prop/direct/P6375> "Straßenname 12\nZusätzliche Adressinformationen"@fr .
_:B <http://www.wikidata.org/prop/direct/P6375> "Straßenname 12\nZusätzliche Adressinformationen"@it .
_:B <http://www.wikidata.org/prop/direct/P669> "Ostseestraße"@de .
_:B <http://www.wikidata.org/prop/direct/P669> "Ostseestraße"@fr .
_:B <http://www.wikidata.org/prop/direct/P669> "Ostseestraße"@it .
_:B <http://www.wikidata.org/prop/direct/P669> "Straßenname"@de .
_:B <http://www.wikidata.org/prop/direct/P669> "Straßenname"@fr .
_:B <http://www.wikidata.org/prop/direct/P669> "Straßenname"@it .
_:B <http://www.wikidata.org/prop/direct/P670> "107" .
_:B <http://www.wikidata.org/prop/direct/P670> "12" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "test" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "main" .
\ No newline at end of file
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