Giter Site home page Giter Site logo

Add datetime parser about t2wml HOT 2 CLOSED

GreatYYX avatar GreatYYX commented on August 13, 2024
Add datetime parser

from t2wml.

Comments (2)

bhatiadivij avatar bhatiadivij commented on August 13, 2024

I integrated the etk.wikidata.utils.parse_datetime_string function but it turns out that it doesn't work on some data files.

Debugging Steps Performed:

  1. Debugged the variables being passed in realtime.
  2. I tried interchanging data file formats but it didn't help.

To reproduce the same issue perform the following steps:

  1. Checkout branch feature/datetime_parser
  2. Run T2WML server and visit http://localhost:5000
  3. Try downloading the .ttl using the files attached.
  4. The error occurs here:
    datetime_string, precision = parse_datetime_string(temp_dict["value"], additional_formats=[temp_dict["format"]])

    Files.zip

from t2wml.

szeke avatar szeke commented on August 13, 2024

The YAML file should be:

statementMapping:
  region:
    - left: D
      right: BJ
      top: 5
      bottom: 270
  template:
    item: item(A/$row)
    property: item(D/$row)
    value: value($col/$row)
    # unit: item(H/$row)
    qualifier:
      - property: P585
        value: value($col/5)
        format: "%Y"
        calendar: Q1985727
        precision: year
        time_zone: 0
      - property: P248 # stated in
        value: Q21540096 # World Bank database
      - property: P275 # license
        value: Q20007257 # Creative Commons Attribution 4.0 International

After adding the format attribute the TTL generation works fine.

However, if there is no format keyword, it fails silently, no output and no error message.

from t2wml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.