Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ImportError: libodbc.so.2: cannot open shared object file: No such file or directory #2

Open
Wu-tn opened this issue Sep 11, 2024 · 11 comments

Comments

@Wu-tn
Copy link

Wu-tn commented Sep 11, 2024

Running atomic_pattern_retrieval/biencoder/biencoder_inference.py
import pyodbc
ImportError: libodbc.so.2: cannot open shared object file: No such file or directory
I already install unixodbc and still found this wrong , have you ever met the problem?

@Wu-tn
Copy link
Author

Wu-tn commented Sep 11, 2024

I install pyodbc=4.0.34 and found that the question was solved , but still found another question that how to set DSN for pyodbc

@advAdder
Copy link
Collaborator

Sorry for the late response.

Have you tried to install packages according to requirements.txt?
DSN is in https://github.com/nju-websoft/EPR-KGQA/blob/master/my_utils/freebase.py#L61

@Wu-tn
Copy link
Author

Wu-tn commented Sep 25, 2024

感谢你的回复,上面的问题我已经解决了,但是现在有另外两个问题想问一下:
1.请问你们使用的KB是Freebase-setup中提供的virtuoso.db还是下载freebase-latest-rdf呢?
2.在按照readme.md复现代码时发现在subgraph_extraction阶段获取的数据如下:
image
通过源码发现在函数td_gen()中,topk_eps = get_instantiable_topk(eps, topk)获取的topk_eps为空,原因为函数
def is_instantiable(ep: str) -> bool:
# query = f""" SPARQL
# SELECT ?j
# WHERE {{{ep}}}
# LIMIT 1
# """
query = f""" SPARQL
SELECT ?j
WHERE {{{ep}}}
LIMIT 1000
"""
return FreebaseODBC.has_query_results(query)
返回的均为false,请问你们遇到过这种情况吗?
以下是我按照步骤获取的CWQ_dev_top100_ap_ranked_ep.json
image

@advAdder
Copy link
Collaborator

advAdder commented Sep 27, 2024

因为项目维护人员都已经从NJU毕业了,没法帮你直接复现,我凭记忆说一下:

  1. 我们用的是Freebase官方直接dump的数据,setup提供的是virtuoso的教程,也可以参考其他virtuoso教程,我们应该没有用复杂的SPARQL特性,所以能部署的常见virtuoso版本应该都没问题。
  2. 可以验证一下你的KB里面是不是有完整数据。至少这个case里,我感觉后面的简单查询都查不到应该是KB里面内容不对。

@Wu-tn
Copy link
Author

Wu-tn commented Sep 27, 2024

好的,我一开始使用https://github.com/dki-lab/Freebase-Setup?tab=readme-ov-file中提供的OneDrive链接下载virtuoso.db后出现以上subgraph_extraction为空的情况,后续换用freebase-rdf-latest.gz后使用Freebase-setup连接出现there is a wrong that The VDBMS server process terminated prematurely after opening the database.以下是virtuoso.log的报错信息
image。请问你们有遇到这种情况吗

@advAdder
Copy link
Collaborator

advAdder commented Sep 29, 2024

没遇到过,你freebase是怎么导入virtuoso的?
virtuoso的官方文档是:https://vos.openlinksw.com/owiki/wiki/VOS/VirtBulkRDFLoader

@Wu-tn
Copy link
Author

Wu-tn commented Sep 29, 2024

我是按照https://github.com/dki-lab/Freebase-Setup 中将freebase-rdf-latest放在virtuoso_db文件夹中,然后运行
python3 virtuoso.py start 3001 -d virtuoso_db

@advAdder
Copy link
Collaborator

advAdder commented Sep 30, 2024

freebase官网提供的dump是个特定格式的文本文件,不是数据库文件
virtuoso是传统Semantic Web/Knowledge Graph用的比较多的一个数据库,支持这种格式的导入

@Wu-tn
Copy link
Author

Wu-tn commented Oct 6, 2024

所以使用freebase-latest-rdf导入virtuoso是没问题的吗,但是我出现了上述开启服务失败的问题。在使用Freebase-setup提供的数据库文件virtuoso.db时,运行myutils/freebase.py的main函数是没问题的,如下:
image
但是运行subgrapg_extraction却出现上述topk_ep为空的情况,请问你能提供数据库文件吗?

@Wu-tn
Copy link
Author

Wu-tn commented Oct 21, 2024

或者说你们使用的是图中wget提供的数据库文件吗?
image

@advAdder
Copy link
Collaborator

advAdder commented Oct 22, 2024

我们用的是Freebase官方直接dump的数据

https://developers.google.com/freebase 试试这里的官方数据,按照virtuoso的正常导入方法,建立一个完整的数据库

你可以试一下在virtuoso后台的isql或者web端的sparql接口手动输入subgraph extraction中出现的查询,验证是否数据库内容本身有问题

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants