QueryEval: Logical service query cannot be evaluated

Hi, I got exception error thrown out as
QueryEval: Logical service query cannot be evaluated
when I am trying to query from virtual graph and join with another sparql endpoint using service.
Is this type of query not supported by Stardog?
Query:

SELECT ?child ?name ?lei ?country ?city ?street  ?type ?ultiparent
{
   graph <virtual://db1> {
      ?ultiparent ^relationship:UltimateParent ?child;
          party:hasName "Everest Re Group, Ltd." .
     ?child   party:hasName ?name .
     ?child ^relationship:hasChild ?Relation.
     ?Relation relationship:hasParent ?directparent.
     ?directparent party:hasName ?directparentname .
     ?Relation a ?type.
   optional {
      {
        ?child owl:sameAs ?lei.
            {
                SERVICE <https://lei.info/sparql> {
                    GRAPH ?g {
 
                         ?lei voc-l1:legalName ?legalName .
                         ?lei voc-l1:legalAddress ?legalAddress .
                         ?legalAddress voc-l1:country ?country . 
                         ?legalAddress voc-l1:city ?city .
                         ?legalAddress voc-l1:streetAddress ?street .
                         ?legalAddress voc-l1:postalCode ?postalCode .
                    }
                 }
             }
         }  
      }  
    }
}

Hi Vivian,

Stardog does not support a SERVICE block inside a virtual graph block. Is the owl:sameAs coming from the virtual graph? You will have to move that pattern to a separate block to join in an OPTIONAL, eg:

graph <virtual://...> {
   ?child ..
}
OPTIONAL {
  graph <virtual://...> { 
    ?child owl:sameAs ?lei
  }
  service <...> { 
    ?lei ...
  }
}

Jess

Jess, thanks. I put the service to a separate block, this time no error, but no return result. I did a quick test trying to isolate the problem.

  1. Create a db using studio with all default setting.

  2. Insert 1 triple for lei id.

@prefix lei-info: <http://lei.info/> .
@prefix party: <http://example.com/data/> .

party:12345 owl:sameAs lei-info:549300N24XF2VV0B3570 .
  1. Run following query, return the result
prefix lei-info: <http://lei.info/> 
PREFIX voc-l1: <http://lei.info/voc/l1/>
PREFIX voc-l2: <http://lei.info/voc/l2/>
prefix party: <http://example.com/data/> 

SELECT ?party  ?lei ?country ?city ?street 
{  
      party:12345 owl:sameAs ?lei. 
     { SERVICE <https://lei.info/sparql> {
                    GRAPH ?g {
                         ?lei voc-l1:legalName ?legalName .
                         ?lei voc-l1:legalAddress ?legalAddress .
                         ?legalAddress voc-l1:country ?country . 
                         ?legalAddress voc-l1:city ?city .
                         ?legalAddress voc-l1:streetAddress ?street .
                         ?legalAddress voc-l1:postalCode ?postalCode .
                    }
                 }
             }
         }  
  1. Run the same query #3 again. The query hung and return with error: 000012: org.apache.http.client.ClientProtocolException

Do you see this kind of issues? what could cause? It can be duplicated.