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