我是fuseki的新手,想为我们的项目使用2个TDB数据集:一个用于我们自己的数据的小数据集,一个大数据集(168 M三元组,来自http://data.bnf.fr的导入数据)。
我们需要索引数据,因为使用“FILTER(CONTAINS())”的SPARQL查询不适用于大型数据集(“BnF_text”)。
因此,我在“BnF_text”之后构建了一个文本索引,在这篇帖子之后:Fuseki indexed (Lucene) text search returns no results(但我必须修改turtle配置文件以使text:query
正常工作)。
它有效,但我遇到了一个奇怪的问题“BnF_text”:有时候,同一个查询会返回超时,我看不到在fuseki日志和apache日志中发现错误。
这是我的问题:~~~~~~~~~~~~~~以下是我的安装细节:~~~~~~~
fuseki-server
中的Java内存限制:设置为--Xmx4000M
。$FUSEKI_PATH/text_config.ttl
+ $FUSEKI_PATH/run/configuration/MY_DATASET.ttl
./fuseki-server --config text_config.ttl
配置文件
1)text_config.ttl
@prefix : <#> .
@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#> .
@prefix text: <http://jena.apache.org/text#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
## Initialize TDB --------------------------------
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
## Initialize text query -------------------------------------
[] ja:loadClass "org.apache.jena.query.text.TextQuery" .
# A TextDataset is a regular dataset with a text index.
text:TextDataset rdfs:subClassOf ja:RDFDataset .
# Lucene index
text:TextIndexLucene rdfs:subClassOf text:TextIndex .
## ---------------------------------------------------------------
## This URI must be fixed - it's used to assemble the text dataset.
:text_dataset rdf:type text:TextDataset ;
text:dataset :tdb_dataset_readwrite ;
text:index <#indexLucene> ;
.
# A TDB datset used for RDF storage ------------------------------
:tdb_dataset_readwrite # <= EDIT : instead of <#dataset>
a tdb:DatasetTDB ;
tdb:location "TDB_PATH" ;
.
# Text index description ------------------------------------------
<#indexLucene> a text:TextIndexLucene ;
text:directory <file:LUCENE_PATH> ;
text:entityMap <#entMap> ;
text:storeValues true ;
.
# Mapping in the index ---------------------------------------------
# URI stored in field "uri"
<#entMap> a text:EntityMap ;
text:entityField "uri" ;
text:defaultField "text" ;
text:map (
[ text:field "text" ; text:predicate dcterms:title ]
[ text:field "text" ; text:predicate foaf:familyName ]
[ text:field "text" ; text:predicate foaf:name ]
) .
# Fuseki services (http) ---------------------------------------------
# EDIT : added following lines
:service_tdb_all a fuseki:Service ;
rdfs:label "TDB BnF_text" ;
fuseki:dataset :text_dataset ; ###
fuseki:name "BnF_text" ;
fuseki:serviceQuery "query" , "sparql" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:serviceReadWriteGraphStore " .
2)MY_DATASET.ttl
@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#> .
:service_tdb_all a fuseki:Service ;
rdfs:label "TDB MY_DATASET" ;
fuseki:dataset :tdb_dataset_readwrite ;
fuseki:name "MY_DATASET" ;
fuseki:serviceQuery "query" , "sparql" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:serviceReadWriteGraphStore
"data" ;
fuseki:serviceUpdate "update" ;
fuseki:serviceUpload "upload" .
:tdb_dataset_readwrite
a tdb:DatasetTDB ;
tdb:location "MY_DATASET_TDB_PATH" .
提前致谢
答案 0 :(得分:1)
谢谢安迪,你是对的。问题来自EasyRDF,而不是来自Fuseki。我发现这个:https://groups.google.com/d/msg/skosmos-users/WhtZwnsxOFs/MtAocr8vDgAJ,所以在vendor / easyrdf / easyrdf / lib / EasyRdf / Http / Client.php中更改了超时,现在一切似乎都没问题。我将进行更多测试,然后尝试将问题标记为已解决。
编辑:“现在一切都好了”=来自EasyRdf_Exception
的“超时”消息已消失