Re: [Virtuoso-users] Generating a unique ID via SPARQL HTTP

2010-11-19 Thread Ivan Mikhailov
Hello Aldo, I'd suggest to use SQL BIFs sequence_next() and sequence_set(). Like any other functions without INOUT or OUT parameters, they can be called from SPARQL as bif:sequence_next() / bif:sequence_set() http://docs.openlinksw.com/virtuoso/fn_sequence_next.html http://docs.openlinksw.com/vir

[Virtuoso-users] Generating a unique ID via SPARQL HTTP

2010-11-19 Thread Aldo Bucchi
Hi, Problem * I need to generate unique IDs from within Virtuoso ( unique only to a given Virtuoso instance/cluster would suffice ) * I need to do this via SPARQL HTTP prior to issuing a SPARQL insert Current solution: Create a table and procedure that keeps track of an incremental ID and returns

Re: [Virtuoso-users] Query performance problem

2010-11-19 Thread Sebastian Trüg
And now for the amazing result: replacing the "?r nao:userVisible 1" with a bif:exists filter makes the query blazingly fast. Then again this is probably not that amazing after all since the query without the restriction is fast, thus, filtering on those results would be, too. Still, it is a fun

Re: [Virtuoso-users] Query performance problem

2010-11-19 Thread Sebastian Trüg
Hi Ivan, thanks a lot for your answer. Funnily enough your query version does not make a difference. The query takes about the same time. Sadly I cannot add any conditions on the graph since all is in different graphs. I know this is not great for Virtuoso but we use graphs for metadata on stateme

Re: [Virtuoso-users] Query performance problem

2010-11-19 Thread Ivan Mikhailov
Hello Sebastian, One variant to check is select distinct ?r (bif:concat(bif:search_excerpt(bif:vector('lego'), ?v2))) as ?_n_f_t_m_ex_ where { {{select distinct ?r ?v2 where { ?r ?v1 ?v2 . ?v2 bif:contains 'lego' . ?r nao:userVisible "1"^^xsd:int . } limit 10 } }

[Virtuoso-users] Query performance problem

2010-11-19 Thread Sebastian Trüg
Hi list, as always my question is about query performance. The following very simple query performs very well on a V6.3rc1 with default indexes: select distinct ?r (bif:concat(bif:search_excerpt(bif:vector('lego'), ?v2))) as ?_n_f_t_m_ex_ where { { ?r ?v1 ?v2 . ?v2 bif:contai