首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >是否可以从OWLIM中查询推断出的爱因斯坦谜语知识?

是否可以从OWLIM中查询推断出的爱因斯坦谜语知识?
EN

Stack Overflow用户
提问于 2015-03-31 12:39:02
回答 1查看 448关注 0票数 2

我有OWLIM存储库,里面填充了爱因斯坦谜语猫头鹰。Link1 - Link2。是否可以使用sparql从OWLIM查询推断的知识?才能得到和单独标签上相同的结果吗?

SPARQL:

代码语言:javascript
复制
PREFIX riddle: <http://www.iis.nsk.su/persons/ponom/ontologies/einsteins_riddle_en.owl#>
SELECT DISTINCT ?kto ?co
WHERE { 
?kto riddle:drinks ?co .
?kto a owl:Thing .
?co a owl:Thing .

Protege和OWLIM具有相同的结果,只有显性知识。

代码语言:javascript
复制
co  kto 
---------------------------------------------
http://www.iis.nsk.su/persons/ponom/ontologies/einsteins_riddle_en.owl#tea  http://www.iis.nsk.su/persons/ponom/ontologies/einsteins_riddle_en.owl#Ukrainian

但是(根据我的信息)在Protege中,SPARQL查询只在现有知识上工作,而OWLIM则使用现有和推断的三元组来构建存储库。所以我也希望能推断出三倍。

P.S.:获取推断三元组计数的查询(OWLIM):

代码语言:javascript
复制
SELECT (COUNT(*) as ?count)
FROM <http://www.ontotext.com/implicit>
WHERE {
   ?s ?p ?o .
}

返回0。

*编辑:*

我的配置:

代码语言:javascript
复制
#
# Sesame configuration template for a owlim repository
#
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix rep: <http://www.openrdf.org/config/repository#>.
@prefix sr: <http://www.openrdf.org/config/repository/sail#>.
@prefix sail: <http://www.openrdf.org/config/sail#>.
@prefix owlim: <http://www.ontotext.com/trree/owlim#>.

[] a rep:Repository ;
   rep:repositoryID "Riddle" ;
   rdfs:label "Einstein Riddle Getting Started" ;
   rep:repositoryImpl [
     rep:repositoryType "openrdf:SailRepository" ;
     sr:sailImpl [
       sail:sailType "owlim:Sail" ; 

       owlim:base-URL "http://www.iis.nsk.su/persons/ponom/ontologies/einsteins_riddle_en.owl#" ;

       # There must be exactly the same number of semicolon separated entries in
       # the defaulNS and imports fields
       owlim:defaultNS "http://www.iis.nsk.su/persons/ponom/ontologies/einsteins_riddle_en.owl#" ;
       owlim:imports "./ontology/zebra.owl" ;

       owlim:entity-index-size "5000000" ;
       owlim:repository-type "file-repository" ;
       owlim:ruleset "owl-max" ;
       owlim:storage-folder "storage" ;

       # OWLIM-SE parameters
       owlim:cache-memory "180m" ; 

       # OWLIM-Lite parameters
       owlim:noPersist "false" ;

       # Other OWLIM-SE parameters
       # owlim:enable-context-index "false" ;
       owlim:check-for-inconsistencies "true" ;
       # owlim:disable-sameAs "false" ;
       owlim:enable-optimization "true" ;
       owlim:enablePredicateList "true" ;
       # owlim:entity-id-size "32" ;                 # 32/40
       # owlim:fts-memory "20m" ;
       # owlim:ftsIndexPolicy "never" ;              # never/onStartup/onShutdown/onCommit
       # owlim:ftsLiteralsOnly "false" ;
       # owlim:in-memory-literal-properties "false" ;
       # owlim:enable-literal-index "true" ;
       # owlim:index-compression-ratio "-1" ;        # -1/10-50
       # owlim:owlim-license "" ;
       # owlim:predicate-memory "80m" ;
       # owlim:query-timeout "-1" ;
       # owlim:tokenization-regex "[\p{L}\d_]+" ;
       # owlim:tuple-index-memory "80m" ;
       # owlim:useShutdownHooks "true" ;
       # owlim:transaction-mode "safe" ;
       # owlim:read-only "false" ;

       # Other OWLIM-Lite parameters
       # owlim:jobsize "1000}" ;
       # owlim:new-triples-file ""

      ]
   ].

不管我是使用owl2-rl还是owl2-ql还是w/e。结果总是一样的。只有推断出的三倍变化为正。

代码语言:javascript
复制
08:51:40 Executing query 'Who drinks What'
co  kto 
---------------------------------------------
einsteins_riddle_en:tea einsteins_riddle_en:Ukrainian   

08:51:40 1 result(s) in 63ms.
08:51:40 Executing query 'Number of inferred triples'
count   
---------------------------------------------
"770"^^<http://www.w3.org/2001/XMLSchema#integer>   

推断出的三元组对我来说是无用的,它们的样本如下:

代码语言:javascript
复制
p   s   o   
---------------------------------------------
rdf:type    rdf:type    rdf:Property    
rdf:type    rdfs:subPropertyOf  rdf:Property    
rdf:type    rdfs:subClassOf rdf:Property    
rdf:type    rdfs:domain rdf:Property    
rdf:type    rdfs:range  rdf:Property    
rdf:type    owl:equivalentClass rdf:Property    
rdf:type    psys:transitiveOver rdf:Property    
...
EN

回答 1

Stack Overflow用户

发布于 2015-04-01 21:27:38

是的,这是可能的,但这取决于如何配置OWLIM存储库。

当您第一次创建存储库时,OWLIM使用的推理规则集被设置为配置参数-请参阅配置文档获取详细信息。显然,如果您已经将它设置为使用一个空规则集,那么它将根本不会进行任何推断。根据您选择的规则集(有几个层次的表达能力),它将能够或多或少地推断出三元组(规则集的表现力越强,所包含的信息就越多)。

如果您的OWLIM存储库配置正确,查询将自动检索推断信息以及显式语句。

当然,这也取决于是否真的有任何可以推断的东西。查询在Protege和OWLIM中提供了相同的结果,这一事实可能仅仅意味着OWLIM确实进行推理,但没有找到任何与查询匹配的推断信息。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29368901

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档