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&apos;anUniversity -->

    <owl:NamedIndividual rdf:about="http://www.semanticweb.org/bob/ontologies/2021/7/organization#Chang&apos;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
在这里插入图片描述

  • 3
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值