Skip to content
/ t2wml Public
forked from usc-isi-i2/t2wml

Table to Wikidata Mapping Language

License

Notifications You must be signed in to change notification settings

devowit/t2wml

 
 

Repository files navigation

T2WML: A Cell-Based Language To Map Tables Into Wikidata Records

Installation

Operating system:macOS / OS X, Linux, Windows
Python version:Python 3.6+
  1. Clone the repository
  2. Open terminal/cmd in the project directory and type the following commands:
    pip install -r requirements.txt
    python -m spacy download en_core_web_sm
    python application.py
  3. Server is up and running at http://localhost:5000/

Usage Within Code

from driver import run_t2wml
run_t2wml(data_file_path,  wikified_output_path, t2wml_spec, output_directory, sheet_name, sparql_endpoint)

Arguments:

Mandatory Arguments:
    data_file_path: string
    wikified_output_path: string 
    t2wml_spec: string
    output_directory: string 
Optional Arguments:
    sheet_name: string
    sparql_endpoint: string

Default Values:

    sparql_endpoint = "https://dsbox02.isi.edu:8888/bigdata/namespace/wdq/sparql"

Edit in /app_config.py

Output:

The function will create a directory structure in the output directory which will have the results.ttl and changes.tsv files.

Output Directory Structure:

output_directory/
├── excel_file_name/
│   └── sheet_name/
|       ├── results.ttl
|       └── changes.tsv
└── csv_file_name/
    ├── results.ttl
    └── changes.tsv

Usage with GUI

  1. Open the GUI
  2. In Table Viewer,
    1. click Upload to open a table file (.csv/.xls/.xlsx)
  3. In Wikifier,
    1. define and wikify the regions you need [demo], and/or
    2. click Upload to open a wikifier file (.csv)
    3. correct mismatched qnode if necessary [demo]
  4. In YAML Editor,
    1. type/paste in T2WML code, or
    2. click Upload to open a YAML file (.yaml)
    3. click Apply to highlight some regions in Table Viewer
  5. In Output,
    1. preview result by clicking cell in Table Viewer [demo], or
    2. click Download to get all results

Features

Note: All screenshots below are captured in GUI v1.3. Minor inconsistencies may appear.

⬇️ Wikify region t2wml-gui-demo

⬇️ Modify qnode t2wml-gui-demo

⬇️ Preview result t2wml-gui-demo

FAQs

  • Installation failed due to etk?

    Run the following commands in terminal/cmd:

    pip uninstall etk
    pip install https://github.com/usc-isi-i2/etk/archive/development.zip
    
  • Login failed or encountered an authentication error like 400 (OAuth2 Error)?

    Access T2WML at http://localhost:5000/ instead of http://127.0.0.1:5000.

  • Encountered any other error not mentioned in the FAQs?

    Post the issue in the T2WML repository along with a detailed description.

About

Table to Wikidata Mapping Language

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 41.7%
  • Python 31.1%
  • CSS 22.9%
  • HTML 4.2%
  • Shell 0.1%