Hi Quentin,

Your (crash) query gives the following error against my local instance (with 
the data loaded) and even against DBpedia:

Virtuoso 37000 Error TR...: T_STEP argument refers to an index 2 of a column s 
that is not in T_IN list (T_DIRECTION is set to 1)

SPARQL query:
define sql:big-data-const 0 
#output-format:text/html
define sql:signal-void-variables 1 define input:default-graph-uri 
<http://dbpedia.org> prefix : <http://example.org/ontology/test/>
with <http://example.org/dataset/test/>
SELECT 
*
WHERE
  {
    {
      SELECT ?anchor ?s ?p ?o
      WHERE
        {
          ?anchor ?pred ?s .
          ?s ?p ?o .
        }
    }
    OPTION ( TRANSITIVE,
             t_distinct,
             t_in(?anchor),
             t_out(?s),
             t_min (0),
             t_max (3) ,
t_no_cycles, 
  t_step (?s) as ?link, t_step ('path_id') as ?path,
             t_step ('step_no') as ?dist ) .
    FILTER ( ?anchor = <http://example.org/data/test/DummyClass_1>)
  }
ORDER BY ?dist

Additional information on transitivity and the t_direction param can be found 
in the Virtuoso SQL documentation, which SPARQL makes use of, at:

        
http://docs.openlinksw.com/virtuoso/transitivityinsQL.html#transitivityinsQL

Best Regards
Hugh Williams
Professional Services
OpenLink Software, Inc.      //              http://www.openlinksw.com/
Weblog   -- http://www.openlinksw.com/blogs/
LinkedIn -- http://www.linkedin.com/company/openlink-software/
Twitter  -- http://twitter.com/OpenLink
Google+  -- http://plus.google.com/100570109519069333827/
Facebook -- http://www.facebook.com/OpenLinkSoftware
Universal Data Access, Integration, and Management Technology Providers

On 3 Dec 2013, at 07:48, Quentin <quent...@clearbluewater.com.au> wrote:

> Prematurely sent.
> 
> The query that gets me 'almost' there is:
> =========================
> prefix : <http://example.org/ontology/test/>
> with <http://example.org/dataset/test/>
> SELECT 
> *
> WHERE
>   {
>     {
>       SELECT ?anchor ?s ?p ?o
>       WHERE
>         {
>           ?anchor ?anchorPred ?s .
>           ?s ?p ?o .
>         }
>     }
>     OPTION ( TRANSITIVE,
>              t_distinct,
>              t_in(?anchor),
>              t_out(?s),
>              t_min (0),
>              t_max (3) ,
> t_no_cycles, 
>   t_step (?anchor) as ?link, t_step ('path_id') as ?path,
>              t_step ('step_no') as ?dist ) .
>     FILTER ( ?anchor = <http://example.org/data/test/DummyClass_1>)
>   }
> ORDER BY ?dist
> =========================
> 
> 
> On 3 December 2013 18:47, Quentin <quent...@clearbluewater.com.au> wrote:
> 
> Assuming some data as below:
> ========================================
> prefix : <http://example.org/ontology/test/>
> with <http://example.org/dataset/test/>
> insert
> {
> <http://example.org/data/test/DummyClass_1> a :DummyClass .
> <http://example.org/data/test/DummyClass_1> :predA "Entity 1" .
> <http://example.org/data/test/DummyClass_1> :objPred  
> <http://example.org/data/test/DummyClass_2> .
> <http://example.org/data/test/DummyClass_2> a :DummyClass .
> <http://example.org/data/test/DummyClass_2> :predA "Entity 2" .
> <http://example.org/data/test/DummyClass_2> :objPred  
> <http://example.org/data/test/DummyClass_3> .
> <http://example.org/data/test/DummyClass_3> a :DummyClass .
> <http://example.org/data/test/DummyClass_3> :predA "Entity 3" .
> <http://example.org/data/test/DummyClass_3> :objPred  
> <http://example.org/data/test/DummyClass_4> .
> <http://example.org/data/test/DummyClass_4> a :DummyClass .
> <http://example.org/data/test/DummyClass_4> :predA "Entity 4" .
> <http://example.org/data/test/DummyClass_4> :objPred  
> <http://example.org/data/test/DummyClass_1> .
> }
> ========================================
> I want to get some results back that include every triple from some anchor 
> point to a given depth.  So, say I start with 
> <http://example.org/data/test/DummyClass_1> and use depth 2, I'd like to get 
> everything for DummyClass_1/DummyClass_2/DummyClass_3 but not DummyClass_4.
> 
> I figure this might be possible with transitivity and the OPTION clause but I 
> can't seem to get more than about 90% to what I need.
> 
> 
> 
> 
> 
> 
> Secondly, I got a DB crash doing this query with the below data:
> ===================================================
> prefix : <http://example.org/ontology/test/>
> with <http://example.org/dataset/test/>
> SELECT 
> *
> WHERE
>   {
>     {
>       SELECT ?anchor ?s ?p ?o
>       WHERE
>         {
>           ?anchor ?pred ?s .
>           ?s ?p ?o .
>         }
>     }
>     OPTION ( TRANSITIVE,
>              t_distinct,
>              t_in(?anchor),
>              t_out(?s),
>              t_min (0),
>              t_max (3) ,
> t_no_cycles, 
>   t_step (?s) as ?link, t_step ('path_id') as ?path,
>              t_step ('step_no') as ?dist ) .
>     FILTER ( ?anchor = <http://example.org/data/test/DummyClass_1>)
>   }
> ORDER BY ?dist
> ===================================================
> I'm pretty sure this is because I used ?s in the t_step parameter instead of 
> ?anchor but I'm not quite sure why this caused a crash.
> This seems to occur on DBPedia also (sorry).
> 
> -- 
> Quentin | Clear Blue Water Pty Ltd
> quent...@clearbluewater.com.au
> 
> 
> 
> -- 
> Quentin | Clear Blue Water Pty Ltd
> quent...@clearbluewater.com.au
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT 
> organizations don't have a clear picture of how application performance 
> affects their revenue. With AppDynamics, you get 100% visibility into your 
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk_______________________________________________
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to