jena4.1.0安装及使用
1 jena4.1.0下载安装
jena软件安装包:
https://download.csdn.net/download/weixin_42727550/20817691?spm=1001.2014.3001.5501
https://download.csdn.net/download/weixin_42727550/20817688?spm=1001.2014.3001.5501
1、https://mirrors.tuna.tsinghua.edu.cn/apache/jena/binaries/
下载windows版本的安装包。
系统环境变量配置
JENA_HOME
D:\Program Files\ApacheJena4.1\apache-jena-4.1.0
%JENA_HOME%\bat
2 java11下载安装
jena4依赖于java11.
java11的百度链接:百度网盘下载地址
链接:https://pan.baidu.com/s/1pNg1R5ZhxngX2XnwQ1vDqg
java11环境配置:
3 jena4测试使用
java环境安装成功测试、sparql测试:
在“D:\Program Files\ApacheJena4.1\apache-jena-fuseki-4.1.0”中使用cmd命令生成“run”文件夹
成功后的效果:
4 本体文件作为数据集进行查询展示
1、准备本体文件
2、在jena中上传该文件,建立数据库。
查询后的结果:
<?xml version="1.0"?>
<rdf:RDF xmlns="http://www.semanticweb.org/bob/ontologies/2021/7/organization#"
xml:base="http://www.semanticweb.org/bob/ontologies/2021/7/organization"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<owl:Ontology rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization"/>
<!--
///
//
// Classes
//
///
-->
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#College -->
<owl:Class rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#College">
<rdfs:subClassOf rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#School"/>
</owl:Class>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#Company -->
<owl:Class rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#Company"/>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#ForeignEnterprise -->
<owl:Class rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#ForeignEnterprise">
<rdfs:subClassOf rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#Company"/>
</owl:Class>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#MiddleSchool -->
<owl:Class rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#MiddleSchool">
<rdfs:subClassOf rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#School"/>
</owl:Class>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#School -->
<owl:Class rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#School"/>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#State-ownedEnterprise -->
<owl:Class rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#State-ownedEnterprise">
<rdfs:subClassOf rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#Company"/>
</owl:Class>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#University -->
<owl:Class rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#University">
<rdfs:subClassOf rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#School"/>
</owl:Class>
<!--
///
//
// Individuals
//
///
-->
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#HM -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#HM">
<rdf:type rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#ForeignEnterprise"/>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#HenanUniversityofChineseMedicine -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#HenanUniversityofChineseMedicine">
<rdf:type rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#College"/>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#MassachusettsInstituteofTechnology -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#MassachusettsInstituteofTechnology">
<rdf:type rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#College"/>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#NIKE -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#NIKE">
<rdf:type rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#ForeignEnterprise"/>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#PekingUniversity -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#PekingUniversity">
<rdf:type rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#University"/>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#QQ -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#QQ">
<rdf:type rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#State-ownedEnterprise"/>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#erzhong -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#erzhong">
<rdf:type rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#MiddleSchool"/>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#yizhong -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#yizhong">
<rdf:type rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#MiddleSchool"/>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#361 -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#361">
<rdf:type rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#State-ownedEnterprise"/>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/bob/ontologies/2021/7/organization#Chang'anUniversity -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#Chang'anUniversity">
<rdf:type rdf:resource="http://www.semanticweb.org/bob/ontologies/2021/7/organization#University"/>
</owl:NamedIndividual>
</rdf:RDF>
<!-- Generated by the OWL API (version 4.2.8.20170104-2310) https://github.com/owlcs/owlapi -->
2、数据的备份
备份地址:D:\Program Files\ApacheJena4.1\apache-jena-fuseki-4.1.0\run\backups