配置Apache Jena RDF推理器

时间:2015-10-12 15:16:36

标签: sparql jena

我正在尝试为Apache Jena设置推理器。 但我无法让它发挥作用。

当我对skos提出skos:broader概念时,我无法通过skos:narrower

搜索结果来查询该概念

目前我的config.ttl看起来如下所示。 我是否需要在配置中加载skos的架构才能使其正常工作?

## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0

@prefix :        <#> .
@prefix fuseki:  <http://jena.apache.org/fuseki#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .

## ---------------------------------------------------------------
## Service with only SPARQL query on an inference model.
## Inference model base data is in TDB.

<#service2>  rdf:type fuseki:Service ;
    rdfs:label               "skos" ;
    fuseki:name              "skos" ;             
    fuseki:serviceQuery      "sparql" ;          # SPARQL query service
    fuseki:serviceUpdate     "update" ;
    fuseki:dataset           <#dataset> ;
    .

<#dataset> rdf:type       ja:RDFDataset ;
    ja:defaultGraph       <#model_inf> ;
     .

<#model_inf> a ja:InfModel ;
     ja:baseModel <#tdbGraph> ;
     ja:reasoner [
         ja:reasonerURL <http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner>
     ] .

## Base data in TDB.
<#tdbDataset> rdf:type tdb:DatasetTDB ;
    tdb:location "run/databases/skos" ;
    # If the unionDefaultGraph is used, then the "update" service should be removed.
    # tdb:unionDefaultGraph true ;
    .

<#tdbGraph> rdf:type tdb:GraphTDB ;
    tdb:dataset <#tdbDataset> .

我的数据看起来像这样。 我希望example.com/1的{​​{1}}为example.com/2,因为它是narrower的倒数。

broader

0 个答案:

没有答案