我正在使用一个没有启用规则集的仓库。Query_1使用geof:sfIntersects()和Query_2使用geo:sfIntersects谓词。在 Workbench v8.6.1 中,Query_1 可以正确执行,而 Query_2 不能正确执行,不返回任何行,如文档中所述。启用 GeoSPARQL 插件后,使用 Workbench 两个查询都能正确执行,但 Query_2 更快。在 Java POM 中使用 Runtime v8.6.1,我尝试在启用 GeoSPARQL 插件的情况下针对 repo 执行 Query_1 和 Query_2。Query_1 正确执行(与 Workbench 一样),但 Query_2 未正确执行,不返回任何行(好像 GeoSPARQL 插件已禁用!)。我有证据表明 GeoSPARQL 插件已启用,因为如果我使用 Workbench 重复相同的任务,两个查询都会成功,同时/storage/GeoSPARQL/v2/config.properties具有以下内容:
#GeoSPARQL configuration
#Thu Dec 06 09:30:54 EET 2018
precision=11
prefixtree=QUAD
prefixtree.current=QUAD
precision.current=11
enabled=true
java 选项正确指向-Dregister-external-plugins=/home/tioannid/graphdb-free-8.6.1 /lib/plugins
查询_1:
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX lgd: <http://data.linkedeodata.eu/ontology#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s1 ?o1 WHERE {
?s1 geo:asWKT ?o1 .
FILTER(geof:sfIntersects(?o1, "POLYGON((23.708496093749996 37.95719224376526,22.906494140625 40.659805938378526,11.524658203125002 48.16425348854739,-0.1181030273437499 51.49506473014367,-3.2189941406250004 55.92766341247031,-5.940856933593749 54.59116279530599,-3.1668090820312504 51.47967237816337,23.708496093749996 37.95719224376526))"^^<http://www.opengis.net/ont/geosparql#wktLiteral>)).
}
5782 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Version: 8.6, revision: -1564293007
5789 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Build date: Wed Jul 18 17:58:42 EEST 2018
5846 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Started repository scalability_10K in READ/WRITE mode.
5846 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'partialRDFS' to default value 'false'
...
6841 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Searching for plugins available in the classpath...
6877 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin rdfrank
6878 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin direct
6878 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin geospatial
6878 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin notifications
6879 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin expose-entity
6879 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin literals-index
6879 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin script
6879 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin plugincontrol
6880 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin magic-predicates
6880 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'register-plugins' to default value '[]'
6880 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Registering external plugins...
6888 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Scanning /home/tioannid/graphdb-free-8.6.1/lib/plugins/sparql-mm for plugins
6902 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin sparql-mm
6903 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Scanning /home/tioannid/graphdb-free-8.6.1/lib/plugins/lucene-connector for plugins
7021 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin lucene-connector
7021 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Scanning /home/tioannid/graphdb-free-8.6.1/lib/plugins/dependencies-plugin for plugins
7030 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin dependencies-plugin
7030 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Scanning /home/tioannid/graphdb-free-8.6.1/lib/plugins/lucene for plugins
7057 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin lucene
7057 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Scanning /home/tioannid/graphdb-free-8.6.1/lib/plugins/autocomplete-plugin for plugins
7074 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin autocomplete
7074 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Scanning /home/tioannid/graphdb-free-8.6.1/lib/plugins/graphdb-geosparql-plugin for plugins
7136 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin GeoSPARQL
7137 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'disable-plugins' to default value '[]'
7140 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugins... (DEFAULT)
7141 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'expose-entity'
7249 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'autocomplete'
7251 [main] INFO com.ontotext.trree.plugin.autocomplete.AutocompletePluginUtils - >>>>>>>> AutocompletePlugin: No configuration file found at /media/sf_VM_Shared/PHD/GraphDB_Repos/repositories/scalability_10K/storage/autocomplete/config.properties. Assuming default options for plugin.
7257 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'direct'
7259 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'lucene'
7263 [main] INFO com.ontotext.plugin.lucene - No Lucene indices were found
7263 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'plugincontrol'
7264 [main] INFO com.ontotext.trree.plugin.plugincontrol.PluginControlPlugin - Plugin:plugincontrol initialized
7264 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'script'
7265 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'magic-predicates'
7265 [main] INFO com.ontotext.plugin.magic-predicates - Registering InverseMagicPredicate: http://spinrdf.org/spif#foreach
7266 [main] INFO com.ontotext.plugin.magic-predicates - Registering TupleFunction: http://www.openrdf.org/contrib/lucenesail#search
7266 [main] INFO com.ontotext.plugin.magic-predicates - Registering TupleFunction: http://jena.hpl.hp.com/ARQ/list#length
7266 [main] INFO com.ontotext.plugin.magic-predicates - Registering InverseMagicPredicate: http://jena.hpl.hp.com/ARQ/property#concat
7266 [main] INFO com.ontotext.plugin.magic-predicates - Registering InverseMagicPredicate: http://spinrdf.org/spif#for
7267 [main] INFO com.ontotext.plugin.magic-predicates - Registering TupleFunction: http://www.openrdf.org/contrib/lucenesail#withinDistance
7267 [main] INFO com.ontotext.plugin.magic-predicates - Registering InverseMagicPredicate: http://spinrdf.org/spif#split
7267 [main] INFO com.ontotext.plugin.magic-predicates - Registering TupleFunction: http://jena.hpl.hp.com/ARQ/list#member
7267 [main] INFO com.ontotext.plugin.magic-predicates - Registering TupleFunction: http://jena.hpl.hp.com/ARQ/list#index
7267 [main] INFO com.ontotext.plugin.magic-predicates - Registering InverseMagicPredicate: http://jena.hpl.hp.com/ARQ/property#strSplit
7267 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'literals-index'
7312 [main] INFO com.ontotext.plugin.literals-index - Literals indices restored.
7312 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'geospatial'
7313 [main] INFO com.ontotext.trree.plugin.geo.GeoSpatialPlugin - Plugin:geospatial initialized
7314 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'sparql-mm'
7349 [main] INFO com.ontotext.graphdb.sparqlmm.FunctionLoader - Registered 48 functions from package com.github.tkurz.sparqlmm.function.
7349 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'dependencies-plugin'
7355 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'GeoSPARQL'
9407 [main] INFO com.ontotext.plugin.GeoSPARQL - >>>>>>>> GeoSPARQL: Initializing Lucene indexer...
9612 [main] INFO com.ontotext.plugin.GeoSPARQL - >>>>>>>> GeoSPARQL: Lucene indexer initialized!
9641 [main] INFO com.ontotext.trree.geosparql.FunctionLoader - Registered 50 functions from package com.useekm.geosparql.
9641 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'lucene-connector'
9660 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'rdfrank'
9682 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'notifications'
9686 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Finished initializing plugins
9687 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'graphdb.page.cache.size' to default value '3.6G'
9830 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'do.resolve.entities' to default value 'true'
9830 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'do.load.data' to default value 'true'
9830 [main] INFO com.ontotext.rio.parallel.ParallelLoader - Data will be parsed + resolved + loaded.
10019 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'use.parallel.file.inserts' to default value 'true'
10030 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'custom.validation.queries.file' to default value 'null'
10058 [pool-3-thread-1] INFO GraphDBSUT - Evaluating query...
10293 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'deduplicate.construct' to default value 'true'
10450 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'reuse.vars.in.subselects' to default value 'false'
10473 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'in-clause-max-members' to default value '16'
10473 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'query.convert.values.clause' to default value 'true'
10488 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'hash.join' to default value 'false'
10488 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'merge.join' to default value 'false'
10489 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'PTO' to default value '2'
10489 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'FSIPC' to default value '2'
12418 [pool-3-thread-1] INFO GraphDBSUT - Query evaluated with 554 results and 0 scan errors!
12579 [main] INFO Experiment - Query executed (cold, 0, 0): 242902950 + 1910235260 = 2153138210, 554
12579 [main] INFO GraphDBSUT - Closing..
12579 [main] INFO GraphDBSUT - [GraphDB.close] Closing connection...
Query_2 日志:
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX lgd: <http://data.linkedeodata.eu/ontology#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s1 ?o1 WHERE {
?s1 geo:asWKT ?o1 .
?s1 geo:sfIntersects "POLYGON((23.708496093749996 37.95719224376526,22.906494140625 40.659805938378526,11.524658203125002 48.16425348854739,-0.1181030273437499 51.49506473014367,-3.2189941406250004 55.92766341247031,-5.940856933593749 54.59116279530599,-3.1668090820312504 51.47967237816337,23.708496093749996 37.95719224376526))"^^<http://www.opengis.net/ont/geosparql#wktLiteral> .
}
5758 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Version: 8.6, revision: -1564293007
5764 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Build date: Wed Jul 18 17:58:42 EEST 2018
5820 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Started repository scalability_10K in READ/WRITE mode.
5820 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'partialRDFS' to default value 'false'
...
6978 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Searching for plugins available in the classpath...
7016 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin rdfrank
7017 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin direct
7018 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin geospatial
7018 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin notifications
7019 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin expose-entity
7019 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin literals-index
7021 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin script
7022 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin plugincontrol
7023 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin magic-predicates
7023 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'register-plugins' to default value '[]'
7023 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Registering external plugins...
7031 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Scanning /home/tioannid/graphdb-free-8.6.1/lib/plugins/sparql-mm for plugins
7045 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin sparql-mm
7045 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Scanning /home/tioannid/graphdb-free-8.6.1/lib/plugins/lucene-connector for plugins
7167 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin lucene-connector
7167 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Scanning /home/tioannid/graphdb-free-8.6.1/lib/plugins/dependencies-plugin for plugins
7175 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin dependencies-plugin
7175 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Scanning /home/tioannid/graphdb-free-8.6.1/lib/plugins/lucene for plugins
7194 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin lucene
7194 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Scanning /home/tioannid/graphdb-free-8.6.1/lib/plugins/autocomplete-plugin for plugins
7211 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin autocomplete
7211 [main] INFO com.ontotext.trree.free.GraphDBFreeSchemaRepository - Scanning /home/tioannid/graphdb-free-8.6.1/lib/plugins/graphdb-geosparql-plugin for plugins
7266 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Registering plugin GeoSPARQL
7266 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'disable-plugins' to default value '[]'
7267 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugins... (DEFAULT)
7268 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'expose-entity'
7367 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'autocomplete'
7369 [main] INFO com.ontotext.trree.plugin.autocomplete.AutocompletePluginUtils - >>>>>>>> AutocompletePlugin: No configuration file found at /media/sf_VM_Shared/PHD/GraphDB_Repos/repositories/scalability_10K/storage/autocomplete/config.properties. Assuming default options for plugin.
7374 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'direct'
7375 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'lucene'
7378 [main] INFO com.ontotext.plugin.lucene - No Lucene indices were found
7378 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'plugincontrol'
7379 [main] INFO com.ontotext.trree.plugin.plugincontrol.PluginControlPlugin - Plugin:plugincontrol initialized
7379 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'script'
7379 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'magic-predicates'
7380 [main] INFO com.ontotext.plugin.magic-predicates - Registering InverseMagicPredicate: http://spinrdf.org/spif#foreach
7380 [main] INFO com.ontotext.plugin.magic-predicates - Registering TupleFunction: http://www.openrdf.org/contrib/lucenesail#search
7381 [main] INFO com.ontotext.plugin.magic-predicates - Registering TupleFunction: http://jena.hpl.hp.com/ARQ/list#length
7381 [main] INFO com.ontotext.plugin.magic-predicates - Registering InverseMagicPredicate: http://jena.hpl.hp.com/ARQ/property#concat
7381 [main] INFO com.ontotext.plugin.magic-predicates - Registering InverseMagicPredicate: http://spinrdf.org/spif#for
7381 [main] INFO com.ontotext.plugin.magic-predicates - Registering TupleFunction: http://www.openrdf.org/contrib/lucenesail#withinDistance
7381 [main] INFO com.ontotext.plugin.magic-predicates - Registering InverseMagicPredicate: http://spinrdf.org/spif#split
7381 [main] INFO com.ontotext.plugin.magic-predicates - Registering TupleFunction: http://jena.hpl.hp.com/ARQ/list#member
7381 [main] INFO com.ontotext.plugin.magic-predicates - Registering TupleFunction: http://jena.hpl.hp.com/ARQ/list#index
7381 [main] INFO com.ontotext.plugin.magic-predicates - Registering InverseMagicPredicate: http://jena.hpl.hp.com/ARQ/property#strSplit
7381 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'literals-index'
7427 [main] INFO com.ontotext.plugin.literals-index - Literals indices restored.
7428 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'geospatial'
7429 [main] INFO com.ontotext.trree.plugin.geo.GeoSpatialPlugin - Plugin:geospatial initialized
7430 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'sparql-mm'
7461 [main] INFO com.ontotext.graphdb.sparqlmm.FunctionLoader - Registered 48 functions from package com.github.tkurz.sparqlmm.function.
7461 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'dependencies-plugin'
7464 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'GeoSPARQL'
9320 [main] INFO com.ontotext.plugin.GeoSPARQL - >>>>>>>> GeoSPARQL: Initializing Lucene indexer...
9511 [main] INFO com.ontotext.plugin.GeoSPARQL - >>>>>>>> GeoSPARQL: Lucene indexer initialized!
9531 [main] INFO com.ontotext.trree.geosparql.FunctionLoader - Registered 50 functions from package com.useekm.geosparql.
9531 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'lucene-connector'
9544 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'rdfrank'
9561 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Initializing plugin 'notifications'
9563 [main] INFO com.ontotext.trree.sdk.impl.PluginManager - Finished initializing plugins
9563 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'graphdb.page.cache.size' to default value '3.6G'
9767 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'do.resolve.entities' to default value 'true'
9768 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'do.load.data' to default value 'true'
9768 [main] INFO com.ontotext.rio.parallel.ParallelLoader - Data will be parsed + resolved + loaded.
9957 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'use.parallel.file.inserts' to default value 'true'
9968 [main] INFO com.ontotext.config.AbstractParameter - Configured parameter 'custom.validation.queries.file' to default value 'null'
10009 [pool-3-thread-1] INFO GraphDBSUT - Evaluating query...
10205 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'deduplicate.construct' to default value 'true'
10278 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'reuse.vars.in.subselects' to default value 'false'
10304 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'in-clause-max-members' to default value '16'
10304 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'query.convert.values.clause' to default value 'true'
11725 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'hash.join' to default value 'false'
11740 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'merge.join' to default value 'false'
11742 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'PTO' to default value '2'
11743 [pool-3-thread-1] INFO com.ontotext.config.AbstractParameter - Configured parameter 'FSIPC' to default value '2'
12162 [main] INFO Experiment - Query executed (cold, 0, 0): 86401 + 86401 = 86401, -1
12162 [main] INFO GraphDBSUT - Closing..
12162 [main] INFO GraphDBSUT - [GraphDB.close] Closing connection...
如果此功能仅适用于 Workbench,那将是一种浪费……
问候