Skip to main content

AMR to RDF translator.

Project description

py_amr2fred

From Abstract Meaning Representation AMR (https://amr.isi.edu/) to RDF, according to the syntax of FRED (http://wit.istc.cnr.it/stlab-tools/fred/)

Python version of amr2fred's core functions

Install:

pip install py_amr2fred

Use:

from py_amr2fred import *
amr2fred = Amr2fred()
mode = Glossary.RdflibMode.N3
amr_text = """
    (c / charge-05 :ARG1 (h / he) :ARG2 (a / and :op1 (i / intoxicate-01 :ARG1 h :location (p / public)) 
    :op2 (r / resist-01 :ARG0 h :ARG1 (a2 / arrest-01 :ARG1 h))))
"""
print(amr2fred.translate(amr_text, serialize=True, mode=mode))

serialize=True returns a string

serialize=False returns a rdflib Graph

Possible formats:

  • Glossary.RdflibMode.TURTLE
  • Glossary.RdflibMode.NT
  • Glossary.RdflibMode.XML
  • Glossary.RdflibMode.N3
  • Glossary.RdflibMode.JSON_LD

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_amr2fred-0.0.6.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

py_amr2fred-0.0.6-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file py_amr2fred-0.0.6.tar.gz.

File metadata

  • Download URL: py_amr2fred-0.0.6.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for py_amr2fred-0.0.6.tar.gz
Algorithm Hash digest
SHA256 6919bebfe5b3a10d525e6af4e7044e052abd8bdb3e060130070e76a62b8290e5
MD5 5688aeb9c87a4d8a191476c2e0d01258
BLAKE2b-256 95cb475947c1feb41de0945969c3209807f6aa4d04a42fae0e758383f4066f1d

See more details on using hashes here.

File details

Details for the file py_amr2fred-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: py_amr2fred-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for py_amr2fred-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 710c706e59f6f9cb9edd68cfbd6fe3a2c62b16bff84b752f339affac779be9fe
MD5 6234c53dbd129d55aabb932252c6406c
BLAKE2b-256 46f7711c5af5d462bc9575489437a1eca5f3db38b60b1bb45cdf1b087a9fe5f4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page