昨天我试图让Pellet和/或Openllet在我的Fuseki服务器上运行。
我正在通过Web界面进行请求。没有理由,一切都会好起来的。
这是我的配置:
@prefix : <http://base/#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
<http://jena.apache.org/2016/tdb#DatasetTDB>
rdfs:subClassOf ja:RDFDataset .
ja:DatasetTxnMem rdfs:subClassOf ja:RDFDataset .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
<http://jena.apache.org/2016/tdb#GraphTDB2>
rdfs:subClassOf ja:Model .
ja:MemoryDataset rdfs:subClassOf ja:RDFDataset .
ja:RDFDatasetZero rdfs:subClassOf ja:RDFDataset .
<http://jena.apache.org/text#TextDataset>
rdfs:subClassOf ja:RDFDataset .
:service_tdb_all a fuseki:Service ;
rdfs:label "TDB FOOT" ;
fuseki:dataset :tdb_dataset_readwrite ;
fuseki:name "FOOT" ;
fuseki:serviceQuery "query" , "" , "sparql" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:serviceReadQuads "" ;
fuseki:serviceReadWriteGraphStore
"data" ;
fuseki:serviceReadWriteQuads "" ;
fuseki:serviceUpdate "" , "update" ;
fuseki:serviceUpload "upload" .
:tdb_dataset_readwrite
a ja:RDFDataset;
ja:defaultGraph <#model_inf> ;
tdb:location "C:\etc\fuseki/databases/FOOT" .
<#model_inf> a ja:InfModel ;
ja:baseModel <#graph> ;
ja:reasoner [
ja:reasonerClass "openllet.jena.PelletReasonerFactory";
] .
<#graph> rdf:type tdb:GraphTDB ;
tdb:dataset :tdb_dataset_readwrite .
Tomcat目录中的错误日志:
ERROR Exception in initialization: the class 'openllet.jena.PelletReasonerFactory' required by the object 7c374328cddba9fa8091dcebd77a7598 [ja:reasoner of file:///C:/etc/fuseki/configuration/FOOT.ttl#model_inf] could not be loaded
我一直在到处复制OpenlletJar文件(Openllet-query-2.6.5.Jar等等(,但没有机会。顺便问一下,这是正确的行动吗?!
在我的ApacheJena项目(和Snarp-Sparql-Protege插件(中,我运行了Openllet,它给我带来了正确的结果。
我有一些规则都是这种类型的
[ rdf:type owl:Class ;
owl:unionOf ( [ owl:intersectionOf ( [ rdf:type owl:Restriction ;
owl:onProperty food:hasIngredient ;
owl:someValuesFrom food:Dairy
]
[ rdf:type owl:Restriction ;
owl:onProperty food:hasIngredient ;
owl:someValuesFrom [ rdf:type owl:Restriction ;
owl:onProperty food:hasFood ;
owl:someValuesFrom food:Meat
]
]
) ;
rdf:type owl:Class
]
[ rdf:type owl:Restriction ;
owl:onProperty food:hasIngredient ;
owl:someValuesFrom [ rdf:type owl:Restriction ;
owl:onProperty food:hasFood ;
owl:someValuesFrom food:Pork
]
]
)
]
) ;
rdf:type owl:Class ;
rdfs:subClassOf [ rdf:type owl:Restriction ;
owl:onProperty food:violatesRestriction ;
owl:hasValue food:kosherReligious
]
] .
说:"如果食谱中有猪肉,或者肉与乳制品结合,就不是犹太洁食。">
推理速度非常慢(在25000个三重数据库中为8秒(。如果我在模型快速运行之前提取模型,但提取模型需要3分钟。
我只想有一种方法,用户可以在合理的时间(<2秒(内通过推理器的推断查询食谱:(
还有其他(更好的?(推理器可以处理空白节点(隐士不能…(吗??
我的问题是:
- 如何让Fuseki使用Pellet/Openllet运行
- 合理的替代方案
- 有没有更好的方法来推断像上面这样的规则
- 我完全错了吗?我是否必须让推理机在程序开始时只运行一次,而不是每次查询
致以最良好的问候;(
我没有尝试Openllet,而是尝试了OWLMicroFBRuleReasoner,结果成功了!它的快!
<#model_inf> a ja:InfModel ;
ja:baseModel <#graph> ;
ja:reasoner [
ja:reasonerURL <http://jena.hpl.hp.com/2003/OWLMicroFBRuleReasoner>
] .