Feature Request: PATHS sub-select for ?x and ?y

It would be very useful if you could use a where clause for the ?x and ?y

for example

PATHS 
   STARTS ?x= {
       ex:1 ex:StartsAt ?x 
    }
    ENDS ?y= {
        ex:1 ex:EndsAt ?y
    }
VIA  ex:ReadsFrom

Hi Serge,

You can absolutely do this, your syntax is just a tiny bit off:

PATHS 
   START ?x {
       ex:1 ex:StartsAt ?x 
    }
    END ?y {
        ex:1 ex:EndsAt ?y
    }
VIA  ex:ReadsFrom

Ah, so close. Been doing it manually for 4 week for nothing. I created this post as I got annoyed. :-).

Thanks.
-Serge

@stephen

I have the following query

PATHS START ?x {
        values(?circuit) {
                (asset:CIRCUIT_215889881)
        }
        
        ?circuit asset:ConsistsOf ?route . 
        ?fiber asset:Next ?route .  
        ?x asset:ReadsFrom ?fiber
}
END ?y
{
        values(?circuit) {
               (asset:CIRCUIT_215889881)
        }

        ?circuit asset:ConsistsOf ?route . 
        ?route asset:Next ?fiber .  
        ?fiber asset:ReadsFrom ?y
}
VIA {
        ?x asset:ReadsFrom ?y . 
}

which returns nothing, however if I hard code the ?y value to the result of it's select block it will return the expected path. Attach are the query plan.

explanation.zip (2.1 KB)

Furthermore, I just tried hard coding ?x and it work too. It seem to have problems only when I am using select blocks on both ?x and ?y

Can you provide a minimal data set that reproduces this behavior? Additionally, what version of Stardog are you using?

@stephen

my bad, I thought the blocks were independent of each other, and it is not. After adjusting my query to this

PATHS START ?x {
values(?circuit) {
(asset:CIRCUIT_215889881)
}

    ?circuit asset:ConsistsOf ?route . 
    ?fiber1 asset:Next ?route .  
    ?x asset:ReadsFrom ?fiber1

}
END ?y
{
?route asset:Next ?fiber2 .
?fiber2 asset:ReadsFrom ?y
}
VIA {
?x asset:ReadsFrom ?y .
}

it works. Sorry for the trouble

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.