简体   繁体   English

通过RDF4J API配置/启用GeoSPARQL插件

[英]Configure/Enable GeoSPARQL plugin through RDF4J API

I am trying to automate the creation of GraphDB repos which must also have the GeoSPARQL plugin enabled. 我正在尝试自动创建GraphDB存储库,该存储库还必须启用GeoSPARQL插件。 To this end, I am sending 2 INSERT statements, the first for configuring the index and accuracy and the second statement for enabling the plugin. 为此,我要发送2条INSERT语句,第一个用于配置索引和准确性,第二个用于启用插件。 However the conn.prepareUpdate(QueryLanguage.SPARQL, enablePluginStatement).execute() operation "seems" to run asychronously. 但是,conn.prepareUpdate(QueryLanguage.SPARQL,enablePluginStatement).execute()操作“似乎”异步运行。 Instead of waiting until the indexing operation is complete (as it happens when running the same INSERT query from the Workbench) it almost immediately proceeds to the following statement which is to shutdown the repository. 与其等到索引操作完成(从工作台运行相同的INSERT查询时发生),不如立即执行以下语句以关闭存储库。 When I execute the same code through the Netbeans debugger the same single statement takes much more time to complete and does complete the indexing properly. 当我通过Netbeans调试器执行相同的代码时,同一条语句将花费更多的时间来完成并正确完成了索引编制。 Any insight on this or a similar issue? 对这个或类似问题有任何见解吗?

    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)...

You can use composite transaction as multiple "insert where" and "delete where" expressions separated by ; 您可以将复合事务用作多个用“;”分隔的“插入位置”和“删除位置”表达式。 can see the changes from the previous ones in the same update. 可以看到同一更新中以前的更改。 As an example: 举个例子:

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". }

With curl: 卷曲:

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". }'

You should be able to first build the index and then set the precision: 您应该能够首先构建索引,然后设置精度:

[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!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM