Skip to content

Updating knowledge graph

Introduction

Knowledge graph is updated by either initiating an update from the administration interface, or by scheduling an knowledge graph update. It is not updated when the underlying collection is updated.

Starting a knowledge graph update from the administration interface

To start an update of knowledge graph:

  • Open the administration user interface, navigate to the graph tab and press the update knowledge graph button.
  • Select the profile which is to be updated (either the preview or live view).

The progress of the update can be found in the collection's log folder. Steps to view the logs can be found below:

  • Using the administration user interface, navigate to the administer tab.
  • Select Browse Log Files.
  • Underneath the $COLLECTION / Collection logs files section, click on knowledge_graph.$PROFILE.log to view the Knowledge Graph logs.

The following is an example of the logs:

2018-11-10 21:17:19,193 [main] INFO  integration.Main - Graph statistics before the update
2018-11-10 21:17:19,429 [main] INFO  integration.PrintStatistics - Number of [superhero] nodes: 7
2018-11-10 21:17:19,430 [main] INFO  integration.PrintStatistics - Number of [document] nodes: 6
2018-11-10 21:17:19,432 [main] INFO  integration.PrintStatistics - Number of [movie] nodes: 5
2018-11-10 21:17:19,448 [main] INFO  integration.PrintStatistics - Number of mentions relationships: 19
2018-11-10 21:17:24,157 [main] INFO  integration.Main - Processing of KG on super-heroes-web is complete!
2018-11-10 21:17:24,170 [main] INFO  integration.Main - Graph statistics after the update
2018-11-10 21:17:24,175 [main] INFO  integration.PrintStatistics - Number of [superhero] nodes: 7
2018-11-10 21:17:24,175 [main] INFO  integration.PrintStatistics - Number of [document] nodes: 6
2018-11-10 21:17:24,175 [main] INFO  integration.PrintStatistics - Number of [movie] nodes: 5
2018-11-10 21:17:24,179 [main] INFO  integration.PrintStatistics - Number of mentions relationships: 19

The log files can also be found on the server in the following location:

$SEARCH_HOME/data/$COLLECTION/logs/knowledge_graph.$PROFILE.log

where

  • $SEARCH_HOME - The location where Funnelback is installed
  • $COLLECTION - The ID of the collection
  • $PROFILE - The ID of the profile

Additional debug logging is generated by neo4j and is written to $SEARCH_HOME/log/neo4j/debug.log. Note: access to this log is restricted to users that have backend access to the Funnelback server.

Scheduling automatic updates

Scheduling regular updates can be done by adding a command similar to the following to the server's native task scheduler (e.g. cron or Windows task scheduler):

curl --user $USERNAME:$PASSWORD -X POST --header 'Content-Type: application/json' -d '{ "collection": "$COLLECTION_ID", "profile": "$PROFILE_ID", "profileView": "$PROFILE_VIEW"}' 'https://$FUNNELBACK_SERVER_HOSTNAME:8443/admin-api/task/v1/queue/UPDATE_KNOWLEDGE_GRAPH'

where

  • $USERNAME - the name of an admin user who can run the knowledge graph update

  • $PASSWORD - the password of the admin user above

    Note: You may prefer to instead create an access token which can be separately revoked.

  • $COLLECTION_ID - The collection ID for the knowledge graph collection

  • $PROFILE_ID - The profile ID for which knowledge graph should be updated

  • $PROFILE_VIEW - Either 'live' or 'preview' depending on which profile view should be updated.

Update the knowledge graph when a collection is updated

If you wish for the knowledge graph to be updated as part of a collection update the above curl command can be triggered from the collection's update workflow as a post update command.

top

Funnelback logo
v15.22.0