Commit 01ac680d authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Update memobase service utility dependency.

Add license headers.
Normalize packages.
parent 4f3c28ea
Pipeline #18487 passed with stage
in 1 minute and 59 seconds
......@@ -48,7 +48,7 @@ dependencies {
//compile group: 'org.elasticsearch.client', name: 'elasticsearch-rest-high-level-client', version: '7.1.0'
implementation "org.apache.logging.log4j:log4j-api:${log4jV}"
implementation 'org.memobase:memobase-service-utilities:0.16.0'
implementation 'org.memobase:memobase-service-utilities:2.0.2'
// YAML Parser
implementation 'com.fasterxml.jackson.core:jackson-databind:2.11.+'
implementation 'com.fasterxml.jackson.core:jackson-core:2.11.+'
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.configs
import ch.memobase.exceptions.InvalidMappingException
import ch.memobase.model.GlobalTransform
import ch.memobase.transform.ITransformer
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.exc.MismatchedInputException
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
import org.apache.logging.log4j.LogManager
import java.io.File
import java.io.FileInputStream
import org.apache.logging.log4j.LogManager
import org.memobase.exceptions.InvalidMappingException
class GlobalTransformsLoader(file: String) {
private val log = LogManager.getLogger("GlobalTransformLoader")
......@@ -46,8 +61,7 @@ class GlobalTransformsLoader(file: String) {
parsedTransformers.add(normalizeLanguages.generate())
}
}
it.normalizeGenre.let {
normalizeGenre ->
it.normalizeGenre.let { normalizeGenre ->
if (normalizeGenre != null) {
parsedTransformers.add(normalizeGenre.generate())
}
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.configs
import ch.memobase.transform.ITransformer
import ch.memobase.exceptions.InvalidMappingException
import ch.memobase.model.LocalTransform
import ch.memobase.transform.ITransformer
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.exc.MismatchedInputException
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
import org.apache.logging.log4j.LogManager
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import org.apache.logging.log4j.LogManager
import org.memobase.exceptions.InvalidMappingException
class LocalTransformsLoader(data: ByteArray) {
private val log = LogManager.getLogger("LocalTransformsLoader")
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.helpers
import ch.memobase.rdf.MemobaseModel
import ch.memobase.rdf.RDF
import ch.memobase.rdf.RICO
import ch.memobase.rdf.RicoResource
import org.apache.jena.datatypes.xsd.impl.XSDDateTimeType
import org.apache.jena.rdf.model.Literal
import org.apache.jena.rdf.model.Model
import org.apache.jena.rdf.model.Resource
import org.apache.jena.rdf.model.ResourceFactory
import ch.memobase.rdf.MemobaseModel
import org.memobase.rdf.RDF
import org.memobase.rdf.RICO
import ch.memobase.rdf.RicoResource
import java.time.ZoneId
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.helpers
import java.text.DateFormatSymbols
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.helpers
object KEYS {
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.helpers
import com.github.doyaaaaaken.kotlincsv.dsl.csvReader
import ch.memobase.model.Facets
import ch.memobase.model.Labels
import com.github.doyaaaaaken.kotlincsv.dsl.csvReader
import java.io.File
object LoadFile {
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.model
import ch.memobase.exceptions.InvalidMappingException
import ch.memobase.helpers.KEYS.extractCreationRelationNamePatternGroupName
import org.memobase.exceptions.InvalidMappingException
import ch.memobase.transform.ExtractCreationRelationNameTransform
data class ExtractCreationRelationName(
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.model
data class Facets(
val wikidata: List<String>,
val freeFacetValue: List<String>)
\ No newline at end of file
val freeFacetValue: List<String>
)
\ No newline at end of file
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.model
data class GlobalTransform(
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.model
import ch.memobase.helpers.KEYS
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.model
data class LocalTransform(
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.model
import ch.memobase.helpers.LoadFile
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.model
import ch.memobase.transform.DateNormalizationTransform
import java.nio.file.Files
import java.nio.file.Paths
import ch.memobase.transform.DateNormalizationTransform
data class NormalizeDate(
val qualifiers: String,
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.model
import ch.memobase.helpers.LoadFile
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.model
import ch.memobase.helpers.LoadFile
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.model
import org.memobase.exceptions.InvalidMappingException
import ch.memobase.exceptions.InvalidMappingException
import ch.memobase.transform.ITransformer
import ch.memobase.transform.PersonNormalizer
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.model
import org.apache.jena.rdf.model.ResourceFactory
import org.memobase.rdf.NS
import ch.memobase.rdf.NS
import ch.memobase.transform.SplitEntityTransform
import org.apache.jena.rdf.model.ResourceFactory
data class SplitEntity(
val type: String,
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.rdf
import org.apache.jena.rdf.model.Property
import org.apache.jena.rdf.model.Resource
import org.apache.jena.rdf.model.Statement
import ch.memobase.helpers.Activity
import ch.memobase.helpers.KEYS
import ch.memobase.model.Labels
import org.memobase.rdf.NS
import org.memobase.rdf.SCHEMA
import org.apache.jena.rdf.model.Property
import org.apache.jena.rdf.model.Resource
import org.apache.jena.rdf.model.Statement
class EnrichedConceptBuilder(
private val rdfType: Resource,
private val model: MemobaseModel,
private val target: RicoResource,
private val targetProperty: Property
private val rdfType: Resource,
private val model: MemobaseModel,
private val target: RicoResource,
private val targetProperty: Property
) {
private var resource: RicoResource? = null
......@@ -25,9 +38,9 @@ class EnrichedConceptBuilder(
fun addLabels(property: Property, labels: Labels): EnrichedConceptBuilder {
resource
?.addLiteral(property, labels.de.ifEmpty { KEYS.missingLabelDe }, "de")
?.addLiteral(property, labels.fr.ifEmpty { KEYS.missingLabelFr }, "fr")
?.addLiteral(property, labels.it.ifEmpty { KEYS.missingLabelIt }, "it")
?.addLiteral(property, labels.de.ifEmpty { KEYS.missingLabelDe }, "de")
?.addLiteral(property, labels.fr.ifEmpty { KEYS.missingLabelFr }, "fr")
?.addLiteral(property, labels.it.ifEmpty { KEYS.missingLabelIt }, "it")
return this
}
......
/*
Copyright 2020 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase.rdf
class InvalidInputException(message: String) : Exception(message)
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