The database has geospatial functionality disabled, cannot perform spatial queries

Hi,

I am running geospatial queries on a spatially enabled database "scalability_10K".

I am using the Java API and I am receiving the following error:

com.complexible.stardog.protocols.http.client.BaseHttpClient$HttpClientException: com.complexible.stardog.plan.eval.TranslateException: The database has geospatial functionality disabled, cannot perform spatial queries.

The spatial query is the following:

PREFIX geo: <http://www.opengis.net/ont/geosparql#> 
PREFIX geo-sf: <http://www.opengis.net/ont/sf#> 
PREFIX geof: <http://www.opengis.net/def/function/geosparql/> 
PREFIX lgo: <http://data.linkedeodata.eu/ontology#> 
PREFIX owl: <http://www.w3.org/2002/07/owl#> 
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
PREFIX unit: <http://qudt.org/vocab/unit#> 
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 

SELECT ?s1 ?o1 WHERE { 
 ?s1 geo:asWKT ?o1 . 
?relation geof:relate(?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>) .
FILTER(?relation != geo:disjoint) .
} 

Below you can see the messages of the Stardog server configuration (version, license, list of databases) and the "scalability_10K" database configuration metadata, where it is reported that it is a spatially enabled database, with JTS enabled.

tioannid@ubuntu-vma-tioa:/media/sf_VM_Shared/PHD/NetBeansProjects/PhD/GeoRDFBench/scripts$ $StardogBaseDir/bin/stardog-admin server start

************************************************************
This copy of Stardog is licensed to Theofilos Ioannidis (tioannid@di.uoa.gr), Kapodistrian University of Athens
This is a trial Enterprise license
This license will expire in 74 days on Tue Nov 07 02:00:00 EET 2023
************************************************************

                                                             :;   
                                      ;;                   `;`:   
  `'+',    ::                        `++                    `;:`  
 +###++,  ,#+                        `++                    .     
 ##+.,',  '#+                         ++                     +    
,##      ####++  ####+:   ##,++` .###+++   .####+    ####++++#    
`##+     ####+'  ##+#++   ###++``###'+++  `###'+++  ###`,++,:     
 ####+    ##+        ++.  ##:   ###  `++  ###  `++` ##`  ++:      
  ###++,  ##+        ++,  ##`   ##;  `++  ##:   ++; ##,  ++:      
    ;+++  ##+    ####++,  ##`   ##:  `++  ##:   ++' ;##'#++       
     ;++  ##+   ###  ++,  ##`   ##'  `++  ##;   ++:  ####+        
,.   +++  ##+   ##:  ++,  ##`   ###  `++  ###  .++  '#;           
,####++'  +##++ ###+#+++` ##`   :####+++  `####++'  ;####++`      
`####+;    ##++  ###+,++` ##`    ;###:++   `###+;   `###++++      
                                                    ##   `++      
                                                   .##   ;++      
                                                    #####++`      
                                                     `;;;.        
************************************************************

ERROR 2023-08-24 12:13:02,307 [main] com.complexible.stardog.protocols.http.server.StardogHttpServiceLoader:createService(127): Unable to create an instance of HttpService class com.complexible.stardog.protocols.http.cache.server.CacheHttpService, missing compatible constructor

Stardog server 7.9.1 started on Thu Aug 24 12:13:03 EEST 2023.

Stardog server is listening on all network interfaces.
HTTP server available at http://localhost:5820.

STARDOG=/media/sf_VM_Shared/PHD/stardog-7.9.1/bin/..

STARDOG_EXT=/media/sf_VM_Shared/PHD/stardog-7.9.1/server/ext

STARDOG_HOME=/home/tioannid/Downloads/StarDog/

tioannid@ubuntu-vma-tioa:/media/sf_VM_Shared/PHD/NetBeansProjects/PhD/GeoRDFBench/scripts$ $StardogBaseDir/bin/stardog-admin db list
+-----------------+
|    Databases    |
+-----------------+
| scalability_10K |
+-----------------+
tioannid@ubuntu-vma-tioa:/media/sf_VM_Shared/PHD/NetBeansProjects/PhD/GeoRDFBench/scripts$ $StardogBaseDir/bin/stardog-admin metadata get scalability_10K | grep spatial
| optimize.spatial                            | false                                                                            |
| spatial.distance.precision                  | 8                                                                                |
| spatial.enabled                             | true                                                                             |
| spatial.error.percentage                    | 0.025                                                                            |
| spatial.index.dirty                         | true                                                                             |
| spatial.index.version                       | 1                                                                                |
| spatial.precision                           | 11                                                                               |
| spatial.result.limit                        | 10000                                                                            |
| spatial.result.page_size                    | 100000                                                                           |
| spatial.use.jts                             | true                                                                             |

The same error is received when I use the Stardog UI as can be seen in the attached picture.

As you can see I have only 74 days left on my renewed license and I have a benchmark evaluation that needs to proceed. Several other systems have to be tested and I am stuck with Stardog with what I can possibly estimate it is a license problem, since the same code and queries where successfully running with the original license which expired May '23.

I would appreciate it if I could get some help on this one as early as possible.

Regards

It looks like you need to enable geospatial support on that database. If you go to Stardog Studio, click the database icon on the left, and navigate to Properties, you will find a "Enabled geospatial search." To turn this on, you'll have to move the switch at the top of the UI to offline the database. You'll then be able to turn this on, and then flip the switch back to online. This will cause the server to build the geospatial index.

More information is available in the Geospatial Primer:

And the product documentation:

Hi Al.

Thank you for the prompt response.
I did check through the Stardog Studio UI, but the spatial properties are already enabled.
This was expected since in my initial post I included the results of the command

$ stardog-admin db list
+-----------------+
|    Databases    |
+-----------------+
| scalability_10K |
+-----------------+
$ stardog-admin metadata get scalability_10K | grep spatial
| optimize.spatial                            | false                                                                            |
| spatial.distance.precision                  | 8                                                                                |
| spatial.enabled                             | true                                                                             |
| spatial.error.percentage                    | 0.025                                                                            |
| spatial.index.dirty                         | true                                                                             |
| spatial.index.version                       | 1                                                                                |
| spatial.precision                           | 11                                                                               |
| spatial.result.limit                        | 10000                                                                            |
| spatial.result.page_size                    | 100000                                                                           |
| spatial.use.jts                             | true                                                                             |

Is it required to set the "optimize.spatial" property to "true" in addition to "spatial.enabled" and "spatial.use.jts" in order to enable spatial functionality?

Also during the startup of the Stardog server I am receiving the following error:

ERROR 2023-08-24 12:13:02,307 [main] com.complexible.stardog.protocols.http.server.StardogHttpServiceLoader:createService(127): Unable to create an instance of HttpService class com.complexible.stardog.protocols.http.cache.server.CacheHttpService, missing compatible constructor

Could this error be the reason for the problem I am facing querying a spatially enabled database?

There is a post related to this error (Server start Error) and the answer explicitly mentions that "...Your license has 3 features intentionally disabled: geospatial, LDAP, and caching...".

This was also my question in initial post, that there might be an issue with the renewed license I got. I believe that I was given a license that does not allow spatial operations.
Regards

CacheHttpError is a false lead. Today everyone gets it. It is addressed in next software release. I must leave the spatial question to someone else.