Nathan wrote:
> Hi,
>
> Please see: http://bit.ly/9Gli76
>
> it always seems to show the T_SHORTEST_ONLY (shortest path) between two
> nodes; any way to see all paths?
>
> SELECT ?x ?y ?via ?dist WHERE
> {
> { SELECT * WHERE { ?x skos:broader ?y } }
> OPTION ( TRANSITIVE, t_distinct, t_in(?x), t_out(?y), t_max(10),
> t_step(?x) as ?via, t_step('step_no') AS ?dist ) .
> FILTER ( ?x =
> <http://dbpedia.org/resource/Category:XML-based_standards> && ?y =
> <http://dbpedia.org/resource/Category:Main_topic_classifications> )
> }
>
I'm getting good at doing this.. figured it out; T_DISTINCT was limiting
the results, thus I removed it, added in T_NO_CYCLES and then forced the
direct to be the right way using T_DIRECTION 1, (which speeded up the
query massively & stopped it running out of memory) - new query is as
follows:
SELECT ?x ?y ?via ?dist ?path WHERE
{
{ SELECT * WHERE { ?x skos:broader ?y } }
OPTION ( TRANSITIVE, T_NO_CYCLES, t_in(?x), t_out(?y), t_max(6),
t_step('path_id') as ?path, t_step(?x) as ?via, t_step('step_no') AS
?dist, T_DIRECTION 1 )
. FILTER ( ?x =
<http://dbpedia.org/resource/Category:XML-based_standards> && ?y =
<http://dbpedia.org/resource/Category:Main_topic_classifications> )
}
also has additional max steps / distance of 6 and path identifier added
in so we can analyse each specific route.
loving virtuoso! - still trying to get to the following end; so if you
know a quicker way, do let me know.
ps: docs on transitivity here:
http://docs.openlinksw.com/virtuoso/transitivityinsQL.html
nathan
> whilst an "issue" this is only an interim query en-route to what I'm
> trying to do; in reality what I want to do is find all paths between
> multiple nodes and a route node which i specify (all paths between
> ?category in(x,y,z) and Category:Main_topic_classifications) then find
> the intersections with the shortest route; ie that if you follow the
> skos:broader of the cat tree up you'll find that Category:Semantic_Web
> and Category:HTML intersect at Category:World_Wide_Web so that one can
> infer that when something has these two categories it is in the broader
> topic of World_Wide_Web.
>
> If the aforementioned isn't an easy hit then just how to find all paths
> will do the trick and I can UNION up some results and filter to get what
> I want.
>
> Many Regards,
>
> Nathan
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Virtuoso-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>
>