.. _tutorials_entity_graph: Entity Graph ============ Prerequisites -------------- You need to install the following: python library, the license file, the domain you want to run and the test environment (`eot-wowool-test`) which contains a small corpus and some rules Using the sdk entity_graph: .. code-block:: console pip install eot-wowool-sdk eot-wowool-domain-english-entity eot-wowool-apps eot-wowool-topic-identifier eot-wowool-test eot-wowool-community-license neo4j Configuration --------------- See the API :ref:`Entity Graph Configuration ` From text to Graph ------------------ We will use a small corpus with some abstracts of movies. From these abstracts we will extract the titles, characters and weapons and the relations between them. We will then store them in the neo4j database. .. include:: installing_eot_wowool_test.inc Run the driver by passing as arguments the language, the link file (movies.lnk), the domain (rules) and the folder with the corpus (movies). The '-p' option is our pipeline. There you need to pass the domains that you used in your lnk file. .. code-block:: console entity_graph -p english,entity,test/projects/movies/rules,topics.app -x ./test/projects/movies/movies_with_topics.lnk -f ./test/corpus/english/movies The link file (movies.lnk) specifies how the entities will be linked in the neo4j graph: .. code-block:: json { "slots" : [ {"uri": "Title" }, {"label" : "Type", "content" : "{Path(document.id).parts[-2]}" } ], "links" :[ { "from" : { "slot": "Type" }, "to" : { "uri": "Title" }, "relation" : { "label": "genre" } }, { "from" : { "uri": "Character" , "attributes": ["type"] }, "to" : { "slot": "Title" }, "relation" : { "label": "plays_in"} }, { "from" : { "uri": "Weapon" }, "to" : { "slot": "Title" }, "relation" : { "label": "appears" } }, { "from" : { "uri": "Event" }, "to" : { "slot": "Title" }, "relation" : { "label": "event" } }, { "from" : { "uri": "Character" }, "to" : { "uri": "Character", "label": "Victim" }, "relation" : { "uri": "Harm" } } { "from" : { "uri": "Character" }, "to" : { "uri": "PersonMention", "label": "Victim" }, "relation" : { "uri": "Harm" } } ] }