首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过RDF4J接口配置/启用GeoSPARQL插件

通过RDF4J接口配置/启用GeoSPARQL插件
EN

Stack Overflow用户
提问于 2019-02-25 23:38:25
回答 1查看 85关注 0票数 0

我正在尝试自动创建GraphDB存储库,这也必须有GeoSPARQL插件启用。为此,我发送了两个INSERT语句,第一个用于配置索引和准确性,第二个用于启用插件。然而,conn.prepareUpdate(QueryLanguage.SPARQL,enablePluginStatement).execute()操作“似乎”是异步运行的。而不是等待索引操作完成(就像从工作台运行相同的INSERT查询时发生的那样),它几乎立即继续执行下面的语句,即关闭存储库。当我通过Netbeans调试器执行相同的代码时,相同的语句需要更多的时间才能完成,并且正确地完成了索引。对这个或类似的问题有什么见解吗?

代码语言:javascript
复制
    26609 [main] INFO  com.ontotext.config.AbstractParameter  - Configured parameter 'deduplicate.construct' to default value 'true' 
    26610 [main] INFO  com.ontotext.config.AbstractParameter  - Configured parameter 'reuse.vars.in.subselects' to default value 'false' 
    26691 [main] INFO  com.ontotext.trree.monitorRepository.MonitorRepositoryConnection  - Incoming update: 
PREFIX : <http://www.ontotext.com/plugins/geosparql#> 
INSERT DATA {    _:s :enabled "true" .  } 
    26764 [main] INFO  com.ontotext.plugin.GeoSPARQL  - >>>>>>>> GeoSPARQL: Initializing Lucene indexer... 
    26863 [main] INFO  com.ontotext.plugin.GeoSPARQL  -
        >>>>>>>> GeoSPARQL: Lucene indexer initialized! 
    26863 [main] INFO  com.ontotext.plugin.GeoSPARQL  - >>>>>>>> GeoSPARQL: Initializing indexing process... 
    32032 [main] INFO  com.ontotext.plugin.GeoSPARQL 
        - >>>>>>>> GeoSPARQL: Indexing completed! 
    52200 [main] WARN  com.ontotext.trree.free.GraphDBFreeSchemaRepository  - Closing active connection due to shut down; consider setting the org.eclipse.rdf4j.repository.debug system property 
    52596 [main] INFO  com.ontotext.trree.sdk.impl.PluginManager  - Shutting down plugins (DEFAULT)...
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-02-26 18:11:56

您可以使用复合事务,因为多个由分隔的"insert where“和"delete where”表达式可以在同一更新中看到与前一个表达式相比所做的更改。举个例子:

代码语言:javascript
复制
PREFIX : <http://www.ontotext.com/plugins/geosparql#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>INSERT DATA {    _:s :enabled "true" .  } ;INSERT DATA { _:s :prefixTree "quad"; :precision "25". }

使用curl:

代码语言:javascript
复制
curl 'http://localhost:7200/repositories/geosparql/statements' -H 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'update=PREFIX : <http://www.ontotext.com/plugins/geosparql#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> INSERT DATA { _:s :enabled "true" . } ; INSERT DATA { _:s :prefixTree "quad"; :precision "25". }'

您应该能够首先构建索引,然后设置精度:

代码语言:javascript
复制
[INFO ] 2019-02-26 12:08:36,331 [repositories/geosparql | c.o.g.s.StatementsController] POST SPARQL update request to repository
[INFO ] 2019-02-26 12:08:36,349 [repositories/geosparql | c.o.p.GeoSPARQL] >>>>>>>> GeoSPARQL: Initializing Lucene indexer...
[INFO ] 2019-02-26 12:08:36,383 [repositories/geosparql | c.o.p.GeoSPARQL] >>>>>>>> GeoSPARQL: Lucene indexer initialized!
[INFO ] 2019-02-26 12:08:36,383 [repositories/geosparql | c.o.p.GeoSPARQL] >>>>>>>> GeoSPARQL: Initializing indexing process...
[INFO ] 2019-02-26 12:08:36,466 [repositories/geosparql | c.o.p.GeoSPARQL] >>>>>>>> GeoSPARQL: Indexing completed!
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54869740

复制
相关文章

相似问题

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