TENET is a python library for automatically constructing logical representations (OWL ontology) from textual documents. Its development is based on the W3C Semantic Web standards (RDF, OWL, SPARQL). It requires, as input, a set of pivot structures representing the document to be analysed, and gives as output a set of RDF-OWL triples forming an ontology, composed of classes, properties, instances and logical relations between these elements.
TENET is a python library to construct logical representations (OWL ontology) from textual documents. Its development is based on the W3C Semantic Web standards (RDF, OWL, SPARQL). It requires, as input, a set of pivot structures representing the document to be analysed, and gives as output a set of RDF-OWL triples forming an ontology, composed of classes, properties, instances and logical relations between these elements.
This library is currently under development, and therefore in unstable state. Structures supported as input are AMR graphs (in AMR Linked Data Turtle format) or UNL graphs (in UNL-RDF Turtle format).
## 1 - Environment Setup
## 1 - Environment Setup
The python code has been tested under Python 3.7 and Linux Manjaro, but should be run on most common systems (Linux, Windows, Mac).
The python code has been tested under Python 3.7 and Linux Manjaro, but should be run on most common systems (Linux, Windows, Mac).
All dependencies are listed in **requirements.txt**. These dependencies are used for external modules.
All dependencies are listed in **requirements.txt**.
The **test** directory contains evaluation files with some test corpus.
The **test** directory contains evaluation files with test corpus, and script showing usage examples.
## 2 - Library Usage
## 2 - Library Usage for AMR Graphs
The script **test_tenet_main.py** (test directory) gives an example of using the library.
The script **test_tenet_main.py** (test directory) gives an example of using the library.
Two main methods are proposed to create an ontology from a file in amrlib format, or from a directory containing several files. These two methods take as parameters the path of the file or directory to be processed, and also some optional parameters.
Two main methods are proposed to create an ontology from a file in amrlib format (AMR Linked Data Turtle format), or from a directory containing several amrlib files. These two methods take as parameters the path of the file or directory to be processed, and also some optional parameters.
The following code can be used to create an ontology from an AMR-Lib file:
The following code can be used to create an ontology from an AMR-Lib file:
For more details on these methods, see the code in **tenet/main.py**.
## 3 - Content
TODO
## 3 - Library Usage for AMR Graphs
The addition of core methods for supporting UNL graphs is also planned. While waiting for the development of these methods, it is possible to analyze UNL graphs by positioning on an old version (label 0.2.1), or by adapting the existing scripts.
The library groups several packages in the tenet subdirectory. The main methods are defined in the main module (**main.py**). The **extract.py** file has also been developed for command line use (**>> python3 extract.py --source_corpus <input-data>**). The configuration of the library can be adapted by modifying the logging.conf file.