当前位置:网站首页>搭建一个简单的知识问答系统
搭建一个简单的知识问答系统
2022-07-27 16:12:00 【zkkkkkkkkkkkkk】
声明
本博文是在使用开源项目时,根据开源项目作者README.md介绍的流程而编写的,具体源码见如下网址:https://github.com/zhangtao-seu/Jay_KG ,文中部分白话使用了作者README.md上的原话。
目录
1.1、下载apache-jena和apache-jena-fuseki
一、环境准备
1.1、下载apache-jena和apache-jena-fuseki
因为我们的系统是运行在Apache-jena-fuseki的服务上的,所以先下载两个包。网址:Apache Jena - Apache Jena Releases
,选择如下两个,解压到本地文件夹中即可。
1.2、配置环境变量
此步骤配置的是apache-jena的环境变量
JENA_HOME变量配置如下

Path环境变量配置如下

1.3、启动fuseki的web服务
在cmd窗口进入apache-jena-fuseki文件输入命令./fuseki-server.bat或在文件夹下双击fuseki-server.bat文件。运行后可以在 localhost:3030查看web服务。
双击执行命令
cmd执行命令

localhost:3030 查看web服务

二、数据准备
2.1、owl 文件
使用protege可以到处owl文件,软件官方下载连接(需要翻墙):protégé

本次博文直接使用作者git上的owl文件做演示,

2.2、owl转换为nt文件
下载转换所需jar包 RDF2RDF - Converts RDF from any format to any ,把jar包放置到待转换的owl同级目录下。打开cmd执行如下命令: java -jar rdf2rdf-1.0.1-2.3.1.jar xxx.owl xxx.nt
注意:此步骤如果报如下错误则说明jdk版本有问题,切换到1.8就可以了。错误:converting music_graph.owl to music_graph.ntException in thread "main",java.lang.IllegalArgumentException: org.openrdf.rio.RDFParserFactory is not an ImageIO SPI class
jdk下载网址: Archived OpenJDK GA Releases

2.3、RDF文件转换成tdb文件
命令格式为:.\tdbloader.bat --loc="D:\tdb" "D:\music_graph.nt",--loc参数为生成的tdb文件的文件夹,第二个参数是格式为nt的RDF文件。
注意:此时的 D:\tdb 为最终存储的tdb的文件目录。D:\nusic_graph.nt 即是上一步将owl转换为nt的文件目录。
2.4、fuseki_conf.ttl配置文件
在apache-jena-fuseki-3.10.0\run\configuration文件下建立fuseki_conf.ttl文件,本博文做演示直接使用作者的配置文件。该文件主要有两个作用,一个是指定tdb文件的位置,另一个是对生成的数据库进行命名

注意:注意对照fuseki_conf.ttl文件中的目录是不是跟本地一样。根据上一步来看,我们的tdb文件是在D:\tdb文件下的,所以这边的配置文件需要修改下

三、查询结果
进入apache-jena-fuseki执行fuseki-server.bat,打开localhost:3030后应该可以看到如下页面,此时就可以在平台上SPARQL语句查询。

边栏推荐
- 深度学习:GCN(图卷积神经网络)理论学习总结
- [MIT 6.S081] Lab 5: xv6 lazy page allocation
- Intel releases a new generation of movidius Vpu: 10 times higher performance and 30W power consumption
- [MIT 6.S081] Lab 5: xv6 lazy page allocation
- [MIT 6.S081] Lab 4: traps
- [MIT 6.S081] Lab 6: Copy-on-Write Fork for xv6
- uniapp H5跨域问题
- Announcing the acquisition of 30% shares of Wenye, what is the general intention of Dalian United?
- 2. Change color space and color detection
- MySQL学习 Day1 DDL、DML、DQL基础查询
猜你喜欢

Installation and deployment of zabbix6.0

2021.7.31笔记 视图

MySQL学习 Day3 多表查询 / 事务 / DCL

Solve the problem that reids cannot be accessed by other IPS

MySQL学习 Day2 排序查询 / 聚合函数 /分组查询 /分页查询 /约束/多表之间的关系

Deep recognition: thesis reading_ 2s-agcn cvpr2019 (two stream adaptive graph convolution network based on skeleton action recognition)

深度学习:GAN优化方法-DCGAN案例
![[MIT 6.S081] Lec 5: Calling conventions and stack frames RISC-V 笔记](/img/1f/6384f4831718477f0567540250f352.png)
[MIT 6.S081] Lec 5: Calling conventions and stack frames RISC-V 笔记

2021.8.1笔记 DBA
![[MIT 6.S081] Lab 9: file system](/img/f5/ea30b1fe5b6d73c86f2509c690ca20.png)
[MIT 6.S081] Lab 9: file system
随机推荐
2. Change color space and color detection
技术分享| 快对讲综合调度系统
多表查询
[MIT 6.S081] Lec 9: Interrupts 笔记
Wechat applet wxacode.getunlimited generates applet code
Announcing the acquisition of 30% shares of Wenye, what is the general intention of Dalian United?
Random talk on GIS data (V) - geographic coordinate system
被“赶出”比特大陆之后,詹克团首度发声:将通过法律途径尽快回归!
rsa加解密(兼容微信小程序环境)
Intel releases a new generation of movidius Vpu: 10 times higher performance and 30W power consumption
[MIT 6.S081] Lab 4: traps
[MIT 6.S081] Lab 10: mmap
Technology sharing | quick intercom integrated dispatching system
Deep learning: gat
深度学习:GCN案例
Zhanrui fresh seedlings: enable full scene applications, and massive data needs the integration of AI and IOT
[mit 6.s081] LEC 5: calling conventions and stack frames risc-v notes
Solve the problem that reids cannot be accessed by other IPS
MySQL学习 Day2 排序查询 / 聚合函数 /分组查询 /分页查询 /约束/多表之间的关系
[mit 6.s081] LEC 10: multiprocessors and locking notes