The AmbiverseNLU Knowledge Graph web service allows you to search and query the YAGO Knowledge Graph (imported to Neo4j), providing you with detailed information for all canonical entities and the categories that are assigned to them (e.g. person, organization, location, etc.). The Knowledge Graph Service is particularly suited to be run as a second step after ambiguous names that occur in natural language texts have been matched onto canonical entities by the AmbiverseNLU service.
Try the complete demo at http://ambiversenlu.mpi-inf.mpg.de
Starting the AmbiverseNLU KG as web service (with Neo4j backend) using Docker is simple, using docker-compose:
docker-compose -f docker-compose/service-kg.yml up
or with docker stack:
docker stack deploy -c docker-compose/service-kg.yml ambiverse-kg
Wait for some time (depending on your internet connection and CPU speed it can easily take more than an hour), then call the service:
curl -X POST -H "Content-Type: application/json" \
-d '[
"http://www.wikidata.org/entity/Q1137062",
"http://www.wikidata.org/entity/Q1359568"
]' \
"http://localhost:8080/knowledgegraph/entities"
Start the Neo4j database backend with the fully multilingual knowledge graph:
docker run -d --restart=always --name kg-db-neo4j \
-p 7474:7474 -p 7687:7687 \
-e NEO4J_dbms_active__database=yago_aida_en20180120_cs20180120_de20180120_es20180120_ru20180120_zh20180120.db \
-e NEO4J_dbms_memory_pagecache_size=8G \
-e NEO4J_dbms_memory_heap_initial__size=8G \
-e NEO4J_dbms_memory_heap_max__size=12G \
-e NEO4J_dbms_connectors_default__listen__address=0.0.0.0 \
-e NEO4J_dbms_security_procedures_unrestricted=apoc.* \
-e NEO4J_AUTH=neo4j/neo4j_pass \
-e DUMP_NAME=yago_aida_en20180120_cs20180120_de20180120_es20180120_ru20180120_zh20180120 \
--ulimit=nofile=40000:40000 \
ambiverse/kg-db-neo4j
Then start the AmbiverseNLU Knowledge Graph container by linking the running Neo4j container.
docker run -d --restart=always --name ambiverse-kg \
-p 8080:8080 \
--link kg-db-neo4j:kg-db \
ambiverse/ambiverse-kg
- Adapt the database configuration. You need to adapt the
neo4j.properties
file insrc/main/resources/default/
by providing theneo4j.url
,neo4j.user
and `neo4j.password. - Start the web service by executing the following script:
./scripts/start_webservice.sh
You can the MAVEN_OPTS
in the script if you want to change the port and the available memory.
The service has build in swagger-ui that opens up if you type http://localhost:8080/
in your browser. The swagger-ui
loads the configuration from v2/knowledgegraph/openapi.json
which is automatically created from the swagger annotations.
If you have trouble starting the swagger-ui
try to package the code with mvn package
before you do jetty:run
.
The database dumps can be downloaded from http://ambiversenlu-download.mpi-inf.mpg.de/. The database docker images will download them automatically.
- AmbiverseNLU project website: http://www.mpi-inf.mpg.de/ambiverse-nlu/
Current Maintainers (in alphabetical order):
- Ghazale Haratinezhad Torbati
- Johannes Hoffart
Contributors (in alphabetical order):
- Daniel Bär
- Dragan Milchevski (former maintainer)
- Ghazale Haratinezhad Torbati
- Johannes Hoffart
- Luciano Del Corro