SPARQL query fail to return results from remote datasets

I am failing to get results from dbpedia when I try to combine query results from local triples and that from dbpedia. I am using Virtuoso Version 7.2. Here is my simple query. Please help me identify where am getting wrong

PREFIX prop: <http://vocab.opendatadom.or.tz/prop/prop.owl#>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX schema: <http://schema.org/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT DISTINCT ?school_name 
                ?lat ?long ?region_name ?otherdataset ?abs

FROM <http://civiclab.or.tz/togd/dataset/school#>
WHERE {
		?l prop:school_name ?school_name .
                ?l geo:lat ?lat .
                ?l geo:long ?long .
                ?l schema:Place ?region .
                ?region prop:region_name ?region_name .
                ?region owl:sameAs ?otherdataset .
     OPTIONAL {
               SERVICE <http://DBpedia.org/sparql> { 
                       SELECT ?abs
                       WHERE { 
                             ?otherdataset dbo:abstract ?abs . 
                        }
                 }
      }
}

Try

PREFIX prop: <http://vocab.opendatadom.or.tz/prop/prop.owl#>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX schema: <http://schema.org/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT DISTINCT ?school_name
?lat ?long ?region_name ?otherdataset ?abs

FROM <http://civiclab.or.tz/togd/dataset/school#>
WHERE 
  {
    ?l prop:school_name ?school_name .
    ?l geo:lat ?lat .
    ?l geo:long ?long .
    ?l schema:Place ?region .
    ?region prop:region_name ?region_name .
    ?region owl:sameAs ?otherdataset .
    OPTIONAL
      {
        SERVICE <http://DBpedia.org/sparql> 
          {
            SELECT ?abs ?otherdataset ## Note variable addition ##
            WHERE
              {
                ?otherdataset dbo:abstract ?abs .
              }
          }
      }
  }

Note variable addition to the SELECT-list in the DBpedia SERVICE block.

1 Like

Thank you, I tried and this was the error message

On Virtuoso 7.2

Virtuoso 37000 Error SP031: SPARQL compiler: Internal error: ssg_print_equiv_retval_expn(): union selid is out of scope

On Virtuoso 6.1

Virtuoso 37000 Error SP031: SPARQL compiler: http://DBpedia.org/sparql does not support SPARQL-BI extensions (like nested SELECT) so SPARQL query can not be composed

Hi

We have been able to recreate the error reported with Virtuoso 7.2, please confirm the exact version of Virtuoso being used by running one of the following commands from the bin directory of your Virtuoso installation:

  • If using the Virtuoso commercial edition:
    ./virtuoso-iodbc-t -?      
    
  • If using the Virtuoso open source edition
    ./virtuoso-t -?
    

Are you using Virtuoso 6.1 as well? Note that that version is no longer supported, with 6.4 being the last version built back in 2013?

Hi,
Thanks for the reply

I am running Virtuoso Open Source Edition Version 7.20.3217 on a Windows 7 machine. The other instance of VOS 6.1 is on Ubuntu 14.04 LTS (Couldn’t find package installation scripts of the newer version).

If you are using a VOS 6.1 package from a Ubuntu distro, then the 6.4 version would not be available for it as Ubuntu never packaged it.

With your original query against your Virtuoso 7.2 instance with your dataset (<http://civiclab.or.tz/togd/dataset/school#>) loaded — what happens when the query is run? Does it complete but just not return any results?

What happens if the optional clause is removed completely, i.e. –

PREFIX prop: <http://vocab.opendatadom.or.tz/prop/prop.owl#>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX schema: <http://schema.org/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT DISTINCT ?school_name
?lat ?long ?region_name ?otherdataset ?abs

FROM <http://civiclab.or.tz/togd/dataset/school#>
WHERE {
    ?l prop:school_name ?school_name .
    ?l geo:lat ?lat .
    ?l geo:long ?long .
    ?l schema:Place ?region .
    ?region prop:region_name ?region_name .
    ?region owl:sameAs ?otherdataset .
    
    
       SERVICE <http://DBpedia.org/sparql> 
       {
           SELECT ?abs ?otherdataset ## Note variable addition ##
           WHERE {
               ?otherdataset dbo:abstract ?abs .
             }
       }
        
    }

It complete but does not return any results.

Hi

Have you tried –

SPARQL LOAD SERVICE <http://DBpedia.org/sparql> DATA

– via ISQL or –

LOAD SERVICE <http://DBpedia.org/sparql> DATA

– via SPARQL web service endpoint?

The error “Virtuoso 37000 Error SP031: SPARQL compiler: http://dbpedia.org/sparql does not support SPARQL-BI…” looks like you haven’t. More recent versions of Virtuoso detect and handle this error by running LOAD SERVICE DATA automatically – if query comes via default query service endpoint.

Older versions and associated endpoints (shipped with some VADs) require explicit call before using features not described in SPARQL 1.0

BTW – I’ve received no error when using version 07.20.3229 of the commercial edition. Keeping in mind that the query uses only features available in VOS and not affected by differences between commercial and VOS, an upgrade from 7.20.3217 will be worth trying.

On my local box I get empty result set, indeed, because I have no http://civiclab.or.tz/togd/dataset/school# data.

The only hint I can give without data at hand — comment out one triple pattern or filter after another until you get some non-empty result. Then inspect the triple pattern (and the related triples) that make the difference.

Like in SQL, it’s very useful to know the difference between two similar queries such that the shorter one returns something and the longer one returns zero.

Hi @imikhailov

Thank you for your reply

I have tried to:

  1. comment the ?otherdataset in the SERVICE part and it returned only results from local datasets
  2. run the query on VOS 7.20.3229 instance and the error message was the same.
  3. run the query on VOS 7.20.3229 and generate SPARQL compilation report. This was the report :
SPARQL query after parsing, optimization, and converting back into SPARQL
SELECT DISTINCT  ?school_name
 ?lat
 ?long
 ?region_name
 ?otherdataset
 ?abs
 FROM <http://civiclab.or.tz/togd/dataset/school#>
 WHERE {  ?l <http://vocab.opendatadom.or.tz/prop/prop.owl#school_name> ?school_name ;
         <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ?lat ;
         <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?long ;
         <http://schema.org/Place> ?region . ?region <http://vocab.opendatadom.or.tz/prop/prop.owl#region_name> ?region_name ;
         <http://www.w3.org/2002/07/owl#sameAs> ?otherdataset .
     OPTIONAL { 
         SERVICE  <http://DBpedia.org/sparql> ( IN ?otherdataset)  { 
              { SELECT  ?abs
                 ?otherdataset
                 FROM <http://civiclab.or.tz/togd/dataset/school#>
                 WHERE {  ?otherdataset <http://dbpedia.org/ontology/abstract> ?abs . } } } } }
SPARQL query translated to SQL
For security reasons, code responsible for graph-level security is not generated and some account-specific data are intentionally made wrong. ERROR 37000: SP031: SPARQL compiler: Internal error: ssg_print_equiv_retval_expn(): union selid is out of scope
SQL execution plan
ERROR 37000: SQ074: Line 32: SP031: SPARQL compiler: Internal error: ssg_print_equiv_retval_expn(): union selid is out of scope
Internal optimizer data
These data are primarily for OpenLink support, to get additional details about the query processing.
	QUERY: (line 32) REQUEST TOP NODE (SELECT DISTINCT result-mode):
  RETVALS: ARRAY OF NODES with 6 children: {
    (line 10) VARIABLE: notNULL exported
      NAME: UNAME `school_name'	SELECT ID: STRING `s_32_11'	TABLE ID: LONG 0	EQUIV: LONG 11
    (line 11) VARIABLE: notNULL exported
      NAME: UNAME `lat'	SELECT ID: STRING `s_32_11'	TABLE ID: LONG 0	EQUIV: LONG 12
    (line 11) VARIABLE: notNULL exported
      NAME: UNAME `long'	SELECT ID: STRING `s_32_11'	TABLE ID: LONG 0	EQUIV: LONG 13
    (line 11) VARIABLE: notNULL exported
      NAME: UNAME `region_name'	SELECT ID: STRING `s_32_11'	TABLE ID: LONG 0	EQUIV: LONG 14
    (line 11) VARIABLE: notNULL exported
      NAME: UNAME `otherdataset'	SELECT ID: STRING `s_32_11'	TABLE ID: LONG 0	EQUIV: LONG 15
    (line 11) VARIABLE: exported
      NAME: UNAME `abs'	SELECT ID: STRING `s_32_11'	TABLE ID: LONG 0	EQUIV: LONG 16
   }
  RETVALS SELECT ID: STRING `s_32_11'
  SOURCES: ARRAY OF NODES with 1 children: {
    (line 14) DATA SOURCE: FROM (default)
      IRI: UNAME `http://civiclab.or.tz/togd/dataset/school#'
      EXPN: (line 13) QNAME:
        IRI: UNAME `http://civiclab.or.tz/togd/dataset/school#'
   }
  PATTERN: (line 32) GRAPH PATTERN:WHERE gp
    MEMBERS: ARRAY OF NODES with 7 children: {
      (line 15) TRIPLE:
        GRAPH: (line 13) QNAME:
          IRI: UNAME `http://civiclab.or.tz/togd/dataset/school#'
        SUBJECT: (line 15) VARIABLE: notNULL+ reference+ (subject)
          NAME: UNAME `l'	SELECT ID: STRING `s_32_11'	TABLE ID: STRING `s_32_12_t7'	EQUIV: LONG 21
        PREDICATE: (line 15) QNAME:
          IRI: UNAME `http://vocab.opendatadom.or.tz/prop/prop.owl#school_name'
        OBJECT: (line 15) VARIABLE: notNULL+ (object)
          NAME: UNAME `school_name'	SELECT ID: STRING `s_32_11'	TABLE ID: STRING `s_32_12_t7'	EQUIV: LONG 11
        SELECT ID: STRING `s_32_11'
        TABLE ID: STRING `s_32_12_t7'
      (line 16) TRIPLE:
        GRAPH: (line 13) QNAME:
          IRI: UNAME `http://civiclab.or.tz/togd/dataset/school#'
        SUBJECT: (line 16) VARIABLE: notNULL+ reference+ (subject)
          NAME: UNAME `l'	SELECT ID: STRING `s_32_11'	TABLE ID: STRING `s_32_12_t8'	EQUIV: LONG 21
        PREDICATE: (line 16) QNAME:
          IRI: UNAME `http://www.w3.org/2003/01/geo/wgs84_pos#lat'
        OBJECT: (line 16) VARIABLE: notNULL+ (object)
          NAME: UNAME `lat'	SELECT ID: STRING `s_32_11'	TABLE ID: STRING `s_32_12_t8'	EQUIV: LONG 12
        SELECT ID: STRING `s_32_11'
        TABLE ID: STRING `s_32_12_t8'
      (line 17) TRIPLE:
        GRAPH: (line 13) QNAME:
          IRI: UNAME `http://civiclab.or.tz/togd/dataset/school#'
        SUBJECT: (line 17) VARIABLE: notNULL+ reference+ (subject)
          NAME: UNAME `l'	SELECT ID: STRING `s_32_11'	TABLE ID: STRING `s_32_12_t9'	EQUIV: LONG 21
        PREDICATE: (line 17) QNAME:
          IRI: UNAME `http://www.w3.org/2003/01/geo/wgs84_pos#long'
        OBJECT: (line 17) VARIABLE: notNULL+ (object)
          NAME: UNAME `long'	SELECT ID: STRING `s_32_11'	TABLE ID: STRING `s_32_12_t9'	EQUIV: LONG 13
        SELECT ID: STRING `s_32_11'
        TABLE ID: STRING `s_32_12_t9'
      (line 18) TRIPLE:
        GRAPH: (line 13) QNAME:
          IRI: UNAME `http://civiclab.or.tz/togd/dataset/school#'
        SUBJECT: (line 18) VARIABLE: notNULL+ reference+ (subject)
          NAME: UNAME `l'	SELECT ID: STRING `s_32_11'	TABLE ID: STRING `s_32_12_t10'	EQUIV: LONG 21
        PREDICATE: (line 18) QNAME:
          IRI: UNAME `http://schema.org/Place'
        OBJECT: (line 18) VARIABLE: notNULL+ reference (object)
          NAME: UNAME `region'	SELECT ID: STRING `s_32_11'	TABLE ID: STRING `s_32_12_t10'	EQUIV: LONG 22
        SELECT ID: STRING `s_32_11'
        TABLE ID: STRING `s_32_12_t10'
      (line 19) TRIPLE:
        GRAPH: (line 13) QNAME:
          IRI: UNAME `http://civiclab.or.tz/togd/dataset/school#'
        SUBJECT: (line 19) VARIABLE: notNULL+ reference+ (subject)
          NAME: UNAME `region'	SELECT ID: STRING `s_32_11'	TABLE ID: STRING `s_32_12_t11'	EQUIV: LONG 22
        PREDICATE: (line 19) QNAME:
          IRI: UNAME `http://vocab.opendatadom.or.tz/prop/prop.owl#region_name'
        OBJECT: (line 19) VARIABLE: notNULL+ (object)
          NAME: UNAME `region_name'	SELECT ID: STRING `s_32_11'	TABLE ID: STRING `s_32_12_t11'	EQUIV: LONG 14
        SELECT ID: STRING `s_32_11'
        TABLE ID: STRING `s_32_12_t11'
      (line 20) TRIPLE:
        GRAPH: (line 13) QNAME:
          IRI: UNAME `http://civiclab.or.tz/togd/dataset/school#'
        SUBJECT: (line 20) VARIABLE: notNULL+ reference+ (subject)
          NAME: UNAME `region'	SELECT ID: STRING `s_32_11'	TABLE ID: STRING `s_32_12_t12'	EQUIV: LONG 22
        PREDICATE: (line 20) QNAME:
          IRI: UNAME `http://www.w3.org/2002/07/owl#sameAs'
        OBJECT: (line 20) VARIABLE: notNULL+ (object)
          NAME: UNAME `otherdataset'	SELECT ID: STRING `s_32_11'	TABLE ID: STRING `s_32_12_t12'	EQUIV: LONG 15
        SELECT ID: STRING `s_32_11'
        TABLE ID: STRING `s_32_12_t12'
      (line 31) GRAPH PATTERN:OPTIONAL gp
        MEMBERS: ARRAY OF NODES with 1 children: {
          (line 30) GRAPH PATTERN:SERVICE gp
            MEMBERS: ARRAY OF NODES with 1 children: {
              (line 30) GRAPH PATTERN:SELECT result-mode
                MEMBERS: EMPTY ARRAY
                SUBQUERY: (line 30) REQUEST TOP NODE (SELECT result-mode):
                  VALMODE FOR RETVALS: STRING `AUTO'
                  RDF DATA STORAGE: UNAME `http://www.openlinksw.com/schemas/virtrdf#DefaultServiceStorage'
                  RETVALS: ARRAY OF NODES with 2 children: {
                    (line 0) ALIAS:
                      ALIAS NAME: UNAME `abs'
                      VALUE: (line 25) VARIABLE: notNULL exported
                        NAME: UNAME `abs'	SELECT ID: STRING `s_30_7'	TABLE ID: LONG 0	EQUIV: LONG 8
                    (line 0) ALIAS:
                      ALIAS NAME: UNAME `otherdataset'
                      VALUE: (line 25) VARIABLE: notNULL reference exported
                        NAME: UNAME `otherdataset'	SELECT ID: STRING `s_30_7'	TABLE ID: LONG 0	EQUIV: LONG 7
                   }
                  RETVALS SELECT ID: STRING `s_30_7'
                  SOURCES: ARRAY OF NODES with 1 children: {
                    (line 14) DATA SOURCE: FROM (default)
                      IRI: UNAME `http://civiclab.or.tz/togd/dataset/school#'
                      EXPN: (line 13) QNAME:
                        IRI: UNAME `http://civiclab.or.tz/togd/dataset/school#'
                   }
                  PATTERN: (line 30) GRAPH PATTERN:WHERE gp
                    MEMBERS: ARRAY OF NODES with 1 children: {
                      (line 27) TRIPLE:
                        GRAPH: (line 13) QNAME:
                          IRI: UNAME `http://civiclab.or.tz/togd/dataset/school#'
                        SUBJECT: (line 27) VARIABLE: notNULL+ reference+ exported (subject)
                          NAME: UNAME `otherdataset'	SELECT ID: STRING `s_30_7'	TABLE ID: STRING `s_30_7_t0'	EQUIV: LONG 7
                        PREDICATE: (line 27) QNAME:
                          IRI: UNAME `http://dbpedia.org/ontology/abstract'
                        OBJECT: (line 27) VARIABLE: notNULL+ exported (object)
                          NAME: UNAME `abs'	SELECT ID: STRING `s_30_7'	TABLE ID: STRING `s_30_7_t0'	EQUIV: LONG 8
                        SELECT ID: STRING `s_30_7'
                        TABLE ID: STRING `s_30_7_t0'
                     }
                    FILTERS: EMPTY ARRAY
                    SELECT ID: STRING `s_30_7'
                    EQUIVS: 7 8
                FILTERS: EMPTY ARRAY
                SELECT ID: STRING `s_30_8'
                EQUIVS: 9 10
             }
            FILTERS: EMPTY ARRAY
            SELECT ID: STRING `s_30_9'
            OPTIONS: ARRAY OF NODES with 2 children: {
              LONG 1020
              (line 24) SERVICE INV:
                ENDPOINT: (line 23) QNAME:
                  IRI: UNAME `http://DBpedia.org/sparql'
                IRI PARAMS: EMPTY ARRAY
                SYNTAX: LONG -2147483520
                PARAM VARNAMES: ARRAY OF NODES with 1 children: {
                  UNAME `otherdataset'
                 }
                RSET VARNAMES: ARRAY OF NODES with 1 children: {
                  UNAME `abs'
                 }
                DEFINES: EMPTY ARRAY
             }
            EQUIVS: 17 19
         }
        FILTERS: EMPTY ARRAY
        SELECT ID: STRING `s_31_10'
        EQUIVS: 18 20
     }
    FILTERS: EMPTY ARRAY
    SELECT ID: STRING `s_32_11'
    EQUIVS: 11 12 13 14 15 16 21 22

EQUIVS:
#0: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 0 gspo, 0 const, 0 opt, 0 subq: l in; notNULL reference)
#1: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 0 gspo, 0 const, 0 opt, 0 subq: school_name in; notNULL)
#2: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 0 gspo, 0 const, 0 opt, 0 subq: lat in; notNULL)
#3: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 0 gspo, 0 const, 0 opt, 0 subq: long in; notNULL)
#4: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 0 gspo, 0 const, 0 opt, 0 subq: region in; notNULL reference)
#5: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 0 gspo, 0 const, 0 opt, 0 subq: region_name in; notNULL)
#6: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 0 gspo, 0 const, 0 opt, 0 subq: otherdataset in; notNULL)
#7: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 1 gspo, 1 const, 0 opt, 0 subq: otherdataset in s_30_7_t0 s_30_7; notNULL reference exported)
#8: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 1 gspo, 1 const, 0 opt, 0 subq: abs in s_30_7_t0 s_30_7; notNULL exported)
#9: ( 0 subv (0 bindings, 0 nest.opt.), 1 recv, 0 gspo, 0 const, 0 opt, 1 subq: abs in; notNULL exported)
#10: ( 0 subv (0 bindings, 0 nest.opt.), 1 recv, 0 gspo, 0 const, 0 opt, 1 subq: otherdataset in; notNULL reference exported)
#11: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 1 gspo, 1 const, 0 opt, 0 subq: school_name in s_32_11 s_32_12_t7; notNULL exported)
#12: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 1 gspo, 1 const, 0 opt, 0 subq: lat in s_32_11 s_32_12_t8; notNULL exported)
#13: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 1 gspo, 1 const, 0 opt, 0 subq: long in s_32_11 s_32_12_t9; notNULL exported)
#14: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 1 gspo, 1 const, 0 opt, 0 subq: region_name in s_32_11 s_32_12_t11; notNULL exported)
#15: ( 1 subv (1 bindings, 1 nest.opt.), 0 recv, 1 gspo, 1 const, 0 opt, 0 subq: otherdataset in s_32_11 s_32_12_t12; notNULL exported)
#16: ( 1 subv (1 bindings, 1 nest.opt.), 0 recv, 0 gspo, 1 const, 0 opt, 0 subq: abs in s_32_11; exported)
#17: ( 1 subv (1 bindings, 0 nest.opt.), 1 recv, 0 gspo, 0 const, 0 opt, 0 subq: abs in; notNULL exported)
#18: ( 1 subv (1 bindings, 0 nest.opt.), 1 recv, 0 gspo, 0 const, 0 opt, 0 subq: abs in; notNULL exported)
#19: ( 1 subv (1 bindings, 0 nest.opt.), 1 recv, 0 gspo, 0 const, 0 opt, 0 subq: otherdataset in; notNULL reference exported)
#20: ( 1 subv (1 bindings, 0 nest.opt.), 1 recv, 0 gspo, 0 const, 0 opt, 0 subq: otherdataset in; notNULL reference exported)
#21: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 4 gspo, 0 const, 0 opt, 0 subq: l in s_32_12_t10 s_32_12_t9 s_32_12_t8 s_32_12_t7;)
#22: ( 0 subv (0 bindings, 0 nest.opt.), 0 recv, 3 gspo, 0 const, 0 opt, 0 subq: region in s_32_12_t12 s_32_12_t11 s_32_12_t10;)

How to troubleshoot this message from the execution of the above query

Virtuoso 37000 Error SP031: SPARQL compiler: OpenLink Virtuoso SPARQL Query Editor does not support SPARQL-BI extensions (like nested SELECT) so SPARQL query can not be composed

I presume you are getting this error with Virtuoso 6.1? Have you run the LOAD SERVICE ... command as requested by @imikhailov in a previous post to this topic?

Hi

I executed the GRANT SPARQL_LOAD_SERVICE_DATA to "SPARQL" and SPARQL LOAD SERVICE <dbpedia.org/sparql> DATA. Both were successful in VOS 07.20.3229 (MAC OS) but in VOS 6.1 (Ubuntu 14.04) the GRANT SPARQL_LOAD-SERVICE_DATA command failed with the error below.

SQLState: 42000 Message: U0002: The object “SPARQL_LOAD_SERVICE_DATA” does not exist.

In all cases, the query above returns a same error message.

As said previously you should upgrade to latest Virtuoso 7.2 release, as discussed in you other top How to install VOS 7.2.x on ubuntu linux, as Virtuoso 6.1 is no longer supported.

1 Like

Thank you all for your useful replies. The original query has been successfully executed on a Virtuoso 8.2 evaluation instance on a MAC OS machine after normal configurations. But the execution time is too long.

These are the configuration steps followed:

  1. grant select on "DB.DBA.SPARQL_SINV_2" to “SPARQL”;
  2. grant execute on "DB.DBA.SPARQL_SINV_IMP" to "SPARQL";
  3. grant SPARQL_LOAD_SERVICE_DATA to "SPARQL";
  4. grant SPARQL_SPONGE to "SPARQL";

Thanks all

I am going to build it for test again.
Thanks

Have your performance tuned your Virtuoso instance as detailed in your other topic How to perform a scalability test of a virtuoso triple-store? ?

Thanks, @hwilliams. I have managed to play with scalability parameters and observe the results.