Skip to main content

A package to convert CSV files into ontology TTL files and merge them

Project description

🏰 Ontology Project

This package converts CSV files into RDF/OWL ontologies in TTL format and merges them using SBERT-based entity matching.


📌 Project Structure

Your project is structured as follows:

ontology_project/
│-- ontology_project/               # Python package
│   │-- __init__.py                 # Marks as a package
│   │-- Ec3EpdCsv_to_Ec3Epd_onto1.py  # Converts EC3EPD CSV to TTL
│   │-- TruCsv_to_Tru_onto2.py       # Converts TRU CSV to TTL
│   │-- McpCsv_to_Mcp_onto3.py       # Converts MCP CSV to TTL
│   │-- merge_ontology.py            # Merges all TTL files
│   │-- runner.py                    # Automates the pipeline
│
│-- input/                           # CSV input files (Not included in package)
│-- output/                          # Stores generated TTL files (Not included in package)
│-- config.json                      # Stores file paths (Optional)
│-- pyproject.toml                    # Packaging metadata
│-- requirements.txt                  # Dependencies
│-- README.md                         # Documentation
│-- LICENSE                           # License file
│-- .gitignore                        # Ignore unnecessary files

🚀 Installation

🔹 Install from PyPI

After uploading your package to PyPI, install it via:

pip install ontology_project

🔹 Install Locally (Development Mode)

If you want to modify the package, install it locally:

pip install -e .

Usage

Once installed, you can run the following CLI commands:

Command Description
convert_ec3 Converts EC3EPD CSV to TTL
convert_tru Converts TRU CSV to TTL
convert_mcp Converts MCP CSV to TTL
merge_ontologies Merges all TTL files
run_ontology Runs the full pipeline

Example:

convert_ec3
convert_tru
convert_mcp
merge_ontologies
run_ontology

🛠 Building the Package

Step 1: Install Required Tools

pip install build twine

Step 2: Build the Package

python -m build

Step 3: Test Installation

pip install dist/ontology_project-0.1.0-py3-none-any.whl

Step 4: Upload to PyPI

twine upload dist/*

🎯 Configuration

You can modify file paths in config.json:

{
  "input_paths": {
    "ec3epd": "input/ec3epd.csv",
    "tru": "input/tru.csv",
    "mcp": "input/mcp.csv"
  },
  "output_paths": {
    "ec3epd": "output/ec3epd.ttl",
    "tru": "output/tru.ttl",
    "mcp": "output/mcp.ttl",
    "merged": "output/merged_ontology.ttl"
  }
}

🐜 License

This project is licensed under the National Physical Laboratory.


👨‍💻 Contributing

We welcome contributions! Please:

  • Fork the repository on GitHub
  • Create a new branch (feature/new-feature)
  • Submit a pull request

🌍 Resources


🚀 Now try this! This README.md will be displayed correctly in GitHub, PyPI, and Visual Studio Code. 😊 Let me know if you need further improvements!

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

ontology_project-0.1.2.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ontology_project-0.1.2-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file ontology_project-0.1.2.tar.gz.

File metadata

  • Download URL: ontology_project-0.1.2.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for ontology_project-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2c6ebf3ec48ed6ae25b9acee0a329c957cd362b16cb6c26c9efe7a97ee56288d
MD5 86665922025934e7fc39f030b203260e
BLAKE2b-256 956c9ac77acfd57e9306f42330532289ee83cd7ad1517cd64c66850e2d3bafd9

See more details on using hashes here.

File details

Details for the file ontology_project-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ontology_project-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 379745b42936c08b767734eaed83e3cb46cc8f1be235c54ba4a0683cfebab359
MD5 1335e69ca875e5b049d7db053e69b354
BLAKE2b-256 2b70bf608e9db43c83d3ad274eb242b19b96403c239372a88d4b2446f86b4fed

See more details on using hashes here.

Supported by

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