Hi Quentin,
I note your build was on Dec 3rd 2013, whereas there were major updated to the
develop/7 archive on Dec 5th, which is what my current VOS build was built
against and I do not get this extra triple your refer to:
SQL> status('');
REPORT
VARCHAR
_______________________________________________________________________________
OpenLink Virtuoso Server
Version 07.00.3207-pthreads for Darwin as of Dec 10 2013
Started on: 2014-02-02 18:45 GMT+0
Database Status:
File size 910163968, 111104 pages, 75321 free.
170000 buffers, 10915 used, 53 dirty 0 wired down, repl age 0 0 w. io 0
w/crsr.
Disk Usage: 10952 reads avg 1 msec, 0% r 0% w last 101 s, 129 writes,
101 read ahead, batch = 101. Autocompact 0 in 0 out, 0% saved.
Gate: 67 2nd in reads, 0 gate write waits, 0 in while read 0 busy scrap.
Log = /usr/local/vos7/database/virtuoso.trx, 2935 bytes
35390 pages have been changed since last backup (in checkpoint state)
Current backup timestamp: 0x0000-0x00-0x00
Last backup date: unknown
Clients: 1 connects, max 1 concurrent
RPC: 10 calls, 1 pending, 1 max until now, 0 queued, 0 burst reads (0%), 0
second 0M large, 3M max
Checkpoint Remap 304 pages, 0 mapped back. 0 s atomic time.
DB master 111104 total 75321 free 304 remap 1 mapped back
temp 1024 total 1019 free
Lock Status: 0 deadlocks of which 0 2r1w, 0 waits,
Currently 1 threads running 0 threads waiting 0 threads in vdb.
Pending:
23 Rows. -- 9 msec.
SQL> sparql insert into graph <DistinctTransitiveTest> { <S1> <P1> <S2> . <S1>
<P2> <S3> . <S3> <P2> <S4> . <S1> <Ptext> "111"^^xsd:string . <S2> <Ptext>
"222"^^xsd:string . <S3> <Ptext> "333"^^xsd:string . <S4> <Ptext>
"444"^^xsd:string . <S1> a <http://example.com/FirstClass> . <S2> a
<http://example.com/SecondClass> . <S3> a <http://example.com/ThirdClass> .
<S4> a <http://example.com/FourthClass> . };
Done. -- 2 msec.
SQL> sparql select distinct ?G ?S ?P ?O where { GRAPH ?G {FILTER ( ?G in
(<DistinctTransitiveTest>)) { { select distinct ?anchor { ?anchor a ?class .
FILTER ( ?anchor in (<S1>)) } LIMIT 1 OFFSET 0 } ?anchor ?anchorPred ?S
OPTION ( TRANSITIVE, t_min (0), t_max (1), t_in (?anchor),
t_out (?S), t_no_cycles, t_distinct ) . ?S ?P ?O . }}};
G
S
P
O
VARCHAR
VARCHAR
VARCHAR
VARCHAR
_______________________________________________________________________________
DistinctTransitiveTest
S2
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://example.com/SecondClass
DistinctTransitiveTest
S3
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://example.com/ThirdClass
DistinctTransitiveTest
S3
Ptext
http://example.com/ThirdClass
DistinctTransitiveTest
S2
Ptext
222
DistinctTransitiveTest
S3
P2
333
5 Rows. -- 3 msec.
SQL>
There have also been some major updates to develop/7 over the last week, thus
you should update your build. Note you can track the develop/7 updates with the
following atom RSS feed:
https://github.com/openlink/virtuoso-opensource/commits/develop%2F7.atom
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 31 Jan 2014, at 06:16, Quentin <quent...@clearbluewater.com.au> wrote:
> Hi Hugh,
>
> Virtuoso7,December release
> Virtuoso Open Source Edition (Column Store) (multi threaded)
> Version 7.0.1-dev.3207-pthreads as of Dec 3 2013
> Compiled for Linux (x86_64-unknown-linux-gnu)
>
> I'm trying to use a transitivity in sparql to get related entities from an
> anchor subject. I've run into several issues that appear to be bugs.
>
> Given test data as below:
> sparql
> insert into graph <DistinctTransitiveTest>
> {
> <S1> <P1> <S2> .
> <S1> <P2> <S3> .
> <S3> <P2> <S4> .
> <S1> <Ptext> "111"^^xsd:string .
> <S2> <Ptext> "222"^^xsd:string .
> <S3> <Ptext> "333"^^xsd:string .
> <S4> <Ptext> "444"^^xsd:string .
> <S1> a <http://example.com/FirstClass> .
> <S2> a <http://example.com/SecondClass> .
> <S3> a <http://example.com/ThirdClass> .
> <S4> a <http://example.com/FourthClass> .
> }
> ------------------------------------
> My base query is:
> sparql
> select distinct ?G ?S ?P ?O
> where { GRAPH ?G {FILTER ( ?G in (<DistinctTransitiveTest>))
> {
> { select distinct ?anchor {
> ?anchor a ?class .
> FILTER ( ?anchor in (<S1>))
> } LIMIT 1 OFFSET 0
> }
>
> ?anchor ?anchorPred ?S
> OPTION ( TRANSITIVE,
> t_min (0),
> t_max (1),
> t_in (?anchor),
> t_out (?S),
> t_no_cycles,
> t_distinct ) .
> ?S ?P ?O .
> }}}
> -----------------------------
> This generates results as:
> G
> ANY S
> ANY P
> ANY O
> ANY
> DistinctTransitiveTest S2
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> http://example.com/SecondClass
> DistinctTransitiveTest S3
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> http://example.com/ThirdClass
> DistinctTransitiveTest S2 P2 http://example.com/SecondClass
> DistinctTransitiveTest S2 Ptext 222
> DistinctTransitiveTest S3 Ptext 333
> DistinctTransitiveTest S3 P2 S4
> No. of rows in result: 6
>
> But where did the below binding come from? It's not in my data in any form.
> That's problem one.
> > DistinctTransitiveTest S2 P2 http://example.com/SecondClass
>
> Problem two is when I want to filter by the anchorPredicate.
> Adding "FILTER ( ?anchorPred in ((<P1>),<P2>))" directly after the transitive
> clause causes zero bindings even though all of S2 and S3 entities ought to
> bind. Returning ?anchorPred in the select shows me that it appears to be a
> real variable that can be filtered on.
>
>
>
> Problem three is when I try to filter by the class of S2/S3 (removing the
> anchorPred filter as that has already failed me). Adding "?S a ?class .
> FILTER ( ?class in (<http://example.com/SecondClass>)) " directly after the
> transitive clause I get a single binding for ?S ?P ?O. The rest of S2 fails
> to bind.
> > DistinctTransitiveTest S2
> > http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> > http://example.com/SecondClass
>
> However, if I then expand the ?class filter to be "filter ( ?class in
> (<http://example.com/SecondClass>, <http://example.com/ThirdClass>))", I get
> all the results I expect, all of both S2 and S3.
>
> I'm a bit confused by these results which is unfortunate as it seems quite a
> powerful feature if I could get it to work consistently.
>
> --
> Quentin | Clear Blue Water Pty Ltd
> quent...@clearbluewater.com.au
> ------------------------------------------------------------------------------
> WatchGuard Dimension instantly turns raw network data into actionable
> security intelligence. It gives you real-time visual feedback on key
> security issues and trends. Skip the complicated setup - simply import
> a virtual appliance and go from zero to informed in seconds.
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk_______________________________________________
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable
security intelligence. It gives you real-time visual feedback on key
security issues and trends. Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users