-
Notifications
You must be signed in to change notification settings - Fork 16.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
langchain.graph RDFGraph does not read OWL #8263
Comments
Answer generated by a 🤖 AnswerI understand that you're encountering an issue with the From your description, it seems that the issue lies in the Here's the part of the code that appears to be causing the problem: elif self.standard == "owl":
clss = self.query(cls_query_owl)
ops = self.query(cls_query_owl) # This should be op_query_owl
dps = self.query(cls_query_owl) # This should be dp_query_owl
... To address this issue, you could modify the code as follows: elif self.standard == "owl":
clss = self.query(cls_query_owl)
ops = self.query(op_query_owl) # Corrected
dps = self.query(dp_query_owl) # Corrected
... This modification should resolve the issue by using the correct queries ( Please note that this is a potential solution based on the information provided. If this solution works for you and you believe it's a bug that could impact other users, I encourage you to make a pull request with this change. If this solution doesn't align with your experience or if the issue persists after trying this solution, I recommend checking if you're using the latest version of LangChain, as the issue might have been addressed in a more recent update. SourcesThis response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. |
Replace this comment with: - Description: Fix "missing key op" error in RDFGraph OWL Serialization - Issue: #8263 - Dependencies: None - Tag maintainer: @baskaryan
Fixed and merged. Thanks all! |
Replace this comment with: - Description: Fix "missing key op" error in RDFGraph OWL Serialization - Issue: #8263 - Dependencies: None - Tag maintainer: @baskaryan
System Info
langchain verion: 0.0.237
python version: 3.11.4
Who can help?
@hwchase17
When loading an OWL graph in the following code, an exception occurs that says: "Exception has occurred: KeyError 'op'". It appears that RFGraph class is having trouble with the owl standard specifically.
I found this issue when using RDFGraph within the GraphSparqlQAChain class
Thank you very much for your help.
Information
Related Components
Reproduction
Steps to reproduce:
Expected behavior
For the graph to load and for graph.get_schema to produce the classes (Pizza and Topping) and object property (hasTopping) in the class.
The text was updated successfully, but these errors were encountered: