Hi Paul,

The difference between the two queries is initial
"?item schema:about ?cbbObject." in the second one.

If you reverse the order of SERVICE and local pattern match, you may get better execution.

{ ?item schema:about ?cbbObject.
   {SELECT ?cbbObject ?cbbnr ?cbbObjectType ?cbbNaam
    ...
   }
}

==>

{
   {SELECT ?cbbObject ?cbbnr ?cbbObjectType ?cbbNaam
    ...
   }
   ?item schema:about ?cbbObject.
}

Please let the list know if this helps,

    Andy

On 21/02/18 08:30, Paul Hermans wrote:
Using Fuseki 3.6.0 and also Fuseki 3.4.0 with TDB backend.

Query 1 returns 1 result immediately

PREFIX dct: <http://purl.org/dc/terms/>
PREFIX schema: <http://schema.org/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT ?cbbObject ?cbbnr ?cbbObjectType ?cbbNaam
   WHERE {
   SERVICE <xxx> {
   VALUES ?cbbnr {'00418870043670'}
   ?cbbObject a  ?cbbObjectType;
   <http://www.w3.org/2000/01/rdf-schema#label> ?cbbNaam ;
    dct:identifier ?cbbnr . }}



Query 2 with the previous as a subselect runs forever.

PREFIX dct: <http://purl.org/dc/terms/>
PREFIX schema: <http://schema.org/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT *
WHERE
{ ?item schema:about ?cbbObject.
{SELECT ?cbbObject ?cbbnr ?cbbObjectType ?cbbNaam
   WHERE {
   SERVICE <http://lodcbbomv-on-1.vm.cumuli.be:8080/lodomv/repositories/cbb> {
   VALUES ?cbbnr {'00418870043670'}
   ?cbbObject a  ?cbbObjectType;
   <http://www.w3.org/2000/01/rdf-schema#label> ?cbbNaam ;
   dct:identifier ?cbbnr . }}}}
LIMIT 1

The same query in Virtuoso and Stardog returns a result within 1 sec.

What am I missing?


Kind Regards,
Paul Hermans

Reply via email to