langchain-rdf
🦉 Utilities to improve LLMs capabilities when working with SPARQL endpoints and RDF knowledge graphs, compatible with LangChain
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: science.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.3%) to scientific vocabulary
Keywords
Repository
🦉 Utilities to improve LLMs capabilities when working with SPARQL endpoints and RDF knowledge graphs, compatible with LangChain
Basic Info
Statistics
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Loaders and utils to work with RDF data using LangChain:
OntologyLoader: load OWL ontology classes and properties in your vectorstoreSparqlExamplesLoader: load SPARQL query examples to your vectorstore. SPARQL queries are retrieved from a SPARQL endpoint where they are stored using the SHACL ontology, with a human readable description.
📦️ Installation
This package requires Python >=3.8, install it from the git repository with:
bash
pip install git+https://github.com/vemonet/langchain-rdf.git
🪄 Usage
[!NOTE]
Refer to LangChain documentation to figure out how to best integrate documents loaders to your stack, or check our complete notebook examples, using only open source components, running locally, with conversation memory:
OWL ontology loader
```python from langchain_rdf import OntologyLoader
loader = OntologyLoader("https://semanticscience.org/ontology/sio.owl", format="xml") documents = loader.load() print(len(documents)) ```
SPARQL query examples
```python from langchain_rdf import SparqlExamplesLoader
loader = SparqlExamplesLoader("https://sparql.uniprot.org/sparql/") documents = loader.load() print(len(documents)) ```
🧑💻 Development setup
The final section of the README is for if you want to run the package in development, and get involved by making a code contribution.
📥️ Clone
Clone the repository:
bash
git clone https://github.com/vemonet/langchain-rdf
cd langchain-rdf
🐣 Install dependencies
Install Hatch, this will automatically handle virtual environments and make sure all dependencies are installed when you run a script in the project:
bash
pipx install hatch
☑️ Run tests
Make sure the existing tests still work by running the test suite and linting checks. Note that any pull requests to the fairworkflows repository on github will automatically trigger running of the test suite;
bash
hatch run test
To display all logs when debugging:
bash
hatch run test -s
♻️ Reset the environment
In case you are facing issues with dependencies not updating properly you can easily reset the virtual environment with:
bash
hatch env prune
Manually trigger installing the dependencies in a local virtual environment:
bash
hatch -v env create
🏷️ New release process
The deployment of new releases is done automatically by a GitHub Action workflow when a new release is created on GitHub. To release a new version:
- Make sure the
PYPI_TOKENsecret has been defined in the GitHub repository (in Settings > Secrets > Actions). You can get an API token from PyPI at pypi.org/manage/account. Increment the
versionnumber in thepyproject.tomlfile in the root folder of the repository.bash hatch version fixCreate a new release on GitHub, which will automatically trigger the publish workflow, and publish the new release to PyPI.
You can also build and publish from your computer:
bash
hatch build
hatch publish
Owner
- Name: Vincent Emonet
- Login: vemonet
- Kind: user
- Location: Maastricht, Netherlands
- Company: @MaastrichtU-IDS
- Website: https://vemonet.github.io
- Repositories: 203
- Profile: https://github.com/vemonet
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- orcid: https://orcid.org/0000-0002-1501-1082
email: vincent.emonet@gmail.com
given-names: Vincent Emonet
# affiliation: Institute of Data Science, Maastricht University
title: "LangChain RDF"
repository-code: https://github.com/vemonet/langchain-rdf
date-released: 2024-01-06
url: https://pypi.org/project/langchain-rdf
# doi: 10.48550/arXiv.2206.13787
GitHub Events
Total
- Watch event: 3
Last Year
- Watch event: 3
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Vincent Emonet | v****t@g****m | 15 |
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: 2 days
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- vemonet (1)