From 48f942f256df3fd0476e12ab0ee2d8fc4863183b Mon Sep 17 00:00:00 2001 From: Dennis Schiese <135758800+dschiese@users.noreply.github.com> Date: Mon, 2 Oct 2023 01:13:22 +0200 Subject: [PATCH] Qanary component KG2KG-Translation of AnnotationOfInstance (#309) * Init for new component * Re-initalize new component * WIP * Work in progress * Work in progress, added queries for wikidataToDbpedia and reverse * Work in progress, added updating triplestore * Added Test file * Refactored method names * Added Exception handling, refactored code, added comments * Adjusted Pojo equals()-method, refactored exceptions * WIP: Tests, Structure refactoring * Adjusted exceptions and tests, work in progress * Added functionality for several oa:sameAs annotations * Finished testing, clean up code * Added Springdoc and swaggerUI * Updated documentation * set up docker * Optimized README.adoc * KG2KGTranslateAnnotationsOfInstance: small improvements * KG2KGTranslateAnnotationsOfInstanceController: small improvements * AnnotationOfInstancePojo: ensured formatting * application.properties: improved component description * Update annotationsOfInstanceResourceQuery.rq * Update insert_one_annotation.rq --------- Co-authored-by: Andreas Both --- .../Dockerfile | 7 + .../README.adoc | 80 + .../pom.xml | 127 + .../wdaqua/qanary/component/Application.java | 23 + .../KG2KGTranslateAnnotationsOfInstance.java | 231 + .../component/WebServerFactoryCustomizer.java | 25 + ...nslateAnnotationsOfInstanceController.java | 45 + .../pojos/AnnotationOfInstancePojo.java | 102 + ...nslateAnnotationsOfInstanceRepository.java | 47 + .../src/main/resources/application.properties | 48 + .../annotationsOfInstanceResourceQuery.rq | 19 + .../resources/queries/dbpediaToWikidata.rq | 6 + .../queries/insert_one_annotation.rq | 26 + .../resources/queries/wikidataToDbpedia.rq | 6 + .../qanary/component/ApplicationTest.java | 18 + ...2KGTranslateAnnotationsOfInstanceTest.java | 176 + .../qanary/component/TestDataProvider.java | 63 + .../resources/queries/dbpediaToWikidata.rq | 6 + .../resources/queries/wikidataToDbpedia.rq | 6 + .../src/test/resources/testDataset.rdf | 5592 +++++++++++++++++ .../kg2kg-translateannotationsofinstance | 4 + service_config/service_config.json | 13 +- 22 files changed, 6669 insertions(+), 1 deletion(-) create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/Dockerfile create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/README.adoc create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/pom.xml create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/Application.java create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/KG2KGTranslateAnnotationsOfInstance.java create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/WebServerFactoryCustomizer.java create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/controller/KG2KGTranslateAnnotationsOfInstanceController.java create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/pojos/AnnotationOfInstancePojo.java create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/repositories/KG2KGTranslateAnnotationsOfInstanceRepository.java create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/application.properties create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/annotationsOfInstanceResourceQuery.rq create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/dbpediaToWikidata.rq create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/insert_one_annotation.rq create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/wikidataToDbpedia.rq create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/java/eu/wdaqua/qanary/component/ApplicationTest.java create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/java/eu/wdaqua/qanary/component/KG2KGTranslateAnnotationsOfInstanceTest.java create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/java/eu/wdaqua/qanary/component/TestDataProvider.java create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/resources/queries/dbpediaToWikidata.rq create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/resources/queries/wikidataToDbpedia.rq create mode 100644 qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/resources/testDataset.rdf create mode 100644 service_config/files/kg2kg-translateannotationsofinstance diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/Dockerfile b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/Dockerfile new file mode 100644 index 000000000..01e3ba797 --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/Dockerfile @@ -0,0 +1,7 @@ +FROM openjdk:17 + +# Add the service itself +ARG JAR_FILE +ADD target/${JAR_FILE} /qanary-service.jar + +ENTRYPOINT ["java", "-jar", "/qanary-service.jar"] \ No newline at end of file diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/README.adoc b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/README.adoc new file mode 100644 index 000000000..0dd915a50 --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/README.adoc @@ -0,0 +1,80 @@ +:toc: +:toclevels: 5 +:toc-placement!: +:source-highlighter: highlight.js +ifdef::env-github[] +:tip-caption: :bulb: +:note-caption: :information_source: +:important-caption: :heavy_exclamation_mark: +:caution-caption: :fire: +:warning-caption: :warning: +endif::[] + +# KG2KG Translation of AnnotationOfInstance + +This component is intended to translate resources from https://dbpedia.org/[DBpedia] to https://www.wikidata.org/[Wikidata] and vice versa for existing annotations of type `qa:AnnotationOfInstance`. +For example, let's assume the resource http://dbpedia.org/resource/Albert_Einstein of the DBpedia knowledge graph is (was recognized by a component and hence) stored in the Qanary triplestore as part of an annotation of type `qa:AnnotationOfInstance`. +Then, this component will try to find the corresponding resource in the Wikidata knowledge graph (using the `owl:sameAs` property) and automatically replace the value with the mentioned annotation by the found resource URI (in our example, it would be http://www.wikidata.org/entity/Q937). +Obviously, the approach works the same way if a Wikidata resource is found in the original data. + +--- + +toc::[] + +--- + +## Processing + +The component's process follows three steps: + +-- +. Fetching all existing annotations of type `qa:AnnotationOfInstance` from the Qanary Triplestore +. depending on whether a DBpedia or Wikidata resource is used in the annotation DBpedia is asked for the relation `owl:sameAs` to Wikidata or DBpedia +. for each existing annotation of type `qa:AnnotationOfInstance` all equivalent resources are stored in the Qanary triplestore with only the resource URI (from the original annotation) is replaced +-- + + + +## Input specification + +[source,ttl] +---- +@prefix qa: . +@prefix oa: . + + a qa:AnnotationOfInstance . + oa:hasTarget [ + a oa:SpecificResource; + oa:hasSource ; + oa:hasSelector [ + a oa:TextPositionSelector ; + oa:start "0"^^xsd:nonNegativeInteger ; + oa:end "5"^^xsd:nonNegativeInteger + ] + ] . + oa:hasBody ; + oa:annotatedBy "qanaryComponent" ; + oa:annotatedAt "2001-10-26T21:32:52"^^xsd:dateTime . +---- + +## Output specification + +[source,ttl] +---- +@prefix qa: . +@prefix oa: . + + a qa:AnnotationOfInstance . + oa:hasTarget [ + a oa:SpecificResource; + oa:hasSource ; + oa:hasSelector [ + a oa:TextPositionSelector ; + oa:start "0"^^xsd:nonNegativeInteger ; + oa:end "5"^^xsd:nonNegativeInteger + ] + ] . + oa:hasBody ; + oa:annotatedBy ; + oa:annotatedAt "2001-10-26T21:32:52"^^xsd:dateTime . +---- diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/pom.xml b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/pom.xml new file mode 100644 index 000000000..019dfba29 --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/pom.xml @@ -0,0 +1,127 @@ + + + + 4.0.0 + eu.wdaqua.qanary.component + qanary-component-KG2KG-TranslateAnnotationsOfInstance + 0.1.0 + Qanary component KG2KG Translation of AnnotationOfInstance + + org.springframework.boot + spring-boot-starter-parent + 2.6.7 + + + + 17 + qanary + qanary-component-kg2kg-translateannotationsofinstance + 1.4.13 + 1.7.0 + [3.7.0,4.0.0) + [3.8.0,4.0.0) + + + + eu.wdaqua.qanary + qa.component + ${qanary.component.version} + + + eu.wdaqua.qanary + qa.commons + ${qanary.commons.version} + + + org.mockito + mockito-junit-jupiter + test + + + org.apache.logging.log4j + log4j-to-slf4j + 2.20.0 + + + org.apache.logging.log4j + log4j-api + + + + + org.springdoc + springdoc-openapi-ui + ${spingdoc.version} + + + org.springframework.boot + spring-boot-starter-test + test + 2.6.7 + + + org.springdoc + springdoc-openapi-starter-webmvc-ui + 2.2.0 + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + eu.wdaqua.qanary.component.Application + + + + + + repackage + + + + + + com.spotify + dockerfile-maven-plugin + ${dockerfile-maven-version} + + + default + + build + push + + + + default-2 + + tag + push + + + latest + + + + + ${docker.image.prefix}/${docker.image.name} + ${project.version} + + ${project.build.finalName}.jar + + + + + + + src/test/resources + + + + diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/Application.java b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/Application.java new file mode 100644 index 000000000..b399c74a6 --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/Application.java @@ -0,0 +1,23 @@ +package eu.wdaqua.qanary.component; + + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"eu.wdaqua.qanary"}) +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + + @Bean + public QanaryComponent qanaryComponent( + @Value("${spring.application.name}") final String applicationName) { + return new KG2KGTranslateAnnotationsOfInstance(applicationName); + } +} diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/KG2KGTranslateAnnotationsOfInstance.java b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/KG2KGTranslateAnnotationsOfInstance.java new file mode 100644 index 000000000..2062aee63 --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/KG2KGTranslateAnnotationsOfInstance.java @@ -0,0 +1,231 @@ +package eu.wdaqua.qanary.component; + +import eu.wdaqua.qanary.commons.QanaryMessage; +import eu.wdaqua.qanary.commons.QanaryUtils; +import eu.wdaqua.qanary.commons.triplestoreconnectors.QanaryTripleStoreConnector; +import eu.wdaqua.qanary.component.pojos.AnnotationOfInstancePojo; +import eu.wdaqua.qanary.component.repositories.KG2KGTranslateAnnotationsOfInstanceRepository; +import eu.wdaqua.qanary.exceptions.SparqlQueryFailed; +import org.apache.jena.datatypes.xsd.XSDDatatype; +import org.apache.jena.query.QuerySolution; +import org.apache.jena.query.QuerySolutionMap; +import org.apache.jena.query.ResultSet; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.ResourceFactory; +import org.apache.jena.rdfconnection.JenaConnectionException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Component +public class KG2KGTranslateAnnotationsOfInstance extends QanaryComponent { + + /* + - given is an annotations with either a DBpedia resource or a Wikidata resource + - depending on what is given the other resource is returned + */ + + private static final String ANNOTATION_OF_INSTANCE_RESOURCES_QUERY = "/queries/annotationsOfInstanceResourceQuery.rq"; + private static final String DBPEDIA_TO_WIKIDATA_QUERY = "/queries/dbpediaToWikidata.rq"; + private static final String WIKIDATA_TO_DBPEDIA_QUERY = "/queries/wikidataToDbpedia.rq"; + private static final String INSERT_ANNOTATION_QUERY = "/queries/insert_one_annotation.rq"; + private static final String WIKIDATA_PREFIX = "http://www.wikidata.org"; + private static final String DBPEDIA_PREFIX = "http://dbpedia.org"; + private final String applicationName; + private final Logger logger = LoggerFactory.getLogger(KG2KGTranslateAnnotationsOfInstance.class); + private final Map containsDBpediaPrefix = new HashMap<>() {{ + put(true, DBPEDIA_TO_WIKIDATA_QUERY); + put(false, WIKIDATA_TO_DBPEDIA_QUERY); + }}; + @Autowired + private KG2KGTranslateAnnotationsOfInstanceRepository kg2KGTranslateAnnotationsOfInstanceRepository; + + public KG2KGTranslateAnnotationsOfInstance(@Value("${spring.application.name}") final String applicationName) { + this.applicationName = applicationName; + + // here if the files are available and do contain content // do files exist? + QanaryTripleStoreConnector.guardNonEmptyFileFromResources(ANNOTATION_OF_INSTANCE_RESOURCES_QUERY); + QanaryTripleStoreConnector.guardNonEmptyFileFromResources(DBPEDIA_TO_WIKIDATA_QUERY); + QanaryTripleStoreConnector.guardNonEmptyFileFromResources(WIKIDATA_TO_DBPEDIA_QUERY); + QanaryTripleStoreConnector.guardNonEmptyFileFromResources(INSERT_ANNOTATION_QUERY); + } + + @Override + public QanaryMessage process(QanaryMessage myQanaryMessage) throws Exception { + + QanaryUtils qanaryUtils = this.getUtils(myQanaryMessage); + String graphID = myQanaryMessage.getOutGraph().toASCIIString(); + QanaryTripleStoreConnector qanaryTripleStoreConnector = qanaryUtils.getQanaryTripleStoreConnector(); + + // Step 1: Fetching resources and save them into an arraylist + ResultSet resultSet = fetchAnnotations(graphID, qanaryUtils); + List annotationOfInstanceObjects = createAnnotationObjets(resultSet); + + // Step 2: Compute new and equivalent resources + annotationOfInstanceObjects = computeEquivalentResources(annotationOfInstanceObjects); + logger.info("Computed new resources: {}", annotationOfInstanceObjects.toString()); + + // Step 3: Insert new annotations with new computed resource + updateTriplestore(annotationOfInstanceObjects, graphID, qanaryTripleStoreConnector); + + + return myQanaryMessage; + } + + /* + * STEP 1: Fetch required data + */ + + /** + * Fetching all annotations of type qa:AnnotationsOfInstance + */ + public ResultSet fetchAnnotations(String graphID, final QanaryUtils qanaryUtils) throws IOException, SparqlQueryFailed { + String requestQuery = getRequestQuery(graphID); + return qanaryUtils.getQanaryTripleStoreConnector().select(requestQuery); + } + + /** + * binds values for request query and returns it + */ + public String getRequestQuery(String graphID) throws IOException { + QuerySolutionMap bindingsForQuery = new QuerySolutionMap(); + bindingsForQuery.add("graphID", ResourceFactory.createResource(graphID)); + + return QanaryTripleStoreConnector.readFileFromResourcesWithMap(ANNOTATION_OF_INSTANCE_RESOURCES_QUERY, bindingsForQuery); + } + + public List createAnnotationObjets(ResultSet resultSet) { + List annotationOfInstanceObjects = new ArrayList<>(); + + while (resultSet.hasNext()) { + QuerySolution entry = resultSet.next(); + String entryResource = entry.get("resource").toString(); + double score = entry.get("score").asLiteral().getDouble(); + String targetQuestion = entry.get("targetQuestion").toString(); + int start = entry.get("start").asLiteral().getInt(); + int end = entry.get("end").asLiteral().getInt(); + String annotationId = entry.get("annotationId").toString(); + AnnotationOfInstancePojo tmp = new AnnotationOfInstancePojo(annotationId, entryResource, targetQuestion, start, end, score); + annotationOfInstanceObjects.add(tmp); + logger.info("Resource found: {}", tmp); + } + + return annotationOfInstanceObjects; + } + + /* + * STEP 2: Compute new resources + */ + + /** + * @param annotationOfInstanceObjects Annotation objects with missing newResource value which is added here + * @return List with Annotation objects containing newResource values + */ + public List computeEquivalentResources(List annotationOfInstanceObjects) throws IOException { + List temp = new ArrayList<>(annotationOfInstanceObjects); + for (AnnotationOfInstancePojo annotationObject : annotationOfInstanceObjects + ) { + String originResource = annotationObject.getOriginResource(); + try { + List newResources = getEquivalentResource(containsDBpediaPrefix.get(originResource.contains(DBPEDIA_PREFIX)), originResource); + logger.info("Resource(s) found for resource: {}", annotationObject.getOriginResource()); + annotationObject.setNewResources(newResources); + } catch (RuntimeException e) { + // no equivalent resource found -> remove this obj since it's not necessary anymore + logger.error("No resource found for resource: {}", annotationObject.getOriginResource()); + temp.remove(annotationObject); + } + } + return temp; + } + + /** + * used for the API endpoint + */ + public List computeEquivalentResource(String originResource) throws IOException { + try { + return getEquivalentResource(containsDBpediaPrefix.get(originResource.contains(DBPEDIA_PREFIX)), originResource); + } catch (RuntimeException e) { + logger.error("{}", e.getMessage()); + return null; + } + } + + /** + * requests the DBpedia-SPARQL endpoint to fetch an equivalent resource and returns it + * + * @param query used query - depending on the originResource + * @param originResource either Wikidata or DBpedia + * @return RDFNode containing a "resource"-key with the new resource in it + * @throws IOException thrown when building request query for @param executableQuery + * @throws JenaConnectionException thrown when connection problems occur + */ + public List getEquivalentResource(String query, String originResource) throws IOException, RuntimeException { + try { + String executableQuery = getResourceRequestQuery(query, originResource); + return kg2KGTranslateAnnotationsOfInstanceRepository.fetchEquivalentResource(executableQuery); + } catch (IOException ioException) { + logger.error("Error while creating query for resource fetching. {}", ioException.getMessage()); + throw new IOException(); + } + } + + /** + * binds values for request query and returns it + */ + public String getResourceRequestQuery(String query, String originResource) throws IOException { + logger.info("Query: {}", query); + QuerySolutionMap bindingsForQuery = new QuerySolutionMap(); + bindingsForQuery.add("originResource", ResourceFactory.createResource(originResource)); + + return QanaryTripleStoreConnector.readFileFromResourcesWithMap(query, bindingsForQuery); + } + + /* + * STEP 3: STORE COMPUTED INFORMATION + */ + + /** + * create the insert query for every annotation and update the triplestore + * + * @param annotationOfInstanceObjects Annotation objects containing origin and new resource + */ + public void updateTriplestore(List annotationOfInstanceObjects, String graphID, QanaryTripleStoreConnector qanaryTripleStoreConnector) throws IOException, SparqlQueryFailed { + for (AnnotationOfInstancePojo obj: annotationOfInstanceObjects + ) { // inner for-loop for originResources with more than one equivalent resource + for (RDFNode objResource : obj.getNewResources()) { + String query = createInsertQuery(obj, objResource.toString(), graphID); + logger.info("Created Insert Query: {}", query); + updateTriplestoreWithQuery(query, qanaryTripleStoreConnector); + } + } + } + + public void updateTriplestoreWithQuery(String query, QanaryTripleStoreConnector qanaryTripleStoreConnector) throws SparqlQueryFailed { + qanaryTripleStoreConnector.update(query); + } + + /** + * binds values for insert query and returns it + */ + public String createInsertQuery(AnnotationOfInstancePojo annotationOfInstancePojo, String newResource, String graphID) throws IOException { + QuerySolutionMap bindingsForQuery = new QuerySolutionMap(); + bindingsForQuery.add("graph", ResourceFactory.createResource(graphID)); + bindingsForQuery.add("targetQuestion", ResourceFactory.createResource(annotationOfInstancePojo.getTargetQuestion())); + bindingsForQuery.add("start", ResourceFactory.createPlainLiteral(String.valueOf(annotationOfInstancePojo.getStart()))); + bindingsForQuery.add("end", ResourceFactory.createPlainLiteral(String.valueOf(annotationOfInstancePojo.getEnd()))); + bindingsForQuery.add("answer", ResourceFactory.createResource(newResource)); + bindingsForQuery.add("score", ResourceFactory.createTypedLiteral(String.valueOf(annotationOfInstancePojo.getScore()), XSDDatatype.XSDdouble)); + bindingsForQuery.add("application", ResourceFactory.createResource("urn:qanary:" + this.applicationName)); + return QanaryTripleStoreConnector.readFileFromResourcesWithMap(INSERT_ANNOTATION_QUERY, bindingsForQuery); + } + +} diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/WebServerFactoryCustomizer.java b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/WebServerFactoryCustomizer.java new file mode 100644 index 000000000..548f065a2 --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/WebServerFactoryCustomizer.java @@ -0,0 +1,25 @@ +package eu.wdaqua.qanary.component; + +import org.apache.tomcat.util.buf.EncodedSolidusHandling; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Service; + +/** + * Service to allow encoded "/" with "%2" in URLs + */ +@Service +public class WebServerFactoryCustomizer { + + private final Logger logger = LoggerFactory.getLogger(WebServerFactoryCustomizer.class); + + @Bean + public org.springframework.boot.web.server.WebServerFactoryCustomizer tomcatCustomizer() { + logger.info("Configuring Tomcat to allow encoded slashes."); + return factory -> factory.addConnectorCustomizers(connector -> connector.setEncodedSolidusHandling( + EncodedSolidusHandling.DECODE.getValue())); + } + +} \ No newline at end of file diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/controller/KG2KGTranslateAnnotationsOfInstanceController.java b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/controller/KG2KGTranslateAnnotationsOfInstanceController.java new file mode 100644 index 000000000..e0e68a34a --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/controller/KG2KGTranslateAnnotationsOfInstanceController.java @@ -0,0 +1,45 @@ +package eu.wdaqua.qanary.component.controller; + +import eu.wdaqua.qanary.component.KG2KGTranslateAnnotationsOfInstance; +import io.swagger.v3.oas.annotations.Operation; +import org.apache.jena.rdf.model.RDFNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; +import java.util.List; + +@Controller +public class KG2KGTranslateAnnotationsOfInstanceController { + + private final Logger logger = LoggerFactory.getLogger(KG2KGTranslateAnnotationsOfInstanceController.class); + @Autowired + private KG2KGTranslateAnnotationsOfInstance kg2KGTranslateAnnotationsOfInstance; + + @GetMapping("/equivalentresources/{resource}") + @Operation( + summary = "Request equivalent DBpedia or Wikidata resource.", + description = """ + Pass an encoded resource as a path variable to get the equivalent\s + DBpedia or Wikidata resource, depending on your input. + For example, '/http%3A%2F%2Fdbpedia.org%2Fresource%2FLeipzig' should return 3 equivalent Wikidata resources. + """ + ) + public ResponseEntity getEquivalentResource(@PathVariable("resource") String resource) throws Exception { + String decodedResource = URLDecoder.decode(resource, StandardCharsets.ISO_8859_1); + List newResources = kg2KGTranslateAnnotationsOfInstance.computeEquivalentResource(decodedResource); + if (newResources != null) { + return new ResponseEntity<>(newResources.toString(), HttpStatus.OK); + } else { + return new ResponseEntity<>("There's no equivalent resource", HttpStatus.BAD_REQUEST); + } + } + +} diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/pojos/AnnotationOfInstancePojo.java b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/pojos/AnnotationOfInstancePojo.java new file mode 100644 index 000000000..05fedef0e --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/pojos/AnnotationOfInstancePojo.java @@ -0,0 +1,102 @@ +package eu.wdaqua.qanary.component.pojos; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.apache.jena.rdf.model.RDFNode; + +import java.util.List; + +public class AnnotationOfInstancePojo { + + @JsonProperty("annotationId") + private String annotationId; + private String targetQuestion; + private int start; + private int end; + private double score; + private String originResource; + private List newResources; + + public AnnotationOfInstancePojo(String annotationId, String originResource, String targetQuestion, int start, int end, double score) { + this.annotationId = annotationId; + this.originResource = originResource; + this.targetQuestion = targetQuestion; + this.start = start; + this.end = end; + this.score = score; + } + + public String getAnnotationId() { + return annotationId; + } + + public void setAnnotationId(String annotationId) { + this.annotationId = annotationId; + } + + public int getEnd() { + return end; + } + + public void setEnd(int end) { + this.end = end; + } + + public int getStart() { + return start; + } + + public void setStart(int start) { + this.start = start; + } + + public double getScore() { + return score; + } + + public void setScore(double score) { + this.score = score; + } + + public String getTargetQuestion() { + return targetQuestion; + } + + public void setTargetQuestion(String targetQuestion) { + this.targetQuestion = targetQuestion; + } + + public List getNewResources() { + return newResources; + } + + public void setNewResources(List newResources) { + this.newResources = newResources; + } + + public String getOriginResource() { + return originResource; + } + + public void setOriginResource(String originResource) { + this.originResource = originResource; + } + + @Override + public String toString() { + return "AnnotationOfInstancePojo{" + // + "targetQuestion='" + targetQuestion + '\'' + // + ", start=" + start + // + ", end=" + end + // + ", score=" + score + // + ", originResource='" + originResource + '\'' + // + ", newResource='" + newResources.toString() + '\'' + // + '}'; + } + + @Override + public boolean equals(Object obj) { + AnnotationOfInstancePojo annotationOfInstancePojo = (AnnotationOfInstancePojo) obj; + + return this.annotationId == annotationOfInstancePojo.getAnnotationId(); + } +} diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/repositories/KG2KGTranslateAnnotationsOfInstanceRepository.java b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/repositories/KG2KGTranslateAnnotationsOfInstanceRepository.java new file mode 100644 index 000000000..dbd0c12ec --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/repositories/KG2KGTranslateAnnotationsOfInstanceRepository.java @@ -0,0 +1,47 @@ +package eu.wdaqua.qanary.component.repositories; + +import org.apache.jena.query.Dataset; +import org.apache.jena.query.QueryExecution; +import org.apache.jena.query.QuerySolution; +import org.apache.jena.query.ResultSet; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdfconnection.RDFConnection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Repository; + +import java.util.ArrayList; +import java.util.List; + +@Repository +public class KG2KGTranslateAnnotationsOfInstanceRepository { + + private final static String dbpediaSparqlEndpoint = "http://dbpedia.org/sparql"; + private final Logger logger = LoggerFactory.getLogger(KG2KGTranslateAnnotationsOfInstanceRepository.class); + private RDFConnection rdfConnection; + + public KG2KGTranslateAnnotationsOfInstanceRepository() { + this.rdfConnection = RDFConnection.connect(dbpediaSparqlEndpoint); + } + + public void setRdfConnection(Dataset dataset) { + this.rdfConnection = RDFConnection.connect(dataset); + } + + public List fetchEquivalentResource(String executableQuery) throws RuntimeException { + QueryExecution queryExecution = rdfConnection.query(executableQuery); + List equivalentResources = new ArrayList<>(); + ResultSet resultSet = queryExecution.execSelect(); + + if (!resultSet.hasNext()) { + throw new RuntimeException("No resource found"); + } + while (resultSet.hasNext()) { + QuerySolution querySolution = resultSet.next(); + RDFNode newResource = querySolution.getResource("resource"); + equivalentResources.add(newResource); + } + return equivalentResources; + } + +} diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/application.properties b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/application.properties new file mode 100644 index 000000000..2c7f10e5b --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/application.properties @@ -0,0 +1,48 @@ +# Update the port number +server.port=40444 +spring.application.name=KG2KGTranslateAnnotationsOfInstance +spring.application.description=${spring.application.name} is a Qanary component that finds the equivalent DBpedia or Wikidata resource +# the URL of the Qanary pipeline server +spring.boot.admin.url=http://localhost:8080 +spring.boot.admin.client.url=${spring.boot.admin.url} +# the service url +#spring.boot.admin.client.service-base-url=http://localhost:40444 +spring.boot.admin.client.instance.service-base-url=http://localhost:40444 +#spring.security.user.name=admin +#spring.security.user.password=admin +#management.endpoints.web.exposure.include=* +# log level definitions +# change logging level in production +logging.file=/var/log/application.log +logging.level.*:INFO +logging.level.root:INFO +logging.level.org.springframework.core:WARN +logging.level.org.springframework.web:WARN +logging.level.org.springframework.beans:WARN +logging.level.org.springframework.boot:WARN +logging.level.org.apache.catalina.core:WARN +logging.level.org.springframework.jmx:WARN +logging.level.org.springframework.mock:WARN +logging.level.org.springframework.test:WARN +logging.level.eu.wdaqua.qanary:DEBUG +logging.level.de.codecentric.boot.admin.*:INFO +# show colors in IDE console +spring.output.ansi.enabled=always +# swagger-ui custom path +springdoc.swagger-ui.path=/swagger-ui.html +# api-docs custom path +springdoc.api-docs.path=/api-docs +### SSL configuration +# the path to the key store that contains the SSL certificate, e.g., classpath:keystore.p12 +server.ssl.key-store= +# Spring Docs +spingdoc.version=1.7.0 +# the password used to access the key store +server.ssl.key-store-password= +# the type of the key store (JKS or PKCS12) +server.ssl.key-store-type= +# toggle whether HTTP or HTTPS should be used (if SSL is set up) +server.ssl.enabled=false +# health endpoint +management.endpoints.web.exposure.include=* +management.endpoint.health.show-details=always diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/annotationsOfInstanceResourceQuery.rq b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/annotationsOfInstanceResourceQuery.rq new file mode 100644 index 000000000..4c37bfd32 --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/annotationsOfInstanceResourceQuery.rq @@ -0,0 +1,19 @@ +PREFIX qa: +PREFIX oa: + +SELECT * +FROM ?graphID +WHERE { + ?annotationId a qa:AnnotationOfInstance . + ?annotationId oa:hasTarget [ + a oa:SpecificResource; + oa:hasSource ?targetQuestion; + oa:hasSelector [ + a oa:TextPositionSelector ; + oa:start ?start ; + oa:end ?end + ] + ] . + ?annotationId oa:hasBody ?resource ; + qa:score ?score . +} diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/dbpediaToWikidata.rq b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/dbpediaToWikidata.rq new file mode 100644 index 000000000..e9d5166ba --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/dbpediaToWikidata.rq @@ -0,0 +1,6 @@ +PREFIX owl: +SELECT ?resource +WHERE { + ?originResource owl:sameAs ?resource . + FILTER (STRSTARTS(STR(?resource), "http://www.wikidata.org")) +} \ No newline at end of file diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/insert_one_annotation.rq b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/insert_one_annotation.rq new file mode 100644 index 000000000..59069923f --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/insert_one_annotation.rq @@ -0,0 +1,26 @@ +PREFIX qa: +PREFIX oa: +PREFIX rdf: +PREFIX xsd: + +INSERT { +GRAPH ?graph { + ?a a qa:AnnotationOfInstance . + ?a oa:hasTarget [ + a oa:SpecificResource; + oa:hasSource ?targetQuestion; + oa:hasSelector [ + a oa:TextPositionSelector ; + oa:start ?start ; + oa:end ?end + ] + ] . + ?a oa:hasBody ?answer ; + oa:annotatedBy ?application ; + oa:annotatedAt ?time ; + qa:score ?score . +}} +WHERE { + BIND (IRI(str(RAND())) AS ?a) . + BIND (now() as ?time) +} diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/wikidataToDbpedia.rq b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/wikidataToDbpedia.rq new file mode 100644 index 000000000..f0b115039 --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/resources/queries/wikidataToDbpedia.rq @@ -0,0 +1,6 @@ +PREFIX owl: +SELECT ?resource +WHERE { + ?resource owl:sameAs ?originResource . + FILTER (STRSTARTS(STR(?resource), "http://dbpedia.org")) +} \ No newline at end of file diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/java/eu/wdaqua/qanary/component/ApplicationTest.java b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/java/eu/wdaqua/qanary/component/ApplicationTest.java new file mode 100644 index 000000000..73792937b --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/java/eu/wdaqua/qanary/component/ApplicationTest.java @@ -0,0 +1,18 @@ +package eu.wdaqua.qanary.component; + +import org.junit.jupiter.api.Test; + +import static org.junit.Assert.assertTrue; + +/** + * Unit test for simple Application. + */ +public class ApplicationTest { + /** + * Rigorous Test :-) + */ + @Test + public void shouldAnswerWithTrue() { + assertTrue(true); + } +} diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/java/eu/wdaqua/qanary/component/KG2KGTranslateAnnotationsOfInstanceTest.java b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/java/eu/wdaqua/qanary/component/KG2KGTranslateAnnotationsOfInstanceTest.java new file mode 100644 index 000000000..50f018f5d --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/java/eu/wdaqua/qanary/component/KG2KGTranslateAnnotationsOfInstanceTest.java @@ -0,0 +1,176 @@ +package eu.wdaqua.qanary.component; + + +import eu.wdaqua.qanary.commons.triplestoreconnectors.QanaryTripleStoreConnector; +import eu.wdaqua.qanary.component.pojos.AnnotationOfInstancePojo; +import eu.wdaqua.qanary.component.repositories.KG2KGTranslateAnnotationsOfInstanceRepository; +import eu.wdaqua.qanary.exceptions.SparqlQueryFailed; +import org.apache.jena.query.Dataset; +import org.apache.jena.query.DatasetFactory; +import org.apache.jena.query.ResultSet; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdfconnection.RDFConnection; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import org.springframework.util.StringUtils; + +import java.io.IOException; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.any; + +@ExtendWith(SpringExtension.class) +@SpringBootTest(classes = Application.class) +public class KG2KGTranslateAnnotationsOfInstanceTest { + + private final String DBPEDIA_TO_WIKIDATA_QUERY = "/queries/dbpediaToWikidata.rq"; + private final String WIKIDATA_TO_DBPEDIA_QUERY = "/queries/wikidataToDbpedia.rq"; + private final Logger logger = LoggerFactory.getLogger(KG2KGTranslateAnnotationsOfInstance.class); + private final TestDataProvider testDataProvider = new TestDataProvider(); + private final String graphID = "someTestGraphID"; + @Autowired + private KG2KGTranslateAnnotationsOfInstance kg2KGTranslateAnnotationsOfInstance; + @Autowired + private KG2KGTranslateAnnotationsOfInstanceRepository kg2KGTranslateAnnotationsOfInstanceRepository; + + @Nested + class Step1Tests { + + RDFConnection rdfConnection; + private ResultSet resultSet; + private String executableQuery; + + @BeforeEach + public void setup() { + Dataset dataset = testDataProvider.getDataset(); + rdfConnection = RDFConnection.connect(dataset); + } + + } + + /** + * Unit testing for step 2 methods + */ + @Nested + class Step2Tests { + + private final String originResourceDbpedia = "http://dbpedia.org/resource/Leipzig"; + private final String originResourceWikidata = "http://www.wikidata.org/entity/Q2079"; + private final String[] wikidataResources = { + "http://www.wikidata.org/entity/Q3677461", + "http://www.wikidata.org/entity/Q113624612", + "http://www.wikidata.org/entity/Q2079" + }; + + @BeforeEach + public void setup() { + Dataset dataset = testDataProvider.getDataset(); + kg2KGTranslateAnnotationsOfInstanceRepository.setRdfConnection(dataset); + } + + // Querying on an empty dataset results in exception + @Test + public void getEquivalentResourceTestRuntimeException() { + + Dataset dataset = DatasetFactory.create(); + kg2KGTranslateAnnotationsOfInstanceRepository.setRdfConnection(dataset); + + assertThrows(RuntimeException.class, + () -> kg2KGTranslateAnnotationsOfInstance.getEquivalentResource(DBPEDIA_TO_WIKIDATA_QUERY, originResourceDbpedia)); + + } + + /** + * Querying on a test-dataset involving the RDF data of the Leipzig resource + * wikidataResources pre-defined are compared to the computed resources + */ + @Test + public void getEquivalentResourceTest() throws IOException { + + List rdfNodes = kg2KGTranslateAnnotationsOfInstance.getEquivalentResource(DBPEDIA_TO_WIKIDATA_QUERY, originResourceDbpedia); + logger.info("Test getEquivalentResourceTest, computed rdf nodes: {}", rdfNodes.toString()); + + assertEquals(rdfNodes.size(), 3); + assertAll("Wikidata resources correct", () -> { + assertEquals(wikidataResources[0], rdfNodes.get(0).toString()); + assertEquals(wikidataResources[1], rdfNodes.get(1).toString()); + assertEquals(wikidataResources[2], rdfNodes.get(2).toString()); + }); + } + + @Test + public void getEquivalentResourceTestWikidataResource() throws IOException { + + List rdfNodes = kg2KGTranslateAnnotationsOfInstance.getEquivalentResource(WIKIDATA_TO_DBPEDIA_QUERY, originResourceWikidata); + logger.info("Test getEquivalentResourceTest, computed rdf nodes: {}", rdfNodes.toString()); + + assertEquals(rdfNodes.size(), 1); + assertEquals(originResourceDbpedia, rdfNodes.get(0).toString()); + } + + /** + * Here, a resource without an equivalent resource should return null since it catches the thrown Runtime Exception + */ + @Test + public void computeEquivalentResourceTest() throws IOException { + + List rdfNodes = kg2KGTranslateAnnotationsOfInstance.computeEquivalentResource("originResource"); + assertNull(rdfNodes); + } + + @Test + public void computeEquivalentResourcesTest() throws IOException { + // Data without set newResource value + List annotationOfInstancePojoList = testDataProvider.getAnnotationOfInstanceMissingNewResourcePojoList(); + List newList = kg2KGTranslateAnnotationsOfInstance.computeEquivalentResources(annotationOfInstancePojoList); + + logger.info("Test computeEquivalentResourcesTest, pre-defined list: {} \n computed list: {}", annotationOfInstancePojoList.toString(), newList.toString()); + // The dataset is about Leipzig and the List contains 3 annotation objects where only one annotation includes Leipzig as a originResource + assertEquals(1, newList.size()); + } + + @Test + public void getResourceRequestQueryTest() throws IOException { + String resourceRequestQuery = kg2KGTranslateAnnotationsOfInstance.getResourceRequestQuery(DBPEDIA_TO_WIKIDATA_QUERY, originResourceDbpedia); + String insertedResource = "<" + originResourceDbpedia + ">" + "owl:sameAs?resource"; + + logger.info("Test getResourceRequestQueryTest, insertedResource: {}", insertedResource); + + assertTrue(StringUtils.trimAllWhitespace(resourceRequestQuery).contains(insertedResource)); + } + + + } + + @Nested + class Step3Tests { + + @Mock + private QanaryTripleStoreConnector qanaryTripleStoreConnector; + + @BeforeEach + public void setup() throws SparqlQueryFailed { + Mockito.doNothing().when(qanaryTripleStoreConnector).update(any()); + } + + @Test + public void updateTriplestoreTest() throws IOException, SparqlQueryFailed { + List list = testDataProvider.getAnnotationOfInstanceCompletePojoList(); + kg2KGTranslateAnnotationsOfInstance.updateTriplestore(list, graphID, qanaryTripleStoreConnector); + + Mockito.verify(this.qanaryTripleStoreConnector, Mockito.times(5)).update(any()); + } + + } + +} diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/java/eu/wdaqua/qanary/component/TestDataProvider.java b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/java/eu/wdaqua/qanary/component/TestDataProvider.java new file mode 100644 index 000000000..3b6b1b9c0 --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/java/eu/wdaqua/qanary/component/TestDataProvider.java @@ -0,0 +1,63 @@ +package eu.wdaqua.qanary.component; + +import eu.wdaqua.qanary.component.pojos.AnnotationOfInstancePojo; +import org.apache.jena.query.Dataset; +import org.apache.jena.rdf.model.ResourceFactory; +import org.apache.jena.riot.RDFDataMgr; + +import java.util.ArrayList; +import java.util.List; + +public class TestDataProvider { + + private Dataset dataset; + private List annotationOfInstanceCompletePojoList; + private List annotationOfInstanceMissingNewResourcePojoList; + + public TestDataProvider() { + initializeDataset(); + initializePojoLists(); + } + + public Dataset getDataset() { + return dataset; + } + + private void initializePojoLists() { + this.annotationOfInstanceMissingNewResourcePojoList = new ArrayList<>(); + AnnotationOfInstancePojo obj1 = new AnnotationOfInstancePojo("annoID1", "http://dbpedia.org/resource/Leipzig", "targetQuestion1", 1, 2, 0.5d); + AnnotationOfInstancePojo obj2 = new AnnotationOfInstancePojo("annoID2", "http://dbpedia.org/resource/Hulk", "targetQuestion2", 3, 4, 0.6d); + AnnotationOfInstancePojo obj3 = new AnnotationOfInstancePojo("annoID3", "http://dbpedia.org/resource/Batman", "targetQuestion3", 5, 6, 0.7d); + this.annotationOfInstanceMissingNewResourcePojoList.add(obj1); + this.annotationOfInstanceMissingNewResourcePojoList.add(obj2); + this.annotationOfInstanceMissingNewResourcePojoList.add(obj3); + this.initializeCompletePojoList(); + } + + private void initializeCompletePojoList() { + this.annotationOfInstanceCompletePojoList = this.annotationOfInstanceMissingNewResourcePojoList; + annotationOfInstanceCompletePojoList.get(0).setNewResources(new ArrayList<>() {{ + add(ResourceFactory.createResource("http://wikidata.org/entity/Q2079")); + add(ResourceFactory.createResource("http://wikidata.org/entity/Q3677461")); + add(ResourceFactory.createResource("http://wikidata.org/entity/Q113624612")); + }}); + annotationOfInstanceCompletePojoList.get(1).setNewResources(new ArrayList<>() {{ + add(ResourceFactory.createResource("http://www.wikidata.org/entity/Q188760")); + }}); + annotationOfInstanceCompletePojoList.get(2).setNewResources(new ArrayList<>() {{ + add(ResourceFactory.createResource("http://www.wikidata.org/entity/Q2695156")); + }}); + } + + public List getAnnotationOfInstanceMissingNewResourcePojoList() { + return annotationOfInstanceMissingNewResourcePojoList; + } + + public List getAnnotationOfInstanceCompletePojoList() { + return annotationOfInstanceCompletePojoList; + } + + private void initializeDataset() { + this.dataset = RDFDataMgr.loadDataset("testDataset.rdf"); + } +} diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/resources/queries/dbpediaToWikidata.rq b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/resources/queries/dbpediaToWikidata.rq new file mode 100644 index 000000000..e9d5166ba --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/resources/queries/dbpediaToWikidata.rq @@ -0,0 +1,6 @@ +PREFIX owl: +SELECT ?resource +WHERE { + ?originResource owl:sameAs ?resource . + FILTER (STRSTARTS(STR(?resource), "http://www.wikidata.org")) +} \ No newline at end of file diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/resources/queries/wikidataToDbpedia.rq b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/resources/queries/wikidataToDbpedia.rq new file mode 100644 index 000000000..f0b115039 --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/resources/queries/wikidataToDbpedia.rq @@ -0,0 +1,6 @@ +PREFIX owl: +SELECT ?resource +WHERE { + ?resource owl:sameAs ?originResource . + FILTER (STRSTARTS(STR(?resource), "http://dbpedia.org")) +} \ No newline at end of file diff --git a/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/resources/testDataset.rdf b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/resources/testDataset.rdf new file mode 100644 index 000000000..d5710426a --- /dev/null +++ b/qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/test/resources/testDataset.rdf @@ -0,0 +1,5592 @@ + + + + 라이프치히(독일어: Leipzig, 소르브어: Lipsk, 문화어: 라이프찌히)는 독일 작센 주의 가장 큰 도시이다. 라이프치히의 인구는 제2차 세계 대전 전에 750,000명으로 역사상 정점을 지나 2002년 현재는 약 50만 명이다. 통일 이후 BMW와 포르쉐가 라이프치히에 공장을 신설하면서 자동차 공업이 성하고 있다. 2013년 국제기능올림픽대회를 개최하였다. + + + + 14 + + + + + 17955 + + + 124.5 + Leipzig (/ˈlaɪpsɪɡ, -sɪx/ LYPE-sig, -⁠sikh, German: [ˈlaɪptsɪç]; Upper Saxon: Leibz'sch) is the most populous city in the German state of Saxony. Leipzig's population of 605,407 inhabitants (1.1 million in the larger urban zone) as of 2021 places the city as Germany's eighth most populous, as well as the second most populous city in the area of the former East Germany after (East) Berlin. Together with Halle (Saale), the city forms the polycentric Leipzig-Halle Conurbation. Between the two cities (in Schkeuditz) lies Leipzig/Halle Airport. + Yes + + + + + + + + 3.6 + + Lipsia + + + + + 160.9 + + + + + + 9.8 + + + + + + + + + Leipzig ([ˈlaɪ̯pt͡sɪç]; im sächsischen Dialekt auch Leibzsch [ˈlaɪ̯bt͡sʃ]) ist eine kreisfreie Stadt sowie mit 601.866 Einwohnern (31. Dezember 2021) die einwohnerreichste Stadt im Freistaat Sachsen. Sie belegte 2021 in der Liste der Großstädte in Deutschland den achten Rang. Für Mitteldeutschland ist sie ein historisches Zentrum der Wirtschaft, des Handels und Verkehrs, der Verwaltung, Kultur und Bildung sowie gegenwärtig ein Zentrum für die „Kreativszene“. + + + + + + + 51.1 + + + + + 280 + Λειψία + + + + Lipsk (niem. Leipzig; górnołuż. Lipsk; cz. Lipsko; łac. Lipsia) – miasto na prawach powiatu, najliczniejszy ośrodek Saksonii i drugi po Berlinie we wschodniej części Niemiec. Miasto należy do , która liczy w przybliżeniu milion mieszkańców. Pod koniec 2019 roku, z liczbą mieszkańców wynoszącą ponad 590 tys., Lipsk zajmował ósme miejsce w Niemczech pod względem liczby ludności. Położony jest nad Białą Elsterą. Lipsk to duży ośrodek przemysłowy, jedno z ważniejszych centrów handlu (Targi Lipskie), ośrodek kultury i nauki z kilkusetletnią tradycją. Najmniej zniszczone w czasie II wojny światowej spośród wielkich metropolii niemieckich posiada najlepiej w całym kraju zachowany zespół dzielnic XIX- i XX-wiecznych. + + + + + + + + + + + + + + + urban + + + + + (?·pàg.) (IPA: [ˈlaɪpt͡siç]) és una ciutat de Saxònia (Alemanya). Amb més de 570.000 habitants és la ciutat més gran de l'estat. El seu antic ajuntament és un dels edificis més destacats del Renaixement alemany, i allotja un dels museus històrics més grans d'Alemanya. + + + + + Lipsia (AFI: /ˈlipsja/; in tedesco: Leipzig, , AFI: /ˈlaɪ̯pt͡sɪç/; in alto sassone: Leibz'sch; in sorabo: Lipsk) è una città extracircondariale della Sassonia, in Germania. Con i suoi 605.407 abitanti (al 31 dicembre 2020) è la città più popolosa della Sassonia e l'ottava dell'intera Germania. Importante centro economico della Germania, Lipsia è ritenuta tra le città con la più alta qualità della vita secondo uno studio condotto da . Dal punto di vista dei trasporti la città si conferma come lo snodo principale della S-Bahn della Germania Centrale ed è servita dall'aeroporto di Lipsia-Halle. + + + + + 04001–04357 + Is cathair é Leipsic (Gearmáinis: Leipzig) san Ghearmáin. Tá breis is 560.472 daoine ina gcónaí ann. Is é an chathair is mó i An tSacsain. + + + + + + + + + + + + + + 1.8 + Leipzig [ˈlaiptsɪç] (Polandia; Sorbia/Lusatia: Lipsk dan Ceko: Lipsko) adalah kota terbesar di negara bagian (Bundesland) Sachsen di Jerman. Nama ini diambil dari sebuah bahasa Slavia, kemungkinan besar bahasa Sorbia: Lipsk (= "pemukiman di mana ada pohon-pohon tilia"). Kota ini terletak di mana sungai , dan mengalir menjadi satu. Jumlah penduduk Leipzig ada pada puncaknya pada sebelum Perang Dunia II; dengan jumlah 750.000 jiwa. Pada tahun 2002 jumlahnya kurang dari 500.000 jiwa. Leipzig terletak sekitar 160 km (100 mil) barat daya Berlin di Teluk Leipzig, yang merupakan bagian paling selatan Dataran Jerman Utara, di pertemuan Sungai Elster Putih (deretan: → Elbe→ Laut Utara) dan dua dari anak-anak sungainya: Pleiße dan Parthe. Banyak nama-nama kota dan wilayahnya berasal dari bahasa Slavia. + + + + + + + 63.1 + + Is cathair é Leipsic (Gearmáinis: Leipzig) san Ghearmáin. Tá breis is 560.472 daoine ina gcónaí ann. Is é an chathair is mó i An tSacsain. + Mädler Passage, one of 24 covered passages in Leipzig city centre + + + 16.5 + + + + + + + + + + + 2020-08-03 + + + + + + + + + 0.5 + + + + + + + + Leipzig + + 77.8 + + + + + + + 13.6 + + + 4.7 + + + + + + + + + + + 297.36 + + + Coat of arms of Leipzig.svg + + + + + + + + + 8.9 + + + + + 1001220 + Lipsk + 24.1 + + + + + 15.9 + + + + + + + + + 31.9 + + + + + 38.8 + + + + + + + + + 13.8 + + + + + + + + + + + + + + + + + 4.1 + + + 4.7 + ライプツィヒ + + 229 + لايبزيغ أو لِبسِيا أو لَيْبِسِك (لَيبتسِك، Leipzig بالألمانية وتلفظ ‎['laɪ̯ptsɪç]‏) هي ثاني أكبر مدن ولاية ساكسونيا في شرق ألمانيا. تم منح ليبسك صفة مدينة في عام 1165. ولقد تعدى سكان المدينة عام 1870 حاجز المائة ألف نسمة، وحصلت حينها على صفة مدينة كبيرة. يبلغ عدد سكان المدينة اليوم حوالي نصف مليون نسمة. ليبسك هي مقر دائرة تحمل نفس الاسم، إحدى تقسيمات ساكسونيا الست الإدارية.وتقع ليبسك على بعد 150 كيلومترًا جنوب برلين. تشتهر المدينة بكثرة المعارض المنظمة فيها. تعد إلى جانب فرانكفورت مركز تجاري ومركز لطباعة الكتب مهم على مدى التاريخ. بها أحد أقدم الجامعات الألمانية والعديد من الكليات والمعاهد العليا. ليبسك هي مركز لمنطقة ليبسك-هاله الصناعية وتعد أحد أهم المناطق الصناعية والتجارية في شرق ألمانيا. لعبت ليبسك دورًا مهمًا في سقوط الشيوعية في أوروبا الشرقية من خلال الأحداث التي حدثت حول كنيسة سانت نيكولاس. في عام 2010 صنفت ليبسك كواحدة من أكثر 70 مدينة صالحة للعيش في العالم، وصنفتها نيويورك تايمز كواحدة من 10 مدن ينصح بزيارتها. + + + + + + 12.375 + + 213.1 + 3.2 + + + + 36.6 + 31 + + + + + + + + + + Η Λειψία (γερμανικά: Leipzig, προφέρεται: [ˈlaɪ̯pt͡sɪç], Λάιπτσιχ) είναι η μεγαλύτερη πόλη του ομόσπονδου κράτους της Σαξονίας στη Γερμανία, γνωστή και για την ομώνυμη Μάχη της Λειψίας. Το όνομα προέρχεται από την σλάβικη λέξη Λιπσκ (Lipsk, οικισμός με φλαμουριές). Ο πληθυσμός της Λειψίας, που ανερχόταν σε περίπου 750.000 πριν τον Β' Παγκόσμιο Πόλεμο, σήμερα έχει ελαττωθεί σε 601.668 κατοίκους (2019). + + + + + + + 341 + + + + + + + + + + + + + 11.5 + 51.34 + + + 5.7 + + + 54.8 + -16.6 + + + + + + + + + + + 39.6 + 19 + + 150 + + 39.8 + + + 2020 + + + + + 31.9 + 297360000.0 + + -2.6 + + + + + + + + Leipzig (AFI: [ˈlaɪ̯pt͡sɪç]; ouça), ou em sua forma portuguesa Lípsia, é uma cidade independente (em alemão: kreisfreie Stadt) do estado da Saxónia na Alemanha, sede da região administrativa homónima. Localiza-se no leste do país. Com mais de 600 mil habitantes, é a maior cidade da Saxónia. É parte do , a região metropolitana que também inclui Halle e Dresden. Tem origem num antigo povoado eslavo de Lipsk. + Η Λειψία (γερμανικά: Leipzig, προφέρεται: [ˈlaɪ̯pt͡sɪç], Λάιπτσιχ) είναι η μεγαλύτερη πόλη του ομόσπονδου κράτους της Σαξονίας στη Γερμανία, γνωστή και για την ομώνυμη Μάχη της Λειψίας. Το όνομα προέρχεται από την σλάβικη λέξη Λιπσκ (Lipsk, οικισμός με φλαμουριές). Ο πληθυσμός της Λειψίας, που ανερχόταν σε περίπου 750.000 πριν τον Β' Παγκόσμιο Πόλεμο, σήμερα έχει ελαττωθεί σε 601.668 κατοίκους (2019). + + + + + + + Leipzig + + + + + 13.9 + 18.6 + + + + + + Yes + 140088 + + + + + + + 13.67 + Leipzig + + + + 8.7 + + + + -1.2 + Oberbürgermeister + 21.7 + + -27.6 + + + POINT(12.375 51.340000152588) + + + + + + + + + + 28.2 + + + + + + + + + + Lipsk (niem. Leipzig; górnołuż. Lipsk; cz. Lipsko; łac. Lipsia) – miasto na prawach powiatu, najliczniejszy ośrodek Saksonii i drugi po Berlinie we wschodniej części Niemiec. Miasto należy do , która liczy w przybliżeniu milion mieszkańców. Pod koniec 2019 roku, z liczbą mieszkańców wynoszącą ponad 590 tys., Lipsk zajmował ósme miejsce w Niemczech pod względem liczby ludności. Położony jest nad Białą Elsterą. + SPD + + + + + + + + + + + + + + + + Oberbürgermeister + + 29.5 + + + + + + + + + 14713000 + + ライプツィヒ(ドイツ語: )は、ザクセン州に属するドイツの都市である。人口は約60万人。ザクセン州では州都ドレスデンをやや上回って最大の都市で、旧東ドイツ地域ではベルリンに次いで2番目である。日本語ではライプチヒとも表記される(参照)。南部ドイツ語ではライプツィクと発音されることもある。バッハやメンデルスゾーンそしてヴァーグナーらゆかりのドイツを代表する音楽の街、またベルリンの壁崩壊、ひいては東西両ドイツの統一の端緒となった住民運動の発祥地として知られる。 + + + + + + + + + + Leipzig är en kretsfri stad och den största staden i den tyska delstaten Sachsen 190 kilometer söder om Berlin.Leipzig är ett av Sachsens sex Oberzentren. Staden bildar tillsammans med grannstaden Halle an der Saale i Sachsen-Anhalt centrum i , dit även de närbelägna större städerna Chemnitz, Zwickau, Dessau-Rosslau, Jena och Gera officiellt räknas. Leipzig är en viktig infrastrukturknutpunkt och ett av de viktigaste näringslivscentrumen i mellersta Tyskland och f.d. Östtyskland. + + + Leipzig [LAJPciŝ] (esperantigite Lepsiko, Lejpcigo kaj Lajpcigo) estas eksterdistrikta urbo en Germanio. Ĝi troviĝas en la federacia lando Saksio kaj estas administra centro de samnoma distriktaro. La urbo estiĝis en la jaro 1015 el slava setlejo kun la nomo Lipsk (= loko de tilio). Ekde 1165 ĝi ekhavis urborajtojn. La urbo situas borde de la rivero Blanka Elster. + + + + + 9.45 + -21.6 + + 51.34 12.375 + + + + + + + + Mädlerpassage Figurenpruppen Auerbachs Keller Leipzig 052-cvh.jpg + + (?·pàg.) (IPA: [ˈlaɪpt͡siç]) és una ciutat de Saxònia (Alemanya). Amb més de 570.000 habitants és la ciutat més gran de l'estat. El seu antic ajuntament és un dels edificis més destacats del Renaixement alemany, i allotja un dels museus històrics més grans d'Alemanya. + + + + + + Leipzig + + + + + + 2012-07-08 + + + + + 라이프치히(독일어: Leipzig, 소르브어: Lipsk, 문화어: 라이프찌히)는 독일 작센 주의 가장 큰 도시이다. 라이프치히의 인구는 제2차 세계 대전 전에 750,000명으로 역사상 정점을 지나 2002년 현재는 약 50만 명이다. 통일 이후 BMW와 포르쉐가 라이프치히에 공장을 신설하면서 자동차 공업이 성하고 있다. 2013년 국제기능올림픽대회를 개최하였다. + + + + ライプツィヒ(ドイツ語: )は、ザクセン州に属するドイツの都市である。人口は約60万人。ザクセン州では州都ドレスデンをやや上回って最大の都市で、旧東ドイツ地域ではベルリンに次いで2番目である。日本語ではライプチヒとも表記される(参照)。南部ドイツ語ではライプツィクと発音されることもある。バッハやメンデルスゾーンそしてヴァーグナーらゆかりのドイツを代表する音楽の街、またベルリンの壁崩壊、ひいては東西両ドイツの統一の端緒となった住民運動の発祥地として知られる。 + Palais Roßbach, one of the many Gründerzeit buildings in Leipzig + + + + + + + 26.3 + + 1.1 + + 1737.3 + Data derived from Deutscher Wetterdienst, note + + + + Leipzig (/ˈlaɪpsɪɡ, -sɪx/ LYPE-sig, -⁠sikh, German: [ˈlaɪptsɪç]; Upper Saxon: Leibz'sch) is the most populous city in the German state of Saxony. Leipzig's population of 605,407 inhabitants (1.1 million in the larger urban zone) as of 2021 places the city as Germany's eighth most populous, as well as the second most populous city in the area of the former East Germany after (East) Berlin. Together with Halle (Saale), the city forms the polycentric Leipzig-Halle Conurbation. Between the two cities (in Schkeuditz) lies Leipzig/Halle Airport. Leipzig is located about 160 km (100 mi) southwest of Berlin, in the southernmost part of the North German Plain (known as Leipzig Bay), at the confluence of the White Elster River (progression: Saale→ Elbe→ North Sea) and two of its tributaries: the Pleiße and the Parthe. The name of the city and those of many of its boroughs are of Slavic origin. Leipzig has been a trade city since at least the time of the Holy Roman Empire. The city sits at the intersection of the Via Regia and the Via Imperii, two important medieval trade routes. Leipzig's trade fair dates back to 1190. Between 1764 and 1945, the city was a center of publishing. After the Second World War and during the period of the German Democratic Republic (East Germany) Leipzig remained a major urban centre in East Germany, but its cultural and economic importance declined. Events in Leipzig in 1989 played a significant role in precipitating the fall of communism in Central and Eastern Europe, mainly through demonstrations starting from St. Nicholas Church. The immediate effects of the reunification of Germany included the collapse of the local economy (which had come to depend on highly polluting heavy industry), severe unemployment, and urban blight. Starting around 2000, however, the decline was first arrested, then reversed, and since then Leipzig has seen many significant changes, including the restoration of major historical buildings, the demolition of derelict properties, and the development of new industries and a modern transport infrastructure. Leipzig is home to one of the oldest universities in Europe (Leipzig University). It is also one of two seats of the German National Library, as well as the seat of the German Federal Administrative Court. Leipzig was rated as the most livable city in Germany in 2013 by the GfK marketing research institution. Leipzig Zoo is one of the most modern zoos in Europe and ranks first in Germany (2013) and second in Europe (2015). Since Leipzig City Tunnel came into operation in 2013, Leipzig forms the centrepiece of the S-Bahn Mitteldeutschland public transit system. Leipzig was in 2020 listed as a "Sufficiency" level global city by the Globalization and World Cities Research Network, Germany's "Boomtown" and was the 2019 Academy of Urbanism European City of the Year. Leipzig has long been a major centre for music, including classical and modern dark wave. The Thomanerchor (English: St. Thomas Choir of Leipzig), a boys' choir, was founded in 1212. The Leipzig Gewandhaus Orchestra, established in 1743, is one of the oldest symphony orchestras in the world. Johann Sebastian Bach and Felix Mendelssohn Bartholdy are two of several well-known composers who lived and worked in Leipzig. The University of Music and Theatre "Felix Mendelssohn Bartholdy" was founded in 1843. The Oper Leipzig, one of the most prominent opera houses in Germany, was founded in 1868. During a stay in Gohlis, which is now part of the city, Friedrich Schiller wrote his poem "Ode to Joy". + + + + + + + + Leipzig (/lajp.sik/ ou /lajp.siʃ/ ; en allemand : /ˈlaɪp.t͡sɪç/ ) est une ville-arrondissement d'Allemagne centrale, au nord-ouest du Land de Saxe. Avec plus de 605 407 habitants (les Lipsiens), elle est la ville la plus peuplée d'Allemagne de l'Est après Berlin, et la dixième ville du pays. + + + + + + 2 + -2 + + + + + + + 莱比锡(德語:Leipzig,索布语:Lipzk)是德国薩克森自由邦第一大城市,前德意志民主共和国(東德)第一大城市。位于薩克森自由邦中心。它的古称是Lipsia或Lipzk,来源于斯拉夫语Липа,意思是“酸橙树”或“椴树”。歌德称它为“小巴黎”。 + L + + + + + Leipzig is een kreisfreie Stadt in Duitsland gelegen aan de Pleiße. De stad telt 597.493 inwoners (31 december 2020) op een oppervlakte van 297,36 km². Het is na Berlijn de grootste stad van de nieuwe Duitse deelstaten (de voormalige DDR) en de 8e stad van het huidige Duitsland. Van 1949 tot 1990 maakte Leipzig deel uit van het communistische Oost-Duitsland. + Leipzig is een kreisfreie Stadt in Duitsland gelegen aan de Pleiße. De stad telt 597.493 inwoners (31 december 2020) op een oppervlakte van 297,36 km². Het is na Berlijn de grootste stad van de nieuwe Duitse deelstaten (de voormalige DDR) en de 8e stad van het huidige Duitsland. Van 1949 tot 1990 maakte Leipzig deel uit van het communistische Oost-Duitsland. + + + City + + + + Leipzig + + + Ле́йпциг (нім. Leipzig, МФА: [ˈlaɪptsɪç]), зрідка Липськ (в-луж. і н-луж. Lipsk, пол. Lipsk; від слов'янського липа) — місто в Німеччині, найбільше місто Саксонії. Населення — 597 493 осіб (31 грудня 2020), площа — 297,60 км². Лейпциг відомий своїм університетом і ярмарками, завдяки яким місто одержало неофіційну назву Messestadt («місто ярмарків»). Особливо відомий другий за значенням після Франкфуртського Лейпцизький книжковий ярмарок, що проходить у кінці березня. У Ляйпцизькому книжковому ярмарку щороку беруть участь українські видавці та письменники. + + + + green + + + + + + + + + -6.5 + + + Leipzig är en kretsfri stad och den största staden i den tyska delstaten Sachsen 190 kilometer söder om Berlin.Leipzig är ett av Sachsens sex Oberzentren. Staden bildar tillsammans med grannstaden Halle an der Saale i Sachsen-Anhalt centrum i , dit även de närbelägna större städerna Chemnitz, Zwickau, Dessau-Rosslau, Jena och Gera officiellt räknas. Leipzig är en viktig infrastrukturknutpunkt och ett av de viktigaste näringslivscentrumen i mellersta Tyskland och f.d. Östtyskland. Leipzig fick stadsrättigheter och marknadsprivilegier 1165 och blev tidigt ett viktigt handelscentrum. Leipzigs tradition som betydande stad för mässor i Centraleuropa går tillbaka till 1190. Vid sidan av Frankfurt am Main är staden ett historiskt centrum för bokhandeln och boktryckande. Leipzigs universitet grundades 1409 och är ett av Tysklands äldsta universitet, och staden har även Tysklands äldsta högskolor för handel och musik. Leipzig har en stor musikalisk tradition med namn som Johann Sebastian Bach och Felix Mendelssohn Bartholdy samt Richard Wagner. + 1.3 + + + + + + + + + + + 4001 + + + 534.1 + + + + + 23 + Leipzig [ˈlaiptsɪç] (Polandia; Sorbia/Lusatia: Lipsk dan Ceko: Lipsko) adalah kota terbesar di negara bagian (Bundesland) Sachsen di Jerman. Nama ini diambil dari sebuah bahasa Slavia, kemungkinan besar bahasa Sorbia: Lipsk (= "pemukiman di mana ada pohon-pohon tilia"). Kota ini terletak di mana sungai , dan mengalir menjadi satu. Jumlah penduduk Leipzig ada pada puncaknya pada sebelum Perang Dunia II; dengan jumlah 750.000 jiwa. Pada tahun 2002 jumlahnya kurang dari 500.000 jiwa. + Leipzig (AFI: [ˈlaɪ̯pt͡sɪç]; ouça), ou em sua forma portuguesa Lípsia, é uma cidade independente (em alemão: kreisfreie Stadt) do estado da Saxónia na Alemanha, sede da região administrativa homónima. Localiza-se no leste do país. Com mais de 600 mil habitantes, é a maior cidade da Saxónia. É parte do , a região metropolitana que também inclui Halle e Dresden. Tem origem num antigo povoado eslavo de Lipsk. + + + + + + 5.47 + + Leipzig + + + + + + + + Sachsen + + + + Ле́йпциг (нем. Leipzig, МФА (нем.): [ˈlaɪptsɪç] , лат. Lipsia, в.-луж. Lipsk) — город в Германии, расположенный на западе федеральной земли Саксония. По численности населения (более 595 000 человек) Лейпциг является крупнейшим городом Саксонии и восьмым — в Германии, а также одним из наиболее быстро растущих крупных городов страны. Известный своим университетом и ярмарками, Лейпциг представляет собой экономический, культурный, научный и транспортный центр Средней Германии. Совместно с расположенным в 32 км западнее Галле в земле Саксония-Анхальт Лейпциг образует городскую агломерацию с численностью населения порядка 1,1 млн человек, и является одним из экономически наиболее развитых регионов Восточной Германии. После получения городских и торговых привилегий в 1165 году Лейпциг уже во время немецкого расселения на восток приобрёл статус важного центра торговли в первую очередь благодаря торговле пушниной, угасшей после Второй мировой войны. Кроме того, с периода Позднего Средневековья, особенно с момента основания Лейпцигского университета, город был центром немецкого книгопечатания и книготорговли, сохраняя этот статус вплоть до конца 1940-х годов. Многолетняя деятельность Баха и Мендельсона представляют продолжающуюся до наших дней богатую музыкальную традицию Лейпцига, воплощением которой в наше время служат хор Святого Фомы и Гевандхаус. + + 0.5 + 10.1 + + + + + + + + + + + + + + + + + + + + + + + + Lipsko + Universität Leipzig - Paulinum – Aula und Universitätskirche St. Pauli .JPG + + + + 0341 + L + + + Leipsic + The 153-metre-high City-Hochhaus Leipzig and the Augusteum of the University of Leipzig + + + + Flag of Leipzig.svg + + + + + + + + + 46.9 + + 61.5 + + + + + + -20.2 + + + + + + + + + + + 8.5 + + + + + + + + + + + Lipsia (AFI: /ˈlipsja/; in tedesco: Leipzig, , AFI: /ˈlaɪ̯pt͡sɪç/; in alto sassone: Leibz'sch; in sorabo: Lipsk) è una città extracircondariale della Sassonia, in Germania. Con i suoi 605.407 abitanti (al 31 dicembre 2020) è la città più popolosa della Sassonia e l'ottava dell'intera Germania. Grande polo commerciale nel Sacro Romano Impero, in quanto posta all'intersezione della via Regia con la via Imperii, la città divenne durante il Medioevo un importante centro culturale sia con la fondazione della sua Università, nel 1409, che con la fondazione della Thomasschule, considerata tra le più antiche scuole tedesche. In età contemporanea Lipsia fu al centro della battaglia delle Nazioni del 1813, che vide una delle più grandi disfatte di Napoleone Bonaparte durante le guerre napoleoniche. Colpita duramente dalla seconda guerra mondiale la città non perse la sua importanza nella Germania dell'Est, divenendo teatro delle manifestazioni del lunedì, un movimento di protesta che negli anni portò alla caduta del muro di Berlino e alla riunificazione tedesca. Importante centro economico della Germania, Lipsia è ritenuta tra le città con la più alta qualità della vita secondo uno studio condotto da . Dal punto di vista dei trasporti la città si conferma come lo snodo principale della S-Bahn della Germania Centrale ed è servita dall'aeroporto di Lipsia-Halle. La città ospita una delle tre sedi della Biblioteca nazionale tedesca oltre che il tribunale della Corte amministrativa federale, la corte suprema tedesca in materia di giustizia amministrativa. + + + + Leipzig + + + right + + 297.36 + + + + 莱比锡(德語:Leipzig,索布语:Lipzk)是德国薩克森自由邦第一大城市,前德意志民主共和国(東德)第一大城市。位于薩克森自由邦中心。它的古称是Lipsia或Lipzk,来源于斯拉夫语Липа,意思是“酸橙树”或“椴树”。歌德称它为“小巴黎”。 + + + Lipsko (německy ) je město s postavením samostatného městského okresu na severozápadě německé spolkové země Sasko. Žije zde přibližně 609 tisíc obyvatel a je tak největší saské město a desáté největší město v Německu. Nově zrekonstruovaný Pomník Bitvy národů v roce 2013Stará radniceNová radniceNejvyšší správní soudKostel Sv. Tomáše (Thomaskirche)Kostel Sv. Mikuláše (Nikolaikirche) + + + + 18.6 + + + + + + + + + + + + + + + + + + + لايبزيغ + + + + + + + + 37.2 + + 227.4 + + + + + Leipzig Alemaniako ekialdean dagien Saxonia estatu federaleko hiririk handiena da, 522.883 biztanle zituen 2010ean. Alemania osoko zortzigarren hiririk populatuena da. Leipzig ezaguna da bere unibertsitate eta azokarengatik. Alemaniako lehendabiziko sindikatua Leipzigen sortu zen. + + Leipzig (pronunciación en alemán: /ˈlaɪptsɪç/) o Lipsia, en castellano arcaico, es una ciudad alemana en el noreste del estado de Sajonia, con 590 337 habitantes en diciembre de 2017. Ya en el año 1165 recibió el derecho de ciudad y de mercado. La ciudad tiene una larga tradición de recinto ferial y una de las ferias más antiguas (1190) de Europa. Junto con Fráncfort del Meno, Leipzig es el centro histórico de la imprenta y el comercio. Además, cuenta con una de las universidades —tanto clásica como de música— más antiguas de Alemania. La ciudad fue uno de los centros de las manifestaciones de los lunes (Montagsdemonstrationen) de 1989, las cuales dieron el impulso necesario a la reunificación alemana.​ En 1813, Leipzig fue testigo de la primera derrota de Napoleón I en la llamada "batalla de las Naciones", en cuyo recuerdo se levantó en 1911 el Völkerschlachtdenkmal, con una plataforma de 91 m de altura que ofrece una vista panorámica. También en Leipzig se celebraron las oraciones por la paz, punto de partida de la revolución pacífica de 1989 que condujo a la reunificación alemana. Los rezos de los lunes, que luego se convirtieron en manifestaciones pacíficas, abrieron la puerta a la revolución de la RDA.​ La ciudad ha sido cuna de numerosas personalidades, tales como el filósofo y científico Gottfried Wilhelm Leibniz (1646), el compositor Richard Wagner (1813), el historiador de arte Nikolaus Pevsner (1902), el tipógrafo Jan Tschichold (1902), el pintor Max Beckmann o el comunista Karl Liebknecht (1871). Otras personalidades trabajaron durante parte de su vida en la ciudad, tales como los compositores Johann Sebastian Bach, que murió en ella en 1750, y Felix Mendelssohn Bartholdy, el filósofo Friedrich Nietzsche, el premio Nobel de Física Werner Heisenberg o el constructor de automóviles August Horch; el filósofo español José Ortega y Gasset estudió en esta ciudad, donde tuvo su primer encuentro «cara a cara» con la Crítica de la Razón Pura.​ + + + + 265 + + + + + + + 24.5 + 181.7 + + + 14.4 + 185 + 122.9 + 1001220 + + + + + + 1.1 + + 18.7 + + + + + + + + + + + 2021-03-02 + + + + + Ле́йпциг (нем. Leipzig, МФА (нем.): [ˈlaɪptsɪç] , лат. Lipsia, в.-луж. Lipsk) — город в Германии, расположенный на западе федеральной земли Саксония. По численности населения (более 595 000 человек) Лейпциг является крупнейшим городом Саксонии и восьмым — в Германии, а также одним из наиболее быстро растущих крупных городов страны. Известный своим университетом и ярмарками, Лейпциг представляет собой экономический, культурный, научный и транспортный центр Средней Германии. Совместно с расположенным в 32 км западнее Галле в земле Саксония-Анхальт Лейпциг образует городскую агломерацию с численностью населения порядка 1,1 млн человек, и является одним из экономически наиболее развитых регионов Восточной Германии. + Leipzig Palais Roßbach.jpg + -12.9 + Leipzig + + 6.2 + Leipzig Alemaniako ekialdean dagien Saxonia estatu federaleko hiririk handiena da, 522.883 biztanle zituen 2010ean. Alemania osoko zortzigarren hiririk populatuena da. Leipzig ezaguna da bere unibertsitate eta azokarengatik. Alemaniako lehendabiziko sindikatua Leipzigen sortu zen. + + + + 16.5 + + + + + + + + + + + + 68.9 + + + Лейпциг + + + 62.8 + + + Leipzig + Ле́йпциг (нім. Leipzig, МФА: [ˈlaɪptsɪç]), зрідка Липськ (в-луж. і н-луж. Lipsk, пол. Lipsk; від слов'янського липа) — місто в Німеччині, найбільше місто Саксонії. Населення — 597 493 осіб (31 грудня 2020), площа — 297,60 км². Лейпциг відомий своїм університетом і ярмарками, завдяки яким місто одержало неофіційну назву Messestadt («місто ярмарків»). Особливо відомий другий за значенням після Франкфуртського Лейпцизький книжковий ярмарок, що проходить у кінці березня. У Ляйпцизькому книжковому ярмарку щороку беруть участь українські видавці та письмен��ики. Це місто є знаковим в історії світової музики — воно пов'язане з іменами Фелікса Мендельсона, Роберта Шумана, Ріхарда Ваґнера, Едварда Ґріґа, а також Йоганна Себастьяна Баха. Найвизначніша церква міста — Церква святого Томи, де працював кантором Йоганн Себастьян Бах. Поряд з церквою розташований музей Йоганна Себастьяна Баха. У Лейпцизькій консерваторії навчався свого часу класик української національної школи Микола Лисенко. Тут же народився сучасний співак Білл Кауліц та гітарист Том Кауліц. Ляйпціґ має культурні зв'язки з Києвом, а також ще 13 містами різних країн світу. + + + + + + + + + + Лейпциг + 莱比锡 + 4.3 + + + Leipzig (pronunciación en alemán: /ˈlaɪptsɪç/) o Lipsia, en castellano arcaico, es una ciudad alemana en el noreste del estado de Sajonia, con 590 337 habitantes en diciembre de 2017. Ya en el año 1165 recibió el derecho de ciudad y de mercado. + + Leipzig + Federal Administrative Court Leipzig at night 2 .jpg + + -27.6 + + 5.5 + + + + 37.2 + + + + + + + + 49.9 + -2.2 + + + + + + + + + لايبزيغ أو لِبسِيا أو لَيْبِسِك (لَيبتسِك، Leipzig بالألمانية وتلفظ ‎['laɪ̯ptsɪç]‏) هي ثاني أكبر مدن ولاية ساكسونيا في شرق ألمانيا. تم منح ليبسك صفة مدينة في عام 1165. ولقد تعدى سكان المدينة عام 1870 حاجز المائة ألف نسمة، وحصلت حينها على صفة مدينة كبيرة. يبلغ عدد سكان المدينة اليوم حوالي نصف مليون نسمة. ليبسك هي مقر دائرة تحمل نفس الاسم، إحدى تقسيمات ساكسونيا الست الإدارية.وتقع ليبسك على بعد 150 كيلومترًا جنوب برلين. لعبت ليبسك دورًا مهمًا في سقوط الشيوعية في أوروبا الشرقية من خلال الأحداث التي حدثت حول كنيسة سانت نيكولاس. + + + + + + + 32.9 + 1123180875 + Leipzig (/lajp.sik/ ou /lajp.siʃ/ ; en allemand : /ˈlaɪp.t͡sɪç/ ) est une ville-arrondissement d'Allemagne centrale, au nord-ouest du Land de Saxe. Avec plus de 605 407 habitants (les Lipsiens), elle est la ville la plus peuplée d'Allemagne de l'Est après Berlin, et la dixième ville du pays. + + + 라이프치히 + + Lipsko (německy ) je město s postavením samostatného městského okresu na severozápadě německé spolkové země Sasko. Žije zde přibližně 609 tisíc obyvatel a je tak největší saské město a desáté největší město v Německu. Nově zrekonstruovaný Pomník Bitvy národů v roce 2013Stará radniceNová radniceNejvyšší správní soudKostel Sv. Tomáše (Thomaskirche)Kostel Sv. Mikuláše (Nikolaikirche) + + + 13.8 + + + + + + + + + 34.8 + + + 224.8 + + Leipzig + + + + Leipzig/Halle, Germany for 1981–2010, temperature records for 1973–2013, sunshine hours for 1991 to 2013 + + + + + 19.3 + 7.6 + 19 + + + + + Leipzig + 43.4 + + -6.7 + Leipzig [LAJPciŝ] (esperantigite Lepsiko, Lejpcigo kaj Lajpcigo) estas eksterdistrikta urbo en Germanio. Ĝi troviĝas en la federacia lando Saksio kaj estas administra centro de samnoma distriktaro. La urbo estiĝis en la jaro 1015 el slava setlejo kun la nomo Lipsk (= loko de tilio). Ekde 1165 ĝi ekhavis urborajtojn. La urbo situas borde de la rivero Blanka Elster. + Leipzig ([ˈlaɪ̯pt͡sɪç]; im sächsischen Dialekt auch Leibzsch [ˈlaɪ̯bt͡sʃ]) ist eine kreisfreie Stadt sowie mit 601.866 Einwohnern (31. Dezember 2021) die einwohnerreichste Stadt im Freistaat Sachsen. Sie belegte 2021 in der Liste der Großstädte in Deutschland den achten Rang. Für Mitteldeutschland ist sie ein historisches Zentrum der Wirtschaft, des Handels und Verkehrs, der Verwaltung, Kultur und Bildung sowie gegenwärtig ein Zentrum für die „Kreativszene“. Leipzig ist eines der sechs Oberzentren Sachsens und bildet mit der rund 35 Kilometer entfernten Großstadt Halle (Saale) im Land Sachsen-Anhalt den länderübergreifenden Ballungsraum Leipzig-Halle, in dem etwa 1,1 Millionen Menschen leben. Mit Halle und weiteren Städten in den Ländern Sachsen, Sachsen-Anhalt und Thüringen ist Leipzig Teil der polyzentralen Metropolregion Mitteldeutschland. Nach Verleihung des Stadtrechts und der Marktprivilegien um das Jahr 1165 entwickelte sich Leipzig bereits während der deutschen Ostsiedlung zu einem wichtigen Handelszentrum. Leipzigs Tradition als bedeutender Messestandort in Mitteleuropa mit einer der ältesten Messen der Welt geht auf das Jahr 1190 zurück und war eng mit der langjährigen Rolle Leipzigs als internationales Zentrum des Pelzhandels verknüpft. In der Zeit des Nationalsozialismus trug Leipzig von 1937 bis 1945 offiziell den Stadt-Ehrentitel Reichsmessestadt. Die Stadt ist ein historisches Zentrum des Buchdrucks und -handels. Außerdem befinden sich in Leipzig eine der ältesten Universitäten sowie die ältesten Hochschulen sowohl für Handel als auch für Musik in Deutschland. Leipzig verfügt über eine große musikalische Tradition, die vor allem auf das Wirken von Johann Sebastian Bach und Felix Mendelssohn Bartholdy zurückgeht und sich unter anderem auf die Bedeutung des Gewandhausorchesters und des Thomanerchors stützt. Im Zuge der Montagsdemonstrationen 1989, die einen entscheidenden Impuls für die Wende in der Deutschen Demokratischen Republik (DDR) gaben, wurde Leipzig als Heldenstadt bezeichnet. Die informelle Auszeichnung für den so mutigen wie friedlichen Einsatz vieler Leipziger Bürger im Umfeld der Leipziger Nikolaikirche prägte den Ruf der Stadt nach der Wende und wird bei der Stadtvermarktung unter dem Motto „Leipziger Freiheit“ aufgegriffen. Darüber hinaus ist Leipzig für seinen Reichtum an aufwändig sanierten bzw. rekonstruierten Kulturdenkmalen und städtischen Kanälen, den artenreichen Zoo sowie das durch Rekultivierung ehemaliger Braunkohletagebaue entstehende Leipziger Neuseenland und den Bundesliga-Verein RB Leipzig bekannt. In Leipzig haben das Bundesverwaltungsgericht, der Fünfte und Sechste Strafsenat des Bundesgerichtshofes sowie seit dem 1. Oktober 2018 das Fernstraßen-Bundesamt, welches ab 1. Januar 2021 seine Tätigkeit aufnahm, ihren Sitz. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Leipzig + DBpedia + http://dbpedia.org/resource/Leipzig + + http://commons.wikimedia.org/wiki/Special:FilePath/Flag_of_Leipzig.svg?width=300 + article + Leipzig (/ˈlaɪpsɪɡ, -sɪx/ LYPE-sig, -⁠sikh, German: [ˈlaɪptsɪç]; Upper Saxon: Leibz'sch) is the most populous city in the German state of Saxony. Leipzig's population of 605,407 inhabitants (1.1 million in the larger urban zone) as of 2021 places the city as Germany's eighth most populous, as well as the second most populous city in the area of the former East Germany after (East) Berlin. Together with Halle (Saale), the city forms the polycentric Leipzig-Halle Conurbation. Between the two cities (in Schkeuditz) lies Leipzig/Halle Airport. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/service_config/files/kg2kg-translateannotationsofinstance b/service_config/files/kg2kg-translateannotationsofinstance new file mode 100644 index 000000000..82c905628 --- /dev/null +++ b/service_config/files/kg2kg-translateannotationsofinstance @@ -0,0 +1,4 @@ +SERVER_HOST=http://demos.swe.htwk-leipzig.de +SERVER_PORT=40159 +SPRING_BOOT_ADMIN_URL=http://demos.swe.htwk-leipzig.de:40111/ +SPRING_BOOT_ADMIN_CLIENT_INSTANCE_SERVICE-BASE-URL=http://demos.swe.htwk-leipzig.de:40159 \ No newline at end of file diff --git a/service_config/service_config.json b/service_config/service_config.json index 2a688e8be..b9d10a8e6 100644 --- a/service_config/service_config.json +++ b/service_config/service_config.json @@ -125,7 +125,17 @@ "files": { ".env": "qb-dateofdeathdbpedia" } + }, + { + "mode": "dockerfile", + "port": "40159:40159", + "image": "qanary/qanary-component-kg2kg-translateannotationsofinstance", + "tag": "latest", + "files": { + ".env": "kg2kg-translateannotationsofinstance" + } } + ], "ids": { "0": "qanary-qanary-component-ld-shuyo", @@ -141,6 +151,7 @@ "10": "qanary-qanary-component-qe-sparqlexecuter", "11": "qanary-qanary-component-qe-wikidata", "12": "qanary-qanary-component-tqa-chatgptwrapper", - "13": "qanary-qanary-component-qb-dateofdeathdpbedia" + "13": "qanary-qanary-component-qb-dateofdeathdpbedia", + "14": "qanary-qanary-component-kg2kg-translateannotationsofinstance" } } \ No newline at end of file