Re: [Virtuoso-users] Query optimization, possible indexing?

2018-01-24 Thread Quentin

Hi Hugh,

In your example, you have this query:

SELECT  ?s WHERE   { ?s  base:name  "test_sensor" };


But the data is:
s
 o   
  datatype
LONG VARCHAR 
 LONG VARCHAR
  LONG VARCHAR

___
http://base.org#x1   
 test_sensor 
  http://www.w3.org/2001/XMLSchema#string



Would you expect a query for string literals to return xsd typed 
strings?
I've always found that filtering or querying over string literals would 
not be successful unless everything was very carefully typed.


I note that Jason tried xsd types in his queries in the first instance, 
so that's probably not actually the issue here.

--
Regards,
Quentin Serrurier.
GuidingHand.Solutions

On 2018-01-25 07:34, Hugh Williams wrote:

Hi Jason,

I have been able to compile and run your program and can see the 
problem:


De-iMac-232:virtuoso_driver hwilliams$ javac -classpath
".:../lib-3.3.0/commons-lang3-3.4.jar:../lib-3.3.0/jena-arq-3.3.0-SNAPSHOT.jar:../lib-3.3.0/jena-iri-3.3.0-SNAPSHOT.jar:../lib-3.3.0/jena-base-3.3.0-SNAPSHOT.jar:../lib-3.3.0/jena-core-3.3.0-SNAPSHOT.jar:../../../libsrc/JDBCDriverType4/virtjdbc4.jar:../virt_jena3.jar:../lib-3.3.0/jcl-over-slf4j-1.7.21.jar:../lib-3.3.0/log4j-1.2.17.jar:../lib-3.3.0/slf4j-api-1.7.21.jar:../lib-3.3.0/slf4j-log4j12-1.7.21.jar:../lib-3.3.0/xercesImpl-2.11.0.jar:../lib-3.3.0/xml-apis-1.4.01.jar:../lib-3.3.0/jena-shaded-guava-3.3.0-SNAPSHOT.jar:../lib-3.3.0/libthrift-0.9.3.jar:../lib-3.3.0/sparql-generate-jena-1.0.jar:../lib-3.3.0/jena-arq-3.3.0-SNAPSHOT.jar:../lib-3.3.0/httpclient-4.5.2.jar:../lib-3.3.0/httpclient-cache-4.5.2.jar"
Tester.java
De-iMac-232:virtuoso_driver hwilliams$ java -classpath
".:../lib-3.3.0/commons-lang3-3.4.jar:../lib-3.3.0/jena-arq-3.3.0-SNAPSHOT.jar:../lib-3.3.0/jena-iri-3.3.0-SNAPSHOT.jar:../lib-3.3.0/jena-base-3.3.0-SNAPSHOT.jar:../lib-3.3.0/jena-core-3.3.0-SNAPSHOT.jar:../../../libsrc/JDBCDriverType4/virtjdbc4.jar:../virt_jena3.jar:../lib-3.3.0/jcl-over-slf4j-1.7.21.jar:../lib-3.3.0/log4j-1.2.17.jar:../lib-3.3.0/slf4j-api-1.7.21.jar:../lib-3.3.0/slf4j-log4j12-1.7.21.jar:../lib-3.3.0/xercesImpl-2.11.0.jar:../lib-3.3.0/xml-apis-1.4.01.jar:../lib-3.3.0/jena-shaded-guava-3.3.0-SNAPSHOT.jar:../lib-3.3.0/libthrift-0.9.3.jar:../lib-3.3.0/sparql-generate-jena-1.0.jar:../lib-3.3.0/jena-arq-3.3.0-SNAPSHOT.jar:../lib-3.3.0/httpclient-4.5.2.jar:../lib-3.3.0/httpclient-cache-4.5.2.jar"
Tester
log4j:WARN No appenders could be found for logger (Jena).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig
for more info.
failed!
De-iMac-232:virtuoso_driver hwilliams$

In fact turning Virtuoso tracing on (with the “trace_on();” function)
I see the query being run against Virtuoso by the Jena layer is:

SPARQL define input:default-graph-uri   PREFIX  xsd:
<http://www.w3.org/2001/XMLSchema#> PREFIX  base: <http://base.org#>
SELECT  ?s WHERE   { ?s  base:name  "test_sensor" };

which when I run against “isql”  also returns no results:

SQL> SPARQL define input:default-graph-uri   PREFIX  xsd:
<http://www.w3.org/2001/XMLSchema#> PREFIX  base: <http://base.org#>
SELECT  ?s WHERE   { ?s  base:name  "test_sensor" };
s
LONG VARCHAR
___


0 Rows. -- 2 msec.
SQL>

Nor does even:

SQL> SPARQL define input:default-graph-uri   PREFIX  xsd:
<http://www.w3.org/2001/XMLSchema#> PREFIX  base: <http://base.org#>
SELECT  ?s WHERE   { ?s  ?p  "test_sensor" };
s
LONG VARCHAR
___


0 Rows. -- 2 msec.
SQL>

But the following does:

SQL> SPARQL define input:default-graph-uri   PREFIX  xsd:
<http://www.w3.org/2001/XMLSchema#> PREFIX  base: <http://base.org#>
SELECT  ?s WHERE   { ?s  ?p  ?o };
s
LONG VARCHAR
___

http://base.org#x1
http://base.org#x2

2 Rows. -- 5 msec.
SQL>

Which is strange as my  test case does work with the same type of
query and both literal values are string types:

SQL> SPARQL define input:default-graph-uri   PREFIX  xsd:
<http://www.w3.org/2001/XMLSchema#> PREFIX  base: <http://base.org#>
SELECT  ?s ?o ?datatype WHERE   { ?s  ?p  ?o . BIND (DATATYPE(?o) as
?datatype)};
s
   o
  datatype
LONG VARCHAR
   

Re: [Virtuoso-users] [SPAM] Cannot upload RDF: invalid data

2017-09-28 Thread Quentin
 

Pasquale, 

Since RDF data isn't order dependant, troubleshooting bulk uploads is
fairly easy to do in a binary-tree fashion. 

First thing to do is to attempt to load your prefixes and a single
triple though, if that works then you just repeatedly halve and load the
triples until you get a small enough block to inspect and find the
error. 

If your bulk loading process is amenable then you can also break it into
quite small batchs and just inspect the problematic batch manually. 

-- 
Regards,
Quentin Serrurier.
GuidingHand.Solutions

On 2017-09-28 19:51, Pasquale Di Donato wrote: 

> Dear list, 
> 
> I'm trying to upload the RDF triples in VOS (07.20.3217) and I get an error: 
> 
> "You have attempted to upload invalid data. You can only upload RDF" 
> 
> Can someone tell me what is wrong in these triples: 
> 
> https://jpst.it/15sc0 [3] 
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot [1]
> 
> ___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users [2]
 

Links:
--
[1] http://sdm.link/slashdot
[2] https://lists.sourceforge.net/lists/listinfo/virtuoso-users
[3] https://jpst.it/15sc0
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] SPARQL endpoint Update permissions

2017-04-04 Thread Quentin
 

Hi, 

I'd certainly suggest disabling Update permission on the Sparql user for
the reasons you mention. 

You can then make a second user for the purpose of authorised
transactions and use this against the /sparql-auth endpoint which you'll
need to enable and configure. I believe that will do what you want. 

This will give you some hints but you'll need to do a little more
research to get sparql-auth set up. I believe it's available in the
open-source version though it's been a while since I used it. 

https://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtTipsAndTricksDigestAuthAJAX


-- 
Regards,
Quentin Serrurier.
GuidingHand.Solutions

On 2017-04-04 21:54, Iker Esnaola wrote: 

> Hello, 
> 
> I am trying to update my Graph by means of the SPARQL endpoint and the 
> following query: 
> 
> DELETE {?s rdf:type "A "}
> 
> INSERT {?s rdf:type "B" }
> 
> from 
> 
> WHERE { ?s rdf:type "A"}
> 
> I am getting the following error: Virtuoso 42000 Error SR186:SECURITY: No 
> permission to execute procedure DB.DBA.SPARQL_MODIFY_BY_DICT_CONTENTS with 
> user ID 107, group ID 107
> 
> After giving SPARQL_UPDATE permissions to the "SPARQL" user, there is no such 
> a problem and I am able to perform the query. 
> 
> However, my SPARQL endpoint is public so this is not a good practice. 
> 
> I have been looking for information in this matter but I didn't find anything 
> decisive. Is there any possibility of login in the SPARQL endpoint? I am 
> thinking of some way of enabling certain users to update the content (e.g. 
> administrators) while leaving the rest of the users with only query 
> permissions. 
> 
> Thanks in advance, 
> 
> IKER ESNAOLA GONZALEZ 
> 
> Informazio-Sistema Adimenduen Unitatea 
> 
> Sistemas de Información Inteligentes 
> 
> Intelligent Information Systems Unit 
> 
> iker.esna...@tekniker.es 
> 
> +34 943 20 67 44 Ext: 9608 
> 
> PARKE TEKNOLOGIKOA 
> 
> C/ Iñaki Goenaga, 5 
> 
> 20600 Eibar, Gipuzkoa (Spain) 
> 
> Tel.: +34 943 20 67 44 
> 
> [3] [4] [5] [6] [7] 
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot [1]
> 
> ___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users [2]
 

Links:
--
[1] http://sdm.link/slashdot
[2] https://lists.sourceforge.net/lists/listinfo/virtuoso-users
[3] https://www.youtube.com/user/Teknikertv
[4] https://twitter.com/ik4_tekniker
[5] https://www.flickr.com/people/teknikerik4/
[6] http://es.slideshare.net/teknikerik4
[7] http://issuu.com/ik4-tekniker
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Scope of log_enable and effect on deletes

2017-02-21 Thread Quentin
 

>From the manual: 

>While log on and off setting alone is reset at the end of the transaction so 
>that one does not end up with logging disabled by accident, the row-by-row 
>autocommit mode causes the setting to be permanent inside the calling 
>connection or web request. That is, for a SQL client the setting stays in 
>effect until changed or disconnected and for a web request it stays in effect 
>until the request is completed. 

http://docs.openlinksw.com/virtuoso/fn_log_enable/ 

If you want to determine whether the log is still disabled at a point in
time then this is one round-about way of doing it: 

>Attempt to disable transaction log that is disabled already result in an 
>error. If the second parameter is passed and it is not equal to zero then the 
>error is suppressed (and it's still possible to turn on or off autocommit). 

Set an exception handler to catch that error and set a flag to indicate
that the log was previously disabled. If there's no error/flag set then
proceed to re-enable the log. 

There might be better ways of doing it but that should work. 

-- 
Regards,
Quentin Serrurier.
GuidingHand.Solutions

On 2017-02-22 02:01, Davis, Daniel (NIH/NLM) [C] wrote: 

> I am not sure I understand the scope of the log_enable() procedure. If I call 
> log_enable(2,1); in a stored procedure, I am sure that it will affect the 
> entire connection, but, will it affect other connections as well. Would it, 
> for instance, persist until reboot and affect other connections? How can I 
> verify this - is there any command that will output the current transaction 
> isolation level? 
> 
> Also, I have an inexplicable situation where my stored procedure loads a 
> dataset in NTriples format into a graph, and then does some processing on 
> that dataset. It is important for the processing that the graph be empty at 
> the beginning, e.g. before the load. Try as I might, I seem to end-up in 
> situations where the graph is not-empty, and I believe that this may be some 
> interaction between log_enable() and the delete statement. I would think 
> naively that log_enable(2,1); would have no effect on the serialization of 
> row-level operations *IN THE SAME CONNECTION*, but perhaps I misunderstand. 
> 
> Dan Davis, Systems/Applications Architect (Contractor), 
> 
> Office of Computer and Communications Systems, 
> 
> National Library of Medicine, NIH 
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot [1]
> 
> ___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users [2]
 

Links:
--
[1] http://sdm.link/slashdot
[2] https://lists.sourceforge.net/lists/listinfo/virtuoso-users
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Authenticating a service to use the SPARQL endpoint

2016-11-02 Thread Quentin
 

Hi Arun, 

OAuth can be done programatically but it's a little convoluted to do so.
In anycase, Virtuoso supports other forms of authentication than OAuth. 

https://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtTipsAndTricksDigestAuthAJAX


You haven't mentioned what kind of application you have but the above
technique could be ported to other languages than Javascript, I've
authenticated against /sparql-auth in PHP for example. 

-- 
Regards,
Quentin Serrurier.
GuidingHand.Solutions

On 2016-11-03 05:55, Arun Balagopalan wrote: 

> Hi all, 
> 
> I am trying to build a service that uses Virtuoso DB with DBpedia data. I've 
> got the setup to a point where the data is loaded and my client can query the 
> Virtuoso server using the public SPARQL endpoint. Now I want to secure access 
> to the server, ie allow only authorized applications to access the DB. 
> 
> I've looked at examples in the wiki that use Oauth, webid etc requiring a 
> user to login before queries cant be sent. For example 
> https://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtOAuthSPARQL 
> [3] 
> 
> In my case, my client application is basically the user and so the 
> credentials cannot be sent via browser. Is there a good way to do this in 
> Virtuoso? 
> 
> Thanks, 
> Arun 
> 
> --
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi [1]
> 
> ___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users [2]
 

Links:
--
[1] http://sdm.link/xeonphi
[2] https://lists.sourceforge.net/lists/listinfo/virtuoso-users
[3]
https://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtOAuthSPARQL--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Deleting large number of triples

2016-08-17 Thread Quentin
 

Hi Pantelis, 

If you want fine control over processing of results then Daniel's answer
is the way to go, PLSQL allows you to do basically anything with your
results. 

However it's not necessary in this instance I think. We can probably do
what you want with a subquery. Since you only want to process a select
number of records (subject to some memory constraint that you'll find
out by trial-and-error) then we can do this with a subquery in SPARQL.
Additionally, select statements have (or used to have) a hard limit of
10,000 results that might complicate the process. 

-- 

SPARQL DEFINE sql:log-enable 3 

WITH GRAPH 
DELETE {
?S ?P ?O .
} WHERE {
{ SELECT ?S ?P ?O 
{ ?S ?P ?O .
FILTER ( ?P =  )
} LIMIT 10 }
} 

-- 

This will delete 10 matching records at a time from the target graph,
filtering on the target predicate. 

Upscale as required and rerun as many times as required. 

If you want to do it more elegantly, put it in a PLSQL function similar
to Daniel's below and just loop it together with a select query and stop
the function when the select query finds zero count of matching
predicates. 

-- 

SELECT PCount FROM (
SPARQL
SELECT COUNT(*) as ?PCount FROM 
{
?S ?P ?O .
FILTER ( ?P =  )
} ) AS PCount... 

-- 

Make that a SELECT INTO and store the result, loop with the delete until
the result is zero. 

If you want to track progress, write the count at each iteration to the
debug log (http://docs.openlinksw.com/virtuoso/fn_dbg_printf/) and
restart Virtuoso in debug&foreground mode to display the debug
statements. 

That will eventually clean up your table. 

Regards, 

Quentin. 

Guiding Hand Solutions 

On 2016-08-17 22:54, Pantelis Natsiavas wrote: 

> Thank you for your advice Daniel. 
> 
> Actually I want to delete only the statements containing the specific 
> predicate. I don't want to delete all the triples containing the subject of 
> the predicate. As I have already said, I don't feel comfortable with the 
> DELETE queries. 
> Is my query wrong? Could you suggest the correct query? 
> 
> Kind regards, 
> Pantelis Natsiavas 
> 
> 2016-08-17 17:19 GMT+03:00 Davis, Daniel (NIH/NLM) [C] :
> 
> So, this has nothing to do with the large vector size, but just to be sure 
> the SPARQL is correct - do you wish to delete the subjects (and all their 
> triples) where the subject has the predicate, or just the predicate itself? 
> 
> As far as avoiding the maximum vector size, I think your best approach is to 
> limit the number of matches and repeat the query until there are no results, 
> maybe with a count query in-between. I have had to do similar sorts of 
> work-arounds to avoid the maximum # of results and maximum size of string 
> issues. For instance, my first attempts to export large NTriples files after 
> processing failed due to these issues. You may be able to adapt the code 
> below, but I think that a repeated deleted query limited to a # of triples 
> will be best in your case. 
> 
> Anyway, the code: 
> 
> CREATE PROCEDURE meshrdf_export(in graph_uri varchar, in file_name varchar) { 
> 
> DECLARE banner any; 
> 
> DECLARE env, ses any; 
> 
> DECLARE ses_len, max_ses_len any; 
> 
> SET isolation = 'uncommitted'; 
> 
> max_ses_len := 1000; 
> 
> -- 
> 
> -- Truncate file and write a comment line indicating the graph and datetime 
> of export. 
> 
> -- 
> 
> --no_c_escapes- 
> 
> banner := sprintf('# <%s> exported at %sn', graph_uri, datestring(now())); 
> 
> string_to_file (file_name, banner, -2); 
> 
> env := vector (0, 0, 0); 
> 
> ses := string_output (); 
> 
> FOR (SELECT * FROM (SPARQL 
> 
> define input:storage "" 
> 
> SELECT ?s ?p ?o WHERE { 
> 
> GRAPH `iri(?:graph_uri)` { 
> 
> ?s ?p ?o 
> 
> } 
> 
> } ORDER BY ?s ?p ?o) AS sub OPTION (loop)) DO { 
> 
> http_nt_triple (env, "s", "p", "o", ses); 
> 
> ses_len := length (ses); 
> 
> IF (ses_len > max_ses_len) { 
> 
> string_to_file (file_name, ses, -1); 
> 
> ses := string_output (); 
> 
> } 
> 
> } 
> 
> IF (length (ses)) { 
> 
> string_to_file (file_name, ses, -1); 
> 
> } 
> 
> } 
> 
> Dan Davis, Systems/Applications Architect (Contractor), 
> 
> Office of Computer and Communications Systems, 
> 
> National Library of Medicine, NIH 
> 
> FROM: Pantelis Natsiavas [mailto:natsia...@gmail.com] 
> SENT: Wednesday, August 17, 2016 4:36 AM
> TO: virtuoso-users 
> SUBJECT: [Virtuoso-users] Deleting large number of triples 
> 
> Hi everybody. 
> 
> I am trying to delete a large number of triples o

Re: [Virtuoso-users] Virtuoso 37000 Error

2016-06-10 Thread Quentin
 

RE: [VIRTUOSO-USERS] VIRTUOSO 37000 ERROR

From
q [11]

To
virtuoso-users@lists.sourceforge.net [11]

Date
Today 09:56

<- [12] <<- [12] -> [12] [] [13] 

Hi S.M.Shamimul, 

I'm not with openlink so my advice is only from a fellow developer. I
have a few minutes though so here's my thoughts on your problem. 

The error you're getting looks like a bug to me, maybe in the query
optimiser since it's occurring after SQL compilation. I can't tell you
much about that bug except that it seems to occur while exploring
transitives but I can give you some tips that might help you avoid it.
Transitives in Virtuoso Open Source are a relatively unstable feature 

Your SPARQL query could be pre-optimised a bit which might simplify it
enough for the query optimiser to avoid whatever situation is causing
that error. 

Your first subquery has three clauses but the first two are not related
to each other. Reordering these might give some clues to the query
optimiser and potentially prevent a full self-join on the graph. 

May as well use a prefix too. 

prefix abc: <http://test.edu/abc/vocab/> 

Instead of:
 ?begin <http://test.edu/abc/vocab/getInfectedBy [3]> ?o1.
 ?end <http://test.edu/abc/vocab/getInfectedBy [3]>* ?mid.
 ?mid <http://test.edu/abc/vocab/getInfectedBy [3]>* ?begin. 

Do: 

 ?begin abc:getInfectedBy [3] ?o1.
 ?mid abc:getInfectedBy [3]* ?begin.
 ?end abc:getInfectedBy [3]* ?mid. 

That way, each step is related to something previous. It's not always
true but cause ordering can be important sometimes. At least this way,
you don't have to trust that the query optimiser (which is a black box
to us) will work it out. 

Since you're using property paths, the ?mid node might be redundant, at
least you probably don't need two property paths in that clause. This
might be what you intended:
 ?begin abc:getInfectedBy ?o1.
 ?mid abc:getInfectedBy ?begin.
 ?end abc:getInfectedBy* ?mid. 

That will still experience the error. Modifying the query as below will
not experience the error but probably doesn't do what you want.
Interesting point for the developers who look into it though. This
version requires at least one instance of ?mid to exist. I think the
above lets ?end and ?mid bind to the same node though I'm not certain
without having data to test it against.
 ?begin abc:getInfectedBy ?o1.
 ?mid abc:getInfectedBy* ?begin.
 ?end abc:getInfectedBy ?mid. 

Another issue, not the actual cause of error, is that the second
subquery selects a bunch of variables that don't seem to be used. Is
your intent to filter ?o1 to only include the nodes satisfying the
clauses in the second subquery? 

Be aware that you're not filtering ?g and ?g1 so these can be satisfied
with any graph in your DB, including the same graph. If this is intended
then you can remove the graph clauses entirely and combine the two
subqueries into one query which will operate over the entire DB. Such a
query will probably not experience the error you're encountering at all.


Regarding the literals in your second subquery, these can be more
efficiently processed as filtered variables than as literals. Filtering
variables is nearly always more efficient than satisfying literals.
That's probably not the source of the error but it's a good idea
generally. 

?s <http://test.edu/abc/vocab/dendrogram_iteration [6]>
'0'^^xsd:decimal. 

becomes 

?s abc:dendrogram_iteration [6] ?iter. 

filter ( ?iter = '0'^^xsd:decimal ) 

You also seem to be ordering the query and then limiting it to 1 row
which seems redundant, the results from the query aren't selected in the
main query so it's only purpose is to filter ?o1 I guess. 

The last two lines of the second subquery are duplicates and one can be
removed. 

You should probably have a closer look at your second query and make
sure it does what you intend it to do. Work with it alone to get it
working before you include it in the main query. 

Tinkering with your query, it appears that the mere presence of the
second subquery causes the error, I guess that the transitive predicates
don't play well with subqueries, that's probably a bug. 

Regards, 

Quentin 

Guiding Hand Solutions 

On 2016-06-11 07:08, S.M.Shamimul Hasan wrote: 

> Greetings,
> 
> I am running the following query on Virtuoso (7.1.0) SPARQL endpoint. 
> 
> 
> select (?o1 as ?initialseed), ?begin, ?end, (count(?mid)+1 as ?length) 
> where {
> GRAPH ?g
> {
> ?begin <http://test.edu/abc/vocab/getInfectedBy [3]> ?o1.
> ?end <http://test.edu/abc/vocab/getInfectedBy [3]>* ?mid.
> ?mid <http://test.edu/abc/vocab/getInfectedBy [3]>* ?begin.
> }
> 
> {
> sele

Re: [Virtuoso-users] Virtuoso 37000 Error

2016-06-10 Thread Quentin
 

I'd suggest reviewing the documentation on property paths as well. 

https://www.w3.org/2009/sparql/wiki/Feature:PropertyPaths 

http://docs.openlinksw.com/virtuoso/sparqlextensions.html#rdfsparqlaggregatepathexpressions


On 2016-06-11 07:08, S.M.Shamimul Hasan wrote: 

> Greetings,
> 
> I am running the following query on Virtuoso (7.1.0) SPARQL endpoint. 
> 
> 
> select (?o1 as ?initialseed), ?begin, ?end, (count(?mid)+1 as ?length) 
> where {
> GRAPH ?g
> {
> ?begin  ?o1.
> ?end * ?mid.
> ?mid * ?begin.
> }
> 
> {
> select ?o1, ?o2, ?e
> where{
> GRAPH ?g1
> {
> ?s  ?o1.
> ?s  ?o2.
> ?s  '0'^^xsd:decimal.
> ?s  ?e.
> ?s1  ?o1.
> ?s1  ?o2.
> ?s1  '5'^^xsd:decimal.
> ?s1  '5'^^xsd:decimal
> }
> }ORDER BY ASC(?e) LIMIT 1 
> }
> 
> }GROUP BY ?o1 ?begin ?end
> 
> ***
> It is giving me following error.
> 
> 
> 
> Virtuoso 37000 Error SP031: SPARQL compiler: Variable '_::trans_subj_7_1' is 
> used in subexpressions of the query but not assigned
> 
> ***
> 
> In the query instead of "GRAPH ?g" if I use FROM clause with graph URI then 
> query works fine. However I need generic "GRAPH ?g." Please let me know how I 
> can fix it.
> 
> Thank you.
> 
> Regards,
> S.M.Shamimul Hasan
> 
> --
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are 
> consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
> J-Flow, sFlow and other flows. Make informed decisions using capacity 
> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e [1]
> 
> ___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users [2]

 

Links:
--
[1] https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
[2] https://lists.sourceforge.net/lists/listinfo/virtuoso-users
[3] http://test.edu/abc/vocab/getInfectedBy
[4] http://test.edu/abc/vocab/dendrogram_infector_pid
[5] http://test.edu/abc/vocab/dendrogram_infectee_pid
[6] http://test.edu/abc/vocab/dendrogram_iteration
[7] http://test.edu/abc/vocab/dendrogram_exposureday
[8] http://test.edu/abc/vocab/contactnetwork_pid1
[9] http://test.edu/abc/vocab/contactnetwork_pid2
[10] http://test.edu/abc/vocab/contactnetwork_acttype1
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Invalid lines in dump file, is there a way to not skip the rest of the file

2016-05-02 Thread Quentin
Hi,

I can contribute some advice from another Virtuoso user, I'm not with 
Openlink.

Whilst not a direct solution, I'd recommend splitting the files into 
smaller chunks and then isolating the chunks with errors.  If you're not 
getting feedback on the error then just keep splitting the bad files 
like a binary sort to narrow down the problem.

You can then manually inspect and identify the classes of errors 
encountered and write regexps to identify them for manual correction.  
As you identify each erroneous triple, move it into a file of only 
errors and trim it from the input files.  Eventually you'll just have 
erroneous triples in one single file that you can attempt to manually 
correct or write regexps to correct.  Stuff like '<<' is pretty easy to 
detect as is '@1'.  This is all pretty easy to do using bash or perl 
scripts.

I used to use RDFabout.com to do this kind of thing but that no longer 
exists.  You can write a tool with ARC2 to do this as well (which is 
what RDFabout used to be) but that requires actual coding which might be 
more trouble than you want to go to.

If you don't mind a very slow approach, it would be pretty easy to write 
a bash/expect script that read individual lines from input files, called 
the RDF loader with each line and then saved that line to an error file 
if it didn't load.  You could do this in PL-SQL in Virtuoso as well 
though it might not be as easy because handling very large text files in 
Virtuoso can be problematic sometimes.  Just split the files into 
manageable chunks (under 2GB at least, under 20MB would be better) first 
and then you should be able to use Virtuoso's string handling functions 
to process the input file.

You could hack the bulk loader script to do something like this.  
Ideally, just modify the error handler in the bulk loader to call a 
specialised loader that loads/parses the input line by line and then 
writes any erroneous lines out to an output file for manual correction.

Quentin.
Guiding Hand Solutions.

On 2016-05-02 15:50, Thomas Trattnig wrote:
> Hello,
> 
> I have lots of nq-dump files. Some lines in this files are not valid.
> e.g.
> <http://asdf.com/ [1]> <http://purl.org/dc/terms/title [2]> ""@1
> <http://asdf.com/ [1]>   .
> or
> <http://asdf.com/ [1]> <<http://purl.org/dc/terms/title [2]>
> "adsf"@en,JA,US <http://asdf.com/ [1]>   .
> 
> I want to load all dumps into Virtuoso.
> 
> If I use standard ld_dir import function the loader stops importing
> the current file at the first occurrence of an invalidation with the
> message:
> _syntax error processed pending to here._
> 
> and moves on, to the next file.
> 
> Is there a way to just skip the invalid lines? So I can import all
> other lines of files which contain some invalid lines?
> 
> Kind regards,
> Thomas
> Virtuoso Open Source Edition (Column Store) (multi threaded)
> Version 7.2.4.2.3217-pthreads as of Apr 29 2016
> 
> 
> 
> Links:
> --
> [1] http://asdf.com/
> [2] http://purl.org/dc/terms/title
> 
> --
> Find and fix application performance issues faster with Applications 
> Manager
> Applications Manager provides deep performance insights into multiple 
> tiers of
> your business applications. It resolves application problems quickly 
> and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> 
> ___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Subquery error when using Virtuoso7/ODBC/PHP

2015-12-08 Thread Quentin
Hi Hugh,

Thanks, please let me know what you find.

Separately from the error (does the query optimiser do something 
different for remote queries?), can you give me any information about 
building odbc drivers from v7stable?  Particularly to be installed on a 
separate server talking to the DB box.

Quentin.

On 2015-12-02 00:18, Hugh Williams wrote:
> Hi Quentin,
> 
> We are looking into this issue ...
> 
> Best Regards
> Hugh Williams
> Professional Services
> 
> OpenLink Software, Inc. // http://www.openlinksw.com/ [2]
> Weblog -- http://www.openlinksw.com/blogs/ [3]
> LinkedIn -- http://www.linkedin.com/company/openlink-software/ [4]
> Twitter -- http://twitter.com/OpenLink [5]
> Google+ -- http://plus.google.com/100570109519069333827/ [6]
> Facebook -- http://www.facebook.com/OpenLinkSoftware [7]
> Universal Data Access, Integration, and Management Technology
> Providers
> 
>> On 1 Dec 2015, at 09:04, Quentin 
>> wrote:
>> 
>> Hi,
>> 
>> I'm encountering some errors accessing Virtuoso7 via odbc. The
>> actual
>> error varies depending on the release but the below error occurs
>> with
>> the latest stable7.
>> 
>> $ virtuoso-t -?
>> Virtuoso Open Source Edition (Column Store) (multi threaded)
>> Version 7.2.1.3214-pthreads as of Dec 1 2015
>> Compiled for Linux (x86_64-unknown-linux-gnu)
>> Copyright (C) 1998-2015 OpenLink Software
>> 
>> The same error occurs under develop7 as well as the next older
>> release
>> of stable7. An older v6 driver against a v7 DB worked for the below
>> query but had an unrelated buffer-underrun issue with blobs
>> (exposing
>> Apache's heap concatenated after the blob truncated to 4072
>> characters).
>> 
>> The actual error given is: "VD032: remote prepare: SQ200: No column
>> t2.P.Complete."
>> Running the DB in foreground/debug mode doesn't give any more
>> information. The query and its result are shown here:
>> *
>> 05:15:04 INFO: COMP_2 dba XX.XX.XX.XX :1 Compile text: SPARQL
>> SELECT ?Object ?PredLabel
>> FROM 
>> WHERE {
>> ?S ?P ?Object
>> FILTER (?S = )
>> { SELECT ?P ?PredLabel
>> FROM 
>> WHERE {
>> ?P rdfs:label ?PredLabel .
>> } }
>> } ORDER BY ?ObjectLabel LIMIT 100
>> 05:15:04 INFO: ERRS_0 S0022 SQ200 No column t2.P.
>> 05:15:04 INFO: ERRS_0 S0022 VD032 remote prepare: SQ200: No column
>> t2.P.
>> *
>> 
>> The presence or absence of triples in query results is irrelevant to
>> the
>> error. The query executes normally via isql and conductor.
>> Assuming that PHP is configured for odbc, the script at the bottom
>> of
>> the post is sufficient to cause the error:
>> 
>> Aside from assistance with the error in question, could I get some
>> guidance on the 'correct' way to build or extract odbc drivers from
>> a
>> Virtuoso release? Or, given Ubuntu 14.04LTS, should I be using
>> drivers
>> from the iodbc package? It's possible that the error is due to an
>> incorrect odbc configuration or driver and I'd like to check what
>> I'm
>> supposed to be doing there.
>> 
>> Quentin.
>> *
>> > 
>> // Main
>> function main() {
>> $db_user = 'dba';
>> $db_pass = 'dba';
>> $dsn = 'testv7Stable';
>> $cursor = SQL_CUR_USE_DRIVER;
>> 
>> echo "Opening DB.n";
>> $dbCon = odbc_connect($dsn, $db_user, $db_pass, $cursor);
>> 
>> echo "DB open.n";
>> $insertQuery1 = "SPARQL
>> WITH 
>> INSERT {
>>  rdfs:label "Test Predicate" .
>> }";
>> $insertQuery2 = "SPARQL
>> WITH 
>> 
>> INSERT {
>>   "Test Object" .
>> }";
>> $testQuery = "SPARQL
>> SELECT ?Object ?PredLabel
>> FROM 
>> WHERE {
>> ?S ?P ?Object
>> FILTER (?S = )
>> { SELECT ?P ?PredLabel
>> FROM 
>> WHERE {
>> ?P rdfs:label ?PredLabel .
>> } }
>> } ORDER BY ?ObjectLabel LIMIT 100";
>> $delete1 = "SPARQL DROP SILENT GRAPH ";
>> $delete2 = "SPARQL DROP SILENT GRAPH ";
>> $cur = (odbc_exec($dbCon, $insertQuery1));
>> $cur = (odbc_exec($dbCon, $insertQuery2));
>> 
>> $cur = (odbc_exec($dbCon, $testQuery));
>> if (!odbc_error($dbCon)) {
>> echo "Test passed.n";
>> } else {
>> echo "Test failed.n";
>> echo odbc_errormsg($dbCon);
>> }
>> $cur = (odbc

[Virtuoso-users] Subquery error when using Virtuoso7/ODBC/PHP

2015-12-01 Thread Quentin
Hi,

I'm encountering some errors accessing Virtuoso7 via odbc.  The actual 
error varies depending on the release but the below error occurs with 
the latest stable7.

$ virtuoso-t -?
Virtuoso Open Source Edition (Column Store) (multi threaded)
Version 7.2.1.3214-pthreads as of Dec  1 2015
Compiled for Linux (x86_64-unknown-linux-gnu)
Copyright (C) 1998-2015 OpenLink Software

The same error occurs under develop7 as well as the next older release 
of stable7.  An older v6 driver against a v7 DB worked for the below 
query but had an unrelated buffer-underrun issue with blobs (exposing 
Apache's heap concatenated after the blob truncated to 4072 characters).

The actual error given is: "VD032: remote prepare: SQ200: No column 
t2.P.Complete."
Running the DB in foreground/debug mode doesn't give any more 
information.  The query and its result are shown here:
*
05:15:04 INFO: COMP_2 dba XX.XX.XX.XX :1 Compile text:  SPARQL
SELECT ?Object ?PredLabel
FROM 
WHERE {
 ?S ?P ?Object
 FILTER (?S = )
 { SELECT ?P ?PredLabel
FROM 
WHERE {
?P rdfs:label ?PredLabel .
} }
   } ORDER BY ?ObjectLabel LIMIT 100
05:15:04 INFO: ERRS_0 S0022 SQ200 No column t2.P.
05:15:04 INFO: ERRS_0 S0022 VD032 remote prepare: SQ200: No column t2.P.
*

The presence or absence of triples in query results is irrelevant to the 
error.  The query executes normally via isql and conductor.
Assuming that PHP is configured for odbc, the script at the bottom of 
the post is sufficient to cause the error:

Aside from assistance with the error in question, could I get some 
guidance on the 'correct' way to build or extract odbc drivers from a 
Virtuoso release?  Or, given Ubuntu 14.04LTS, should I be using drivers 
from the iodbc package?  It's possible that the error is due to an 
incorrect odbc configuration or driver and I'd like to check what I'm 
supposed to be doing there.

Quentin.
*

INSERT {
 rdfs:label \"Test Predicate\" .
}";
$insertQuery2 = "SPARQL
WITH 

INSERT {
  \"Test Object\" .
}";
$testQuery = "SPARQL
SELECT ?Object ?PredLabel
FROM 
WHERE {
 ?S ?P ?Object
 FILTER (?S = )
 { SELECT ?P ?PredLabel
FROM 
WHERE {
?P rdfs:label ?PredLabel .
} }
   } ORDER BY ?ObjectLabel LIMIT 100";
$delete1 = "SPARQL DROP SILENT GRAPH ";
$delete2 = "SPARQL DROP SILENT GRAPH ";
 $cur = (odbc_exec($dbCon, $insertQuery1));
 $cur = (odbc_exec($dbCon, $insertQuery2));

 $cur = (odbc_exec($dbCon, $testQuery));
 if (!odbc_error($dbCon)) {
echo "Test passed.\n";
 } else {
echo "Test failed.\n";
echo odbc_errormsg($dbCon);
 }
 $cur = (odbc_exec($dbCon, $delete1));
 $cur = (odbc_exec($dbCon, $delete2));
 @odbc_close($dbCon);
}


echo "Starting.\n";
main();
echo "Complete.\n";
?>

--
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Conductor/Sparql endpoint output collapsing spaces

2014-08-18 Thread Quentin
The below example shows a problem with displayed output, both in conductor
and the sparql endpoint.

When a string contains multiple spaces in its data (the inserted object)
then those spaces are collapsed to one in the output.  If this output is
subsequently used in some way then the used value will not match the actual
value and lead to some confusion.  The commented filter is a cut and paste
from the displayed output.

I suppose the solution is to use html entities in the output?

I encountered the issue when dealing with user data that had inadvertently
double-spaced a name field.  When attempting to match the displayed value
in a construct, it failed to bind.  The problem is therefore not merely
cosmetic as copying and pasting output values into conditions is a fairly
frequent activity for a sparql developer and data entry errors are
something we have to live with.

===
sparql
with 
insert {
  "Two spaces -->  <--"^^xsd:string .
};

sparql
with 
select *
{
?S ?P ?O .
#filter ( ?O = "Two spaces --> <--"^^xsd:string )
};
===

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] SPARQL pragma causes internal error

2014-06-20 Thread Quentin
Hi,

When running a transitive sparql query from a stored procedure, I get this
error:
"Virtuoso 37000 Error SP031: SPARQL compiler: Variable '_::trans_subj_23_4'
is used in subexpressions of the query but not assigned"

Running the same query in conductor/isql doesn't get the error.
The difference appears to be the pragmas added to such compiled queries by
Virtuoso.  Adding them manually reproduced the error and allowed me to
narrow it down to: "sql:signal-void-variables".

The query that produced it (with some slight anonymisation) is below, it's
a little clunky because it's generated from a lot of optional clauses:
===
sparql { define sql:big-data-const 0
#output-format:text/html
define sql:signal-void-variables 1
select distinct  ?G ?S ?P ?O Datatype(?O) as ?ObjectType
where { GRAPH ?G {filter ( ?G in (<
http://example.com/dataset/demoapp/OntologyDefault/>, <
http://example.com/dataset/demoapp/12553670352e474e/>, , <
http://example.com/dataset/demoapp/12953670ae30d4ec/>))
 {

{ select distinct ?S as ?anchor {
GRAPH ?G  {filter ( ?G in (<
http://example.com/dataset/demoapp/OntologyDefault/>, <
http://example.com/dataset/demoapp/12553670352e474e/>, <
http://example.com/dataset/demoapp/1275367035362f2c/>, <
http://example.com/dataset/demoapp/12953670ae30d4ec/>))

?S a ?class .
filter ( ?class in (<http://app.example.com/ontology/DemoApp/DemoEntity>))
filter ( ?S in (<http://example.com/data/demoapp/DemoEntity_46453a449a2b9c93
>))

}}
}?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 .
}
UNION {
 select  ?G ?S ?P ?O Datatype(?O) as ?ObjectType {
GRAPH ?G  {filter ( ?G in (<
http://example.com/dataset/demoapp/OntologyDefault/>, <
http://example.com/dataset/demoapp/12553670352e474e/>, <
http://example.com/dataset/demoapp/1275367035362f2c/>, <
http://example.com/dataset/demoapp/12953670ae30d4ec/>))

?S a ?class .
filter ( ?class in (<http://app.example.com/ontology/DemoApp/DemoEntity>))
filter ( ?S in (<http://example.com/data/demoapp/DemoEntity_46453a449a2b9c93
>))

?S ?P ?O .
}
}
===

Virtuoso is:
 $ ./virtuoso-t -?
Virtuoso Open Source Edition (Column Store) (multi threaded)
Version 7.1.0.3207-pthreads as of Mar 19 2014
Compiled for Linux (x86_64-unknown-linux-gnu)
Copyright (C) 1998-2014 OpenLink Software


Can I get some information on what this pragma does?

I assume it's something specific to the data that causes this, the query
doesn't error in an environment that is an identical build of Virtuoso but
has different data.

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] SPARQL pragma causes internal error

2014-06-20 Thread Quentin
Explain() on that query generates the same error, by the way.


On 21 June 2014 13:08, Quentin  wrote:

> Hi,
>
> When running a transitive sparql query from a stored procedure, I get this
> error:
> "Virtuoso 37000 Error SP031: SPARQL compiler: Variable
> '_::trans_subj_23_4' is used in subexpressions of the query but not
> assigned"
>
> Running the same query in conductor/isql doesn't get the error.
> The difference appears to be the pragmas added to such compiled queries by
> Virtuoso.  Adding them manually reproduced the error and allowed me to
> narrow it down to: "sql:signal-void-variables".
>
> The query that produced it (with some slight anonymisation) is below, it's
> a little clunky because it's generated from a lot of optional clauses:
> ===
> sparql { define sql:big-data-const 0
> #output-format:text/html
> define sql:signal-void-variables 1
> select distinct  ?G ?S ?P ?O Datatype(?O) as ?ObjectType
> where { GRAPH ?G {filter ( ?G in (<
> http://example.com/dataset/demoapp/OntologyDefault/>, <
> http://example.com/dataset/demoapp/12553670352e474e/>,  /example.com/dataset/demoapp/1275367035362f2c/>, <
> http://example.com/dataset/demoapp/12953670ae30d4ec/>))
>  {
>
> { select distinct ?S as ?anchor {
> GRAPH ?G  {filter ( ?G in (<
> http://example.com/dataset/demoapp/OntologyDefault/>, <
> http://example.com/dataset/demoapp/12553670352e474e/>, <
> http://example.com/dataset/demoapp/1275367035362f2c/>, <
> http://example.com/dataset/demoapp/12953670ae30d4ec/>))
>
> ?S a ?class .
> filter ( ?class in (<http://app.example.com/ontology/DemoApp/DemoEntity>))
> filter ( ?S in (<
> http://example.com/data/demoapp/DemoEntity_46453a449a2b9c93>))
>
> }}
> }?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 .
> }
> UNION {
>  select  ?G ?S ?P ?O Datatype(?O) as ?ObjectType {
> GRAPH ?G  {filter ( ?G in (<
> http://example.com/dataset/demoapp/OntologyDefault/>, <
> http://example.com/dataset/demoapp/12553670352e474e/>, <
> http://example.com/dataset/demoapp/1275367035362f2c/>, <
> http://example.com/dataset/demoapp/12953670ae30d4ec/>))
>
> ?S a ?class .
> filter ( ?class in (<http://app.example.com/ontology/DemoApp/DemoEntity>))
> filter ( ?S in (<
> http://example.com/data/demoapp/DemoEntity_46453a449a2b9c93>))
>
> ?S ?P ?O .
> }
> }
> ===
>
> Virtuoso is:
>  $ ./virtuoso-t -?
> Virtuoso Open Source Edition (Column Store) (multi threaded)
> Version 7.1.0.3207-pthreads as of Mar 19 2014
> Compiled for Linux (x86_64-unknown-linux-gnu)
> Copyright (C) 1998-2014 OpenLink Software
>
>
> Can I get some information on what this pragma does?
>
> I assume it's something specific to the data that causes this, the query
> doesn't error in an environment that is an identical build of Virtuoso but
> has different data.
>
> --
> Quentin | Clear Blue Water Pty Ltd
> quent...@clearbluewater.com.au
>



-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] xsd:date+xsd:time->xsd:dateTime

2014-04-25 Thread Quentin
Hah, excellent point.

I think that in most cases, the date probably lacks an intentional timezone
and just defaults to zulu.  However if not, an optional flag would be
required to indicate which object to take the timezone from, defaulting to
the time object as the source of the timezone if missing.


On 26 April 2014 05:31, Ivan Mikhailov  wrote:

> Hello Quentin,
>
> It's possible to make such a merge function, but please clarify one
> thing first: what should it do if date and time arguments are in
> different timezones?
>
> Best Regards
>
> Ivan Mikhailov
> OpenLink Software
> http://virtuoso.openlinksw.com
>
> On Thu, 2014-04-24 at 10:13 +1000, Quentin wrote:
> > Hi,
> >
> >
> > This might be possible but reading through the function reference, I
> > can't see anyway to do it that doesn't require breaking a component
> > down to integers or strings and then rebuilding.
> >
> >
> > I'd like to suggest add a new feature to the wishlist that builds an
> > xsd:dateTime from an xsd:date and an xsd:time variable in a more
> > efficient manner than a bunch of nested bif:dateadd or bif:stringdate
> > functions.
> >
> >
> > --
> > Quentin | Clear Blue Water Pty Ltd
> > quent...@clearbluewater.com.au
> >
> --
> > Start Your Social Network Today - Download eXo Platform
> > Build your Enterprise Intranet with eXo Platform Software
> > Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> > Get Started Now And Turn Your Intranet Into A Collaboration Platform
> > http://p.sf.net/sfu/ExoPlatform
> > ___ Virtuoso-users mailing
> list Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>
>
>


-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] xsd:date+xsd:time->xsd:dateTime

2014-04-23 Thread Quentin
Hi,

This might be possible but reading through the function reference, I can't
see anyway to do it that doesn't require breaking a component down to
integers or strings and then rebuilding.

I'd like to suggest add a new feature to the wishlist that builds an
xsd:dateTime from an xsd:date and an xsd:time variable in a more efficient
manner than a bunch of nested bif:dateadd or bif:stringdate functions.

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] xsd:boolean in Virtuoso 7

2014-03-17 Thread Quentin
Hi Hugh,

Would:
select ?o datatype(?o) from  where {?s ?p ?o . filter (?o =
"false"^^xsd:boolean) }
return "False xsd:boolean"?
Or nothing, because ?o is actually an integer?


On 18 March 2014 10:44, Hugh Williams  wrote:

> Frans,
>
> On 17 Mar 2014, at 15:53, Frans Knibbe | Geodan 
> wrote:
>
> > On 2013-11-08 7:37, Quentin wrote:
> >> Is it likely that Virtuoso 7 will come to support xsd:boolean without
> >> integer conversion?
> >>
> >>
> > A good question. I have just noticed that when I import boolean literals
> > they are converted to integers. That's using Virtuoso 7.1. Apparently it
> > has to do with there not being a boolean SQL datatype in Virtuoso. And I
> > can imagine there is no urgency to have that, because other SQL
> > datatypes can manage the boolean concept quite well. But I suspect that
> > is plenty of need for a boolean datatype in RDF output.
> >
> > Is there a known workaround for this problem? Some trick to have the
> > ones or zeroes converted to true or false in RDF output? For instance,
> > is it possible to attach a function to a certain set of objects, to be
> > executed when the object value is read?
>
> [Hugh] Coincidentally this ongoing issue with xsd:boolean was being
> discussed internally earlier today and a fix for this will be available
> later this week such that xsd:boolean types can be inserted and queried as
> follows:
>
> Data Creation:
>
> with graph 
> insert {   "true"^^xsd:boolean .
>"false"^^xsd:boolean }
>
> Queries:
>
> select * from  where {?s ?p  "false"^^xsd:boolean}
> and
> select * from  where {?s ?p  "0"^^xsd:boolean}
>
> return same solution ...
>
> Regards
> Hugh
>
> >
> > Regards,
> > Frans
> >
> >
> >
> >
> --
> > Learn Graph Databases - Download FREE O'Reilly Book
> > "Graph Databases" is the definitive new guide to graph databases and
> their
> > applications. Written by three acclaimed leaders in the field,
> > this first edition is now available. Download your free book today!
> > http://p.sf.net/sfu/13534_NeoTech
> > ___
> > Virtuoso-users mailing list
> > Virtuoso-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>
>
>
> --
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
> ___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>



-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Startup error on stable7

2014-02-24 Thread Quentin
Swapping a DB from develop7 (downloaded/built Feb3) to stable7
(downloaded/built just now), I get this in my log.
04:52:58 ERROR: Error executing a server init statement : 22023: SR528:
Uninitialized property qmfOkForAnySqlvalue in JSO instance <
http://www.openlinksw.com/virtrdf-data-formats#default-iid> of type <
http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat> --
DB.DBA.RDF_QUAD_FT_UPGRADE ()

Server appears to operate normally otherwise.

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Virtuoso 7 query intermittently failing to return results

2014-02-20 Thread Quentin
Hi Hugh,

I hadn't, I'd forgotten the name of the audit functions.  I ran the
backup->null test described under database recovery and that gave no
indication of a problem.

Running the audit now as below, it returned '0'  and rerunning the query
still failed to return triples with the SPO pattern included.
select DB.DBA.RDF_AUDIT_METADATA(1,'*');

Howeverthis has put the database into an interesting state.
Previously, this graph held triples and could be read by some queries.  Now
it does and doesn't, depending on how I ask.  I ran some of these queries
immediately before the audit and got the expected results.
---
sparql
prefix o: <http://myOntology/>

select *
from <http://myGraph/>
 {
?S ?P ?O .
}
---
Nothing is returned.
---
sparql
prefix o: <http://myOntology/>

select *
from <http://myGraph/>
{
?S a o:myClass .
}
---
Nothing is returned.
---
sparql
prefix o: <http://myOntology/>
select ?G ?S
where { GRAPH ?G {
?S a o:myClass .
}};
---
Nothing is returned.
--
sparql
select distinct ?G
where { GRAPH ?G {
?S ?P ?O .
}};
---
This lists every graph including the graph in question, suggesting that at
least one triple does in fact exist in it.
Conductor->LinkedData->Graphs also lists the graph.

I'm not sure what to do with the DB now.

I can provide a login if you're interested in a closer look at it.

I did copy this database and transaction log to a clean build of develop7
as of a day ago and that had the same problem though it's unknown whether
it would still be capable of getting into that state.  Without knowing how
it got into this state, it's not practical to retest in any particular
release as the intermittence ensures there'll always be a more recent
release to test against when it does occur.



On 21 February 2014 14:37, Hugh Williams  wrote:

> Hi Quentin,
>
> Have you tried running the DB.DBA.RDF_AUDIT_METADATA() function which can
> check for and repair RDF metadata corruption, as detailed at:
>
> http://docs.openlinksw.com/virtuoso/fn_rdf_audit_metadata.html
>
> 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 20 Feb 2014, at 05:08, Quentin  wrote:
>
> > Actually, the explain plan was from a pattern in an earlier testcase
> that also failed.  The one listed has this explain plan.
> > REPORT
> > VARCHAR
> >  {
> >  RDF_QUAD_POGS 8 rows(s_10_2_t0.S)
> >   P = ##type , O = #/APIConsumer G = #/
> >
> >  Precode:
> >   0: S := Call __id2in (s_10_2_t0.S)
> >   5: BReturn 0
> >  RDF_QUAD_GS unq 0.64 rows ()
> >   inlined G = #/ , S = s_10_2_t0.S
> >  RDF_QUAD_SP 10 rows(s_10_2_t1.P)
> >   inlined S = k_s_10_2_t0.S
> >  RDF_QUAD_POGS 0.3 rows(s_10_2_t1.O)
> >   inlined P = k_s_10_2_t1.P S = k_s_10_2_t0.S , G = #/
> >
> >  After code:
> >   0: P := Call __id2in (s_10_2_t1.P)
> >   5: O := Call __ro2sq (s_10_2_t1.O)
> >   10: BReturn 0
> >  Select (S, P, O)
> >  }
> > No. of rows in result: 20
> >
> >
> > On 20 February 2014 16:05, Quentin 
> wrote:
> > This appears to be an intermittent error that pops up every few weeks,
> restarting the DB usually resolves it though not this time.
> >
> > The query that fails is of the form:
> >
> > sparql
> > prefix o: <http://myOntology/>
> >
> > select *
> > from <http://myGraph/>
> > {
> >
> > ?S a o:myClass .
> > #?S ?P ?O .
> > }
> > 
> > It works until I remove that comment, correctly returning three bindings
> for ?S.  Once that comment is removed, zero bindings are returned.  If I
> comment the class line and just return SPO, I can find the ?S in the
> triples that matches the class binding.
> >
> > The explain plan is this:
> > REPORT
> > VARCHAR
> >  {
> >  RDF_QUAD_POGS 8 rows(s_11_2_t0.S)
> >   P = ##type , O = #/MyClass G = #/
> >
> >  Precode:
> >   0: S := Call __id2in (s_11_2_t0.S)
> >   5: BReturn 0
> >  RDF_QUAD_GS unq 0.5 rows ()
> >   inlined G = #/ , S = s_11_2_t0.S
> >  RDF_QUAD_SP 8.3 rows(s_11_2_t1.P)
> >   inlined S = k_s_11_2_t0.S
> >  RDF_QUAD_POGS 0.28 rows(s_11_2_t1.O)
> >   inlined P = k_s_11_2_t1.P S = k_s_11_2_t0.S , G = #/
> >
> >  After code:
&

[Virtuoso-users] Exception thrown when deleting existing user

2014-02-20 Thread Quentin
Two interesting but ultimately trivial errors.

The documentation merely has USER_CREATE() but this will error if the
schema context is not DB.DBA.  A trivial enough issue.

create procedure test.test.testUserDrop (  )
{
DB.DBA.USER_CREATE('testUser','badpassword');
};
test.test.testUserDrop();
user_drop('testUser');

The statement execution did not return a result set.

SQLState: 42000

Message: U0002: The object "testUser" does not exist.

user_drop('testUser')


This is more trivial than it looks.  The user really was deleted but an
exception was thrown anyway.  The effect is more annoying than serious
though if the user_drop is done from a function, it would cause that
function to exit prematurely which could be serious.

Interestingly, this code works without error:
user_create('testUser','badpassword);
user_drop('testUser');

The debug log doesn't offer any clues.

Version 7.1.1-dev.3207-pthreads as of Feb 17 2014
Compiled for Linux (x86_64-unknown-linux-gnu)


-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] splt_and_decode

2014-02-20 Thread Quentin
I'm not sure whether this is an error but percent-decoding isn't getting +
encoded spaces.
create procedure test.test.testUrlDecode (  ) returns VARCHAR
{
declare test VARCHAR;

test :='test+test+test';

return split_and_decode(test,0,'%');
}

Query result:testUrlDecode
VARCHAR test+test+test

The result is different to conventional urldecoding done by javascript and
php which would generally return "test test test".  The effect is to
require virtuoso specific work-arounds in external interfaces.

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Inline sparql in pl-sql

2014-02-20 Thread Quentin
Hi,

This is an interesting problem that was confusing me for a while.

The below function attempts to write four triples to one graph.  Only two
of them are written to the target graph, the other two end up in a strange
place.  No exception is thrown and the debug log is gives no indication
that anything went wrong.

create procedure test.test.inlineSparqlTest (  )
{

declare graphName, objectText1, objectText2, uri1, uri2 VARCHAR;
graphName := 'testGraph';
uri1 := 'Subject1';
uri2 := 'Subject2';
objectText1  := '111';
objectText2  := '222';

sparql
prefix : <http://MyOntology/>
insert into graph ?:graphName {
`iri(?:uri1)` a :MyClass .
`iri(?:uri1)` :Pred ?:objectText1 .
};


declare sparqlstr VARCHAR;

sparqlstr := concat('sparql
prefix : <http://MyOntology/>
insert into graph <',graphName,'> {
<',uri2,'> a :MyClass .
<',uri2,'> :Pred <',objectText2,'> .
}');
exec(sparqlstr);

};
test.test.inlineSparqlTest();
sparql
select *
from 
{
?S a <http://MyOntology/MyClass> .
};
sparql
select *
{ GRAPH ?G {
?S a <http://MyOntology/MyClass> .
}};



The two queries have different results which I think is wrong but the
second one shows that something strange is happening.
 The statement execution did not return a result set. The statement
execution did not return a result set. Query result:S
ANY Subject2 No. of rows in result: 1 Query result: G
ANY S
ANY  iri_id_13983899834_with_no_name_entry Subject1  testGraph
Subject2No. of rows in result: 2

Virtuoso Open Source Edition (Column Store) (multi threaded)
Version 7.1.1-dev.3207-pthreads as of Feb 17 2014

Wrapping the graph name in iri() in the inline sparql seems to make it work
properly but I still think the result is strange when you don't.

When you try and remove those strange graph-less triples though...
sparql
delete { GRAPH ?G {
?S ?P ?O }}
where
{ GRAPH ?G {
?S a <http://MyOntology/MyClass> .
?S ?P ?O .
}};

I'll leave out the crash log because it's several pages long but you get
the idea.

The highlights are probably:
12:21:51 INFO: ERRS_0 01V01 QW001 Local declaration of o_val shadows a
definition of the same name
12:21:51 INFO: ERRS_0 01V01 QW001 Local declaration of
o_dt_and_lang_twobyte shadows a definition of the same name
12:21:51 INFO: ERRS_0 01V01 QW001 Local declaration of r_o shadows a
definition of the same name
...
12:21:52 ERROR: GPF: colsearch.c:2630 for unique ts, getting range with
more than 1 rows
GPF: colsearch.c:2630 for unique ts, getting range with more than 1 rows

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Virtuoso 7 query intermittently failing to return results

2014-02-19 Thread Quentin
Actually, the explain plan was from a pattern in an earlier testcase that
also failed.  The one listed has this explain plan.
REPORT
VARCHAR  {  RDF_QUAD_POGS 8 rows(s_10_2_t0.S)  P = ##type , O =
#/APIConsumer G = #/Precode:  0: S := Call __id2in (s_10_2_t0.S)   5:
BReturn 0 RDF_QUAD_GS unq 0.64 rows ()   inlined G = #/ , S =
s_10_2_t0.S RDF_QUAD_SP
10 rows(s_10_2_t1.P)   inlined S = k_s_10_2_t0.S RDF_QUAD_POGS 0.3
rows(s_10_2_t1.O)   inlined P = k_s_10_2_t1.P S = k_s_10_2_t0.S , G =
#/   After
code:   0: P := Call __id2in (s_10_2_t1.P)  5: O := Call __ro2sq
(s_10_2_t1.O)   10: BReturn 0  Select (S, P, O) } No. of rows in result: 20


On 20 February 2014 16:05, Quentin  wrote:

> This appears to be an intermittent error that pops up every few weeks,
> restarting the DB usually resolves it though not this time.
>
> The query that fails is of the form:
>
> sparql
> prefix o: <http://myOntology/>
>
> select *
> from <http://myGraph/>
>  {
>
> ?S a o:myClass .
> #?S ?P ?O .
> }
> 
> It works until I remove that comment, correctly returning three bindings
> for ?S.  Once that comment is removed, zero bindings are returned.  If I
> comment the class line and just return SPO, I can find the ?S in the
> triples that matches the class binding.
>
> The explain plan is this:
> REPORT
> VARCHAR  { RDF_QUAD_POGS 8 rows(s_11_2_t0.S)   P = ##type , O = #/MyClass
> G = #/   Precode:  0: S := Call __id2in (s_11_2_t0.S)   5: BReturn 0 
> RDF_QUAD_GS
> unq 0.5 rows ()   inlined G = #/ , S = s_11_2_t0.S RDF_QUAD_SP 8.3
> rows(s_11_2_t1.P)   inlined S = k_s_11_2_t0.S RDF_QUAD_POGS 0.28
> rows(s_11_2_t1.O)   inlined P = k_s_11_2_t1.P S = k_s_11_2_t0.S , G = #/   
> After
> code:   0: P := Call __id2in (s_11_2_t1.P)  5: O := Call __ro2sq
> (s_11_2_t1.O)   10: BReturn 0  Select (S, P, O) } No. of rows in result:
> 20
>
> Debug log under trace_on shows nothing unusual.
>
> The instance is:
> Version 7.0.1-dev.3207-pthreads as of Feb  3 2014
> Compiled for Linux (x86_64-unknown-linux-gnu)
>
> I've quarantined the running instance of the DB and it consistently fails
> as above.  This behaviour began just a few hours ago, queries of this sort
> performed perfectly this morning and then began failing abruptly with no
> obvious reason why.
>
> I'm not sure it's related but when I cloned the running instance and
> started the DB on the clone, the log includes this error:
> 05:01:06 ERROR: Error executing a server init statement : 22023: SR528:
> Uninitialized property qmfOkForAnySqlvalue in JSO instance <
> http://www.openlinksw.com/virtrdf-data-formats#default-iid> of type <
> http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat> --
>  DB.DBA.RDF_QUAD_FT_UPGRADE ()
>
>
> --
> Quentin | Clear Blue Water Pty Ltd
> quent...@clearbluewater.com.au
>



-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Virtuoso 7 query intermittently failing to return results

2014-02-19 Thread Quentin
This appears to be an intermittent error that pops up every few weeks,
restarting the DB usually resolves it though not this time.

The query that fails is of the form:

sparql
prefix o: <http://myOntology/>

select *
from <http://myGraph/>
{

?S a o:myClass .
#?S ?P ?O .
}

It works until I remove that comment, correctly returning three bindings
for ?S.  Once that comment is removed, zero bindings are returned.  If I
comment the class line and just return SPO, I can find the ?S in the
triples that matches the class binding.

The explain plan is this:
REPORT
VARCHAR  { RDF_QUAD_POGS 8 rows(s_11_2_t0.S)   P = ##type , O = #/MyClass G
= #/   Precode:  0: S := Call __id2in (s_11_2_t0.S)   5: BReturn 0 RDF_QUAD_GS
unq 0.5 rows ()   inlined G = #/ , S = s_11_2_t0.S RDF_QUAD_SP 8.3
rows(s_11_2_t1.P)   inlined S = k_s_11_2_t0.S RDF_QUAD_POGS 0.28
rows(s_11_2_t1.O)   inlined P = k_s_11_2_t1.P S = k_s_11_2_t0.S , G =
#/   After
code:   0: P := Call __id2in (s_11_2_t1.P)  5: O := Call __ro2sq
(s_11_2_t1.O)   10: BReturn 0  Select (S, P, O) } No. of rows in result: 20

Debug log under trace_on shows nothing unusual.

The instance is:
Version 7.0.1-dev.3207-pthreads as of Feb  3 2014
Compiled for Linux (x86_64-unknown-linux-gnu)

I've quarantined the running instance of the DB and it consistently fails
as above.  This behaviour began just a few hours ago, queries of this sort
performed perfectly this morning and then began failing abruptly with no
obvious reason why.

I'm not sure it's related but when I cloned the running instance and
started the DB on the clone, the log includes this error:
05:01:06 ERROR: Error executing a server init statement : 22023: SR528:
Uninitialized property qmfOkForAnySqlvalue in JSO instance <
http://www.openlinksw.com/virtrdf-data-formats#default-iid> of type <
http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat> --
 DB.DBA.RDF_QUAD_FT_UPGRADE ()


-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Crash of virtuoso 7 stable + better bulk loading from api's

2014-02-11 Thread Quentin
Hi Jerven,

Looks like you're running some *nix environment.  I have a bash script that
will get and build a debug release of develop/7 as of that time, I'll send
it along.  The end-result will be a built develop/7 with debug enabled.

You'll need to set user limits etc to allow core files, normally they're
suppressed by ulimit.

Quentin


On 12 February 2014 02:06, Jerven Bolleman wrote:

> Hi Hugh,
>
> I don't understand how to build the debug release.
> I can't find the lines to patch e.g.
>
>
-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] The array extend is less than requested

2014-02-09 Thread Quentin
  P =  #ontologies/hasProp
> >>>>
> >>>> s# 125 from DB.DBA.RDF_QUAD by RDF_QUAD_POGS   0.43 rows Parallel,
> >>>> tail cost   3.7
> >>>> Key RDF_QUAD_POGS  ASC  ()
> >>>> inlined  P =  #type  ,  O =  #ontologies/hasProp  ,  S =  >>>> s_1_4_t0.S rn>
> >>>> row specs:  O LIKE 
> >>>>
> >>>>
> >>>> After code:
> >>>> 0:  := Call isnotnull ( >>>> S125>)
> >>>> 5: BReturn 0
> >>>> s# 130 Sort (HASH) set no ( >>>> via  S125 S118>, ) -> ( in>)
> >>>> up to   5.8e+06 distinct
> >>>>
> >>>> }
> >>>> s# 137 group by read node
> >>>> (, , )
> >>>> set no returned in 
> >>>>
> >>>> Precode:
> >>>> 0:  := Call __ro2sq ()
> >>>> 5: BReturn 0
> >>>> s# 144 Sort (HASH) set no (TOP  15  ) ( >>>> aggregate in>) -> ()
> >>>>
> >>>> }
> >>>> s# 151 top order by node (, )
> >>>> set no 
> >>>>
> >>>> After code:
> >>>> 0:  :=  := artm 
> >>>> 4:  :=  := artm 
> >>>> 8: BReturn 0
> >>>> s# 112 Subquery Select(, )
> >>>> set no: 
> >>>> }
> >>>>
> >>>>
> >>>> After code:
> >>>> 0:  := Call __ro2sq ()
> >>>> 5:  := Call __ro2sq ()
> >>>> 10: BReturn 0
> >>>> s# 162 Select (, )
> >>>> set no: 
> >>>> }
> >>>>
> >>>>
> --
> >>>> Managing the Performance of Cloud-Based Applications
> >>>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> >>>> Read the Whitepaper.
> >>>>
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> >>>> ___
> >>>> Virtuoso-users mailing list
> >>>> Virtuoso-users@lists.sourceforge.net
> >>>> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
> >>>
> >>
> >>
> --
> >> Managing the Performance of Cloud-Based Applications
> >> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> >> Read the Whitepaper.
> >>
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> >> ___
> >> Virtuoso-users mailing list
> >> Virtuoso-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
> >
>
>
> --
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> ___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>



-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Crash when abusing multiple results sets in a procedure

2014-02-09 Thread Quentin
Good to hear.

Am I right in thinking it's not allowed to return two differently named
result sets from the one function?


On 9 February 2014 13:23, Hugh Williams  wrote:

> Hi Quentin,
>
> Testing against the latest development archive the server does not crash,
> thus this issue should be resolved in the final VOS  stable/7 release being
> prepared:
>
> SQL>  create procedure test.test.resultsetCrash( ) {  declare meta, _dt
> any; declare query, query2, errorCode, errorMessage varchar; declare inx
> integer; declare parameters vector; parameters := vector();  query :=
> 'sparql select ?S ?P ?O {GRAPH  { {{ select distinct ?S
> { ?S a ?class } limit 1 offset 1 }} ?S ?P ?O . }}';  exec (query,
> errorCode, errorMessage, vector(), 0, meta, _dt);  declare meta2, _dt2 any;
> declare errorCode2, errorMessage2 varchar;  query2 := 'sparql select
> count(distinct ?S) as ?count { GRAPH  { ?S a ?class .
> }}';  declare entCount integer; declare entVector any;  exec (query,
> errorCode, errorMessage, vector(), 0, meta, _dt); if (meta <> 0) {
> exec_result_names (meta[0]);   inx := 0; if (_dt <> 0) {   while (inx <
> length (_dt)) {   exec_result (_dt[inx]);   inx := inx + 1;
> }  declare meta, _dt any; declare errorCode, errorMessage varchar; declare
> inx integer;  end_result(); exec (query2, errorCode, errorMessage,
> vector(), 0, meta, _dt); exec_result (_dt[0]); } } }
>
> Done. -- 3 msec.
> SQL>
> SQL> sparql drop silent graph ;
>
> Done. -- 47 msec.
> SQL> sparql
> Type the rest of statement, end with a semicolon (;)> insert into graph
> 
> Type the rest of statement, end with a semicolon (;)> {
> Type the rest of statement, end with a semicolon (;)>  a  .
> Type the rest of statement, end with a semicolon (;)>  a  .
> Type the rest of statement, end with a semicolon (;)>  a  .
> Type the rest of statement, end with a semicolon (;)>  
> "s1"^^xsd:string .
> Type the rest of statement, end with a semicolon (;)>  
> "s2"^^xsd:string .
> Type the rest of statement, end with a semicolon (;)>  
> "s3"^^xsd:string .
> Type the rest of statement, end with a semicolon (;)> };
>
> Done. -- 122 msec.
> SQL> test.test.resultsetCrash();
> S
> P
>   O
> VARCHAR
> VARCHAR
>   VARCHAR
>
> ___
>
> s2
>http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> class
> s2
>name
>  s2
>
> 2 Rows. -- 4 msec.
> SQL>
>
>
>   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 5 Feb 2014, at 23:33, Quentin  wrote:
>
> I believe it's just an effect of calling exec_result with a row that
> doesn't match the columns declared to exec_result_names, with that in
> mind, I've simplified the test case.
>
> =
> create procedure
> test.test.resultsetCrash( )
> {
>
> declare meta, _dt any;
> declare query, query2, errorCode, errorMessage varchar;
> declare inx integer;
> declare parameters vector;
> parameters := vector();
>
> query := 'sparql
> select ?S ?P ?O
> {GRAPH  {
> {{ select distinct ?S { ?S a ?class } limit 1 offset 1 }}
>  ?S ?P ?O .
> }}';
>
> exec (query, errorCode, errorMessage, vector(), 0, meta, _dt);
>
> declare meta2, _dt2 any;
> declare errorCode2, errorMessage2 varchar;
>
> query2 := 'sparql
> select count(distinct ?S) as ?count
> { GRAPH  {
> ?S a ?class .
> }}';
>
> declare entCount integer;
> declare entVector any;
>
> exec (query, errorCode, errorMessage, vector(), 0, meta, _dt);
> if (meta <> 0) {
>   exec_result_names (meta[0]);
>   inx := 0;
> if (_dt <> 0) {
>   while (inx < length (_dt))
> {
>   exec_result (_dt[inx]);
>   inx := inx + 1;
> }
>
> declare meta, _dt any;
> declare errorCode, errorMessage varchar;
> declare inx integer;
>
> end_result();
> exec (query2, errorCode, errorMessage, vector(), 0, meta, _dt);
> exec_result (_dt[0]);
> }
> }
> }
> =

Re: [Virtuoso-users] Crash when abusing multiple results sets in a procedure

2014-02-05 Thread Quentin
I believe it's just an effect of calling exec_result with a row that
doesn't match the columns declared to exec_result_names, with that in
mind, I've simplified the test case.

=
create procedure
test.test.resultsetCrash( )
{

declare meta, _dt any;
declare query, query2, errorCode, errorMessage varchar;
declare inx integer;
declare parameters vector;
parameters := vector();

query := 'sparql
select ?S ?P ?O
{GRAPH  {
{{ select distinct ?S { ?S a ?class } limit 1 offset 1 }}
?S ?P ?O .
}}';

exec (query, errorCode, errorMessage, vector(), 0, meta, _dt);

declare meta2, _dt2 any;
declare errorCode2, errorMessage2 varchar;

query2 := 'sparql
select count(distinct ?S) as ?count
{ GRAPH  {
?S a ?class .
}}';

declare entCount integer;
declare entVector any;

exec (query, errorCode, errorMessage, vector(), 0, meta, _dt);
if (meta <> 0) {
  exec_result_names (meta[0]);
  inx := 0;
if (_dt <> 0) {
  while (inx < length (_dt))
{
  exec_result (_dt[inx]);
  inx := inx + 1;
}

declare meta, _dt any;
declare errorCode, errorMessage varchar;
declare inx integer;

end_result();
exec (query2, errorCode, errorMessage, vector(), 0, meta, _dt);
exec_result (_dt[0]);
}
}
}
=

sparql drop silent graph ;
sparql
insert into graph 
{
 a  .
 a  .
 a  .
  "s1"^^xsd:string .
  "s2"^^xsd:string .
  "s3"^^xsd:string .
};
test.test.resultsetCrash();
-- The crash has already occurred.
=====


On 5 February 2014 22:03, Hugh Williams  wrote:

> Hi Quentin,
>
> Can you provide the complete compilable and runnable procedure you are
> running that is causing the crash, as I cannot get the snippet you have
> provide below to create ...
>
>   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 5 Feb 2014, at 07:45, Quentin  wrote:
>
> Hi,
>
> Running develop7 with a procedure that attempts to return two result
> sets.  Probably not wise but I was experimenting with ways to return
> metadata about a query.
>
> The procedure did something including:
> ==
> ...other stuff...
> query := 'select ?S ?P ?O {} limit 10 offset 20';
> exec (query, errorCode, errorMessage, vector(), 0, meta, _dt);
> if (meta <> 0) {
>   exec_result_names (meta[0]);
>   inx := 0;
> if (_dt <> 0) {
>   while (inx < length (_dt))
> {
>   exec_result (_dt[inx]);
>   inx := inx + 1;
> }
> }
> } else exec_result_names(vector('?NullRecords'));
>
> declare meta, _dt any;
> declare errorCode, errorMessage varchar;
> declare inx integer;
>
> query := 'select count (distinct ?S) as ?count {}';
> end_result();
> exec (query, errorCode, errorMessage, vector(), 0, meta, _dt);
> exec_result (_dt[0]);
> }
> ==
>
> I wasn't really expecting it to work but a server crash seems worth
> reporting.
>
> As an aside, does anyone have any advice on how to return something like a
> count of total rows together in the same query that returns a paginated set
> of rows?
>
> I'm actually paginating the entities themselves and would like to be able
> to report the number of entities in the same procedure so as to avoid
> unnecessary pagination.
> --
> Quentin | Clear Blue Water Pty Ltd
> quent...@clearbluewater.com.au
>
> --
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>
>
>


-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Crash when abusing multiple results sets in a procedure

2014-02-04 Thread Quentin
Hi,

Running develop7 with a procedure that attempts to return two result sets.
Probably not wise but I was experimenting with ways to return metadata
about a query.

The procedure did something including:
==
...other stuff...
query := 'select ?S ?P ?O {} limit 10 offset 20';
exec (query, errorCode, errorMessage, vector(), 0, meta, _dt);
if (meta <> 0) {
  exec_result_names (meta[0]);
  inx := 0;
if (_dt <> 0) {
  while (inx < length (_dt))
{
  exec_result (_dt[inx]);
  inx := inx + 1;
}
}
} else exec_result_names(vector('?NullRecords'));

declare meta, _dt any;
declare errorCode, errorMessage varchar;
declare inx integer;

query := 'select count (distinct ?S) as ?count {}';
end_result();
exec (query, errorCode, errorMessage, vector(), 0, meta, _dt);
exec_result (_dt[0]);
}
==

I wasn't really expecting it to work but a server crash seems worth
reporting.

As an aside, does anyone have any advice on how to return something like a
count of total rows together in the same query that returns a paginated set
of rows?

I'm actually paginating the entities themselves and would like to be able
to report the number of entities in the same procedure so as to avoid
unnecessary pagination.
-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Transitivity confusion

2014-01-30 Thread Quentin
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 
{
   .
   .
   .
  "111"^^xsd:string .
  "222"^^xsd:string .
  "333"^^xsd:string .
  "444"^^xsd:string .
 a <http://example.com/FirstClass> .
 a <http://example.com/SecondClass> .
 a <http://example.com/ThirdClass> .
 a <http://example.com/FourthClass> .
}

My base query is:
sparql
select distinct ?G ?S ?P ?O
where { GRAPH ?G {FILTER ( ?G in ())
 {
{ select distinct ?anchor {
?anchor a ?class .
FILTER ( ?anchor in ())
} 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 ((),))" 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


[Virtuoso-users] Triples not being deleted.

2014-01-28 Thread Quentin
Hi,

Running Virtuoso7, December release
virtuoso-t -?
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)

Executing the below operations separately in Conductor/isql, I find that
the deleted triple is still present (including after a checkpoint).
This seems incorrect behaviour, is there anything I need to understand
about the temporary database?

sparql
insert into graph  {
  "aaa"^^xsd:string .
};
> Insert into , 1 (or less) triples -- done
sparql
delete from graph  {
  "aaa"^^xsd:string .
};
> Delete from , 1 (or less) triples -- done
sparql
select * from 
{
?S ?P ?O .
}
> Query result:  > S
> ANY P
ANY O
ANY  >  S1  pred  aaa----

-- 
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


[Virtuoso-users] Error using UNION of two transitive queries.

2014-01-23 Thread Quentin
Is this a valid construct?
I want to do two transitive queries and union the results.  I realise it's
an awkward construct, that's a result of it being dynamically generated.

The code gives the error:
=

Virtuoso 37000 Error SP031: SPARQL compiler: Variable
'_::trans_subj_13_0' is used in subexpressions of the query but not
assigned


DBPedialink:
http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=select+distinct+%3FG+%3FS+%3FP+%3FO+Datatype%28%3FO%29+as+%3FObjectType%0D%0Awhere+{+%0D%0A+{%0D%0A%3Fanchor+%3FanchorPred+%3FS%0D%0AOPTION+%28+TRANSITIVE%2C%0D%0At_min+%280%29%2C%0D%0At_max+%281%29%2C%0D%0At_in+%28%3Fanchor%29%2C%0D%0At_out+%28%3FS%29%2C%0D%0At_no_cycles%2C%0D%0At_distinct+%29+.%0D%0AFILTER+%28+%3Fanchor+in+%28%3CSubject1%3E%29%29%0D%0A%0D%0A%3FS+%3FP+%3FO+.filter+%28+%3FS+in+%28%3CSubject1%3E%29%29%0D%0A%0D%0Afilter+%28+%3FP+in+%28%3CPredicate1%3E%29%29%0D%0A}+union+{%0D%0A%3Fanchor+%3FanchorPred+%3FS%0D%0AOPTION+%28+TRANSITIVE%2C%0D%0At_min+%280%29%2C%0D%0At_max+%281%29%2C%0D%0At_in+%28%3Fanchor%29%2C%0D%0At_out+%28%3FS%29%2C%0D%0At_no_cycles%2C%0D%0At_distinct+%29+.%0D%0AFILTER+%28+%3Fanchor+in+%28%3CSubject1%3E%29%29%0D%0A%3FS+%3FP+%3FO+.%0D%0Afilter+%28%3FP+%3D+rdf%3Atype%29%0D%0Afilter+%28+%3FS+in+%28%3CSubject1%3E%29%29%0D%0A%3FS+%3FPP+%3FOO+.%0D%0Afilter+%28+%3FPP+in+%28%3CPredicate1%3E%29%29%0D%0A}}&format=text%2Fhtml&timeout=3&debug=on
=
select distinct ?G ?S ?P ?O Datatype(?O) as ?ObjectType
where {
 {
?anchor ?anchorPred ?S
OPTION ( TRANSITIVE,
t_min (0),
t_max (1),
t_in (?anchor),
t_out (?S),
t_no_cycles,
t_distinct ) .
FILTER ( ?anchor in ())

?S ?P ?O .filter ( ?S in ())

filter ( ?P in ())
} union {
?anchor ?anchorPred ?S
OPTION ( TRANSITIVE,
t_min (0),
t_max (1),
t_in (?anchor),
t_out (?S),
t_no_cycles,
t_distinct ) .
FILTER ( ?anchor in ())
?S ?P ?O .
filter (?P = rdf:type)
filter ( ?S in ())
?S ?PP ?OO .
filter ( ?PP in ())
}}
=====

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Virtuoso7 crash

2014-01-22 Thread Quentin
The following procedure causes a database crash (regardless of data):
create procedure
test.test.deathByPoorSyntax( )
RETURNS VARCHAR
{

declare str VARCHAR;

SELECT ?subject INTO str FROM (sparql
select ?subject
from <http://q-apidev.clearsight.co/dataset/q-apidev/auth/>
{
?subject a <http://example.com/class1> .
}) as sub;
return str;
}

The cause is the "?subject" in the SQL side of the query.  Everything works
fine once the syntax is corrected to "subject".

The debug log is something like:
=

06:57:57 INFO: COMP_2 dba 220.233.39.18 Internal Compile text:   select
test.test.deathByPoorSyntax()
06:57:57 INFO: LTRS_1  220.233.39.18 Internal Commit transact
0x9b9c250 0
06:57:57 INFO: LTRS_2  220.233.39.18 Internal Restart transact
0x9b9c250
06:57:57 INFO: LTRS_1  220.233.39.18 Internal Commit transact
0x9b9c250 0
06:57:57 INFO: LTRS_2  220.233.39.18 Internal Restart transact
0x9b9c250
06:57:57 INFO: LTRS_1  220.233.39.18 Internal Commit transact
0x9b9c250 0
06:57:57 INFO: LTRS_2  220.233.39.18 Internal Restart transact
0x9b9c250
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0xaf9d53]
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0xaf9dd6]
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0xadfb80]
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0x67e0bf]
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0x67f597]
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0x680ac7]
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0x68b644]
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0x6c2585]
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0x6c2873]
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0x710d8c]
06:57:57 INFO: /usr/local/bin/virtuoso-t(set_ctr_input+0x38) [0x5c9860]
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0x6c25cf]
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0x6ce32c]
06:57:57 INFO: /usr/local/bin/virtuoso-t(bif_exec+0xb1e) [0x5f67ec]
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0x67e536]
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0x686a62]
 continue for a page or so 
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0x686a62]
06:57:57 INFO: /usr/local/bin/virtuoso-t() [0x6c25b2]
06:57:57 ERROR: GPF: Dkbox.c:1290 Copy of a freed box
GPF: Dkbox.c:1290 Copy of a freed box


-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Virtuoso batch transactions

2014-01-01 Thread Quentin
I see.
Well regardless, even using log_enable to disable row-based commits, the
work is being committed halfway through the function and not rolled back
after an exception.

So is it possible to batch everything in a function into an atomic
transaction regardless of where the function is called from?
And is it also possible to remove an exception handler in order to resignal
an exception state?


On 2 January 2014 13:07, Hugh Williams  wrote:

> Hi Quentin,
>
> By "isql" I mean't the Virtuoso command line tool, which is where the "set
> AUTOCOMMIT MANUAL;" command works.
>
>   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 1 Jan 2014, at 22:54, Quentin  wrote:
>
> Hi Hugh,
>
> I'm testing in conductor/isql but will be using odbc in implementation.
>
> The suggested instruction gives:
>
>
> SQLState: 37000
>
> Message: SQ074: Line 1: syntax error at 'MANUAL' before ';'
>  set AUTOCOMMIT MANUAL
>
> I'm certain that's a correct isql instruction so am a little confused
> about that occurring but regardless, I believe it's functionally equivalent
> to:
>  log_enable(0);
> ...
> do work;
> ...
> log_enable(3);
>
> So I tried using log_enable instead and the users were still being
> created/committed despite the exception and rollback.
>
> On 31 December 2013 22:33, Hugh Williams  wrote:
>
>> Hi Quentin,
>>
>> Are you running this procedure from isql as if so autocommit mode by
>> default and you need to set it to manual commit mode first before running
>> the procedure with the command:
>>
>> set AUTOCOMMIT MANUAL;
>>
>>   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 Dec 2013, at 03:27, Quentin  wrote:
>>
>> Hi,
>>
>> I'm attempting to implement something using your advice and am
>> encountering a problem.  I have a function:
>> create procedure
>> testapp.test.testAbort(IN name VARCHAR, IN pwd VARCHAR, IN cert VARCHAR)
>> returns varchar
>> {
>>
>> whenever SQLEXCEPTION goto errorabort;
>>
>> declare options VECTOR;
>> options := vector('SQL_ENABLE', 1);
>>
>> DB.DBA.USER_CREATE (name, pwd, options);
>> DB.DBA.USER_CERT_REGISTER(name, cert);
>> exec(concat('GRANT SPARQL_UPDATE TO ',name));
>>
>> DB.DBA.RDF_DEFAULT_USER_PERMS_SET (name, 0);
>> DB.DBA.USER_GRANT_ROLE(name, 'TEST_USER',0);
>>
>> return 'everything ok';
>>
>> errorabort:
>> rollback work;
>> result(__SQL_STATE);
>> result(__SQL_MESSAGE);
>> return concat('error: ',__SQL_STATE, ' - ',__SQL_MESSAGE);
>> }
>>
>> Then I call "select testapp.test.testAbort('testUser3','xxx', 'xxx');"
>>
>> Of course this certificate is not quite correct and Virtuoso rightly
>> complains causing the outer function to return: "error: 22023 - U: The
>> certificate have been supplied is not valid or corrupted"
>>
>> But I have three problems here:
>> The first is that the exception is not returned to the parent, I can only
>> see it via the return value.  If I try to signal/resignal it, I trip the
>> exception handler and enter an infinite loop.
>> The second is that the user "testUser3" has been created and this work is
>> not aborted, presumably because it was committed in the USER_CREATE
>> function.
>>
>> So, how do I remove a declared handler once I want to escalate an
>> exception?
>> How can I prevent a function from committing work that I want to occur in
>> a transaction with other activity in a parent function?
>>
>> Oh, and when I kill the DB process to break the 

Re: [Virtuoso-users] Virtuoso batch transactions

2014-01-01 Thread Quentin
Hi Hugh,

I'm testing in conductor/isql but will be using odbc in implementation.

The suggested instruction gives:


SQLState: 37000

Message: SQ074: Line 1: syntax error at 'MANUAL' before ';'
 set AUTOCOMMIT MANUAL

I'm certain that's a correct isql instruction so am a little confused about
that occurring but regardless, I believe it's functionally equivalent to:
 log_enable(0);
...
do work;
...
log_enable(3);

So I tried using log_enable instead and the users were still being
created/committed despite the exception and rollback.

On 31 December 2013 22:33, Hugh Williams  wrote:

> Hi Quentin,
>
> Are you running this procedure from isql as if so autocommit mode by
> default and you need to set it to manual commit mode first before running
> the procedure with the command:
>
> set AUTOCOMMIT MANUAL;
>
>   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 Dec 2013, at 03:27, Quentin  wrote:
>
> Hi,
>
> I'm attempting to implement something using your advice and am
> encountering a problem.  I have a function:
> create procedure
> testapp.test.testAbort(IN name VARCHAR, IN pwd VARCHAR, IN cert VARCHAR)
> returns varchar
> {
>
> whenever SQLEXCEPTION goto errorabort;
>
> declare options VECTOR;
> options := vector('SQL_ENABLE', 1);
>
> DB.DBA.USER_CREATE (name, pwd, options);
> DB.DBA.USER_CERT_REGISTER(name, cert);
> exec(concat('GRANT SPARQL_UPDATE TO ',name));
>
> DB.DBA.RDF_DEFAULT_USER_PERMS_SET (name, 0);
> DB.DBA.USER_GRANT_ROLE(name, 'TEST_USER',0);
>
> return 'everything ok';
>
> errorabort:
> rollback work;
> result(__SQL_STATE);
> result(__SQL_MESSAGE);
> return concat('error: ',__SQL_STATE, ' - ',__SQL_MESSAGE);
> }
>
> Then I call "select testapp.test.testAbort('testUser3','xxx', 'xxx');"
>
> Of course this certificate is not quite correct and Virtuoso rightly
> complains causing the outer function to return: "error: 22023 - U: The
> certificate have been supplied is not valid or corrupted"
>
> But I have three problems here:
> The first is that the exception is not returned to the parent, I can only
> see it via the return value.  If I try to signal/resignal it, I trip the
> exception handler and enter an infinite loop.
> The second is that the user "testUser3" has been created and this work is
> not aborted, presumably because it was committed in the USER_CREATE
> function.
>
> So, how do I remove a declared handler once I want to escalate an
> exception?
> How can I prevent a function from committing work that I want to occur in
> a transaction with other activity in a parent function?
>
> Oh, and when I kill the DB process to break the exception handling loop, I
> get an error on startup, that's problem three:
> ---
> ERROR: Error executing a server init statement : 22023: SR528:
> Uninitialized property qmfOkForAnySqlvalue in JSO instance <
> http://www.openlinksw.com/virtrdf-data-formats#default-iid> of type <
> http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat> --
> DB.DBA.RDF_QUAD_FT_UPGRADE ()
> ---
> It might not be related to what I was doing, I'm not sure.
>
>
>
>
> On 16 December 2013 10:48, Hugh Williams  wrote:
>
>> Hi Quentin,
>>
>> The log_enable should be removed, and unless there are no other commits
>> or rollbacks the sequence will be executed in one transaction ...
>>
>>   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 11 Dec 2013, at 05:07, Quentin  wrote:
>>
>> Hi,
>>
>> If I'm executing an sql function that does some sparql, deletes some
>> triples and calls a few other functions, can I fo

Re: [Virtuoso-users] Virtuoso batch transactions

2013-12-30 Thread Quentin
Hi,

I'm attempting to implement something using your advice and am encountering
a problem.  I have a function:
create procedure
testapp.test.testAbort(IN name VARCHAR, IN pwd VARCHAR, IN cert VARCHAR)
returns varchar
{

whenever SQLEXCEPTION goto errorabort;

declare options VECTOR;
options := vector('SQL_ENABLE', 1);

DB.DBA.USER_CREATE (name, pwd, options);
DB.DBA.USER_CERT_REGISTER(name, cert);
exec(concat('GRANT SPARQL_UPDATE TO ',name));

DB.DBA.RDF_DEFAULT_USER_PERMS_SET (name, 0);
DB.DBA.USER_GRANT_ROLE(name, 'TEST_USER',0);

return 'everything ok';

errorabort:
rollback work;
result(__SQL_STATE);
result(__SQL_MESSAGE);
return concat('error: ',__SQL_STATE, ' - ',__SQL_MESSAGE);
}

Then I call "select testapp.test.testAbort('testUser3','xxx', 'xxx');"

Of course this certificate is not quite correct and Virtuoso rightly
complains causing the outer function to return: "error: 22023 - U: The
certificate have been supplied is not valid or corrupted"

But I have three problems here:
The first is that the exception is not returned to the parent, I can only
see it via the return value.  If I try to signal/resignal it, I trip the
exception handler and enter an infinite loop.
The second is that the user "testUser3" has been created and this work is
not aborted, presumably because it was committed in the USER_CREATE
function.

So, how do I remove a declared handler once I want to escalate an exception?
How can I prevent a function from committing work that I want to occur in a
transaction with other activity in a parent function?

Oh, and when I kill the DB process to break the exception handling loop, I
get an error on startup, that's problem three:
---
ERROR: Error executing a server init statement : 22023: SR528:
Uninitialized property qmfOkForAnySqlvalue in JSO instance <
http://www.openlinksw.com/virtrdf-data-formats#default-iid> of type <
http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat> --
DB.DBA.RDF_QUAD_FT_UPGRADE ()
---
It might not be related to what I was doing, I'm not sure.




On 16 December 2013 10:48, Hugh Williams  wrote:

> Hi Quentin,
>
> The log_enable should be removed, and unless there are no other commits or
> rollbacks the sequence will be executed in one transaction ...
>
>   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 11 Dec 2013, at 05:07, Quentin  wrote:
>
> Hi,
>
> If I'm executing an sql function that does some sparql, deletes some
> triples and calls a few other functions, can I force this to occur all
> within the context of one continuous transaction state?
>
> So if I have something like the below function and the
> someOtherFunction() throws an exception (or signal), can I abort the
> transaction and rollback the sparql insert?  Or will I find some
> results have already been committed?
>
> create procedure test.test.oneTransaction();
> {
> log_enable (0);
> exec('sparql insert.');
> test.test.someOtherFunction();
> log_enable (1);
> commit work;
> }
>
> --
> 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=84349831&iu=/4140/ostg.clktrk
> ___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>
>
>


-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au


On 16 December 2013 10:48, Hugh Williams  wrote:

> Hi Quentin,
>
> The log_enable should be removed, and unless there are no other commits or
> rollbacks the sequence will be executed in one transaction ...
>
>   Best Regards
> Hugh Williams
> Professional Services
> OpenLink Software, Inc.  //  http://www.openlinksw.com/
> Weblog   -- http://www.openlinksw.com/blogs/
> LinkedIn -

Re: [Virtuoso-users] problem with large filters

2013-12-22 Thread Quentin
Ian,

It may not be being truncated.  Some but not all of the sparql compilation
entries from trace_on() are truncated but it's only the debug output that
is being truncated, not the query itself.  This has caused me confusion
before.

Not guaranteed to work but you might try an alternate construct, if nothing
else it's easier to read and since it's a little more orthodox, it's more
likely to be well understood by the query optimiser.  A post from Hugh last
week suggests that there may be additional optimisation for IN based
lookups comoing though they may or may not apply to this usage.

select ?thing ?x ?y ?z
where {
?thing predicate1 ?x .
?thing predicate2 ?y .
?thing predicate3 ?z .
filter (?thing in (
<http://host/id/thing/1>,
<http://host/id/thing/2>,
...
))
}



On 19 December 2013 00:15, Ian Harrison  wrote:

> I'm hitting a problem with Virtuoso 7 with the use of large filters
> .. the scenario is that I'm setting a query variable value to be one
> of many things ... rather than returning all values for that query variable
>
> e.g. select ?yhing ?x ?y ?x where {?thing predicate1 ?x . ?thing
> predicate2 ?y . ?thing predicate3 ?z filter (? thing =
> <http://host/id/thing/1> || ?thing = <http://host/id/thing/2> || ?thing
> = <http://host/id/thing/3> || ?thing = <http://host/id/thing/4> ||
> ?thing = <http://host/id/thing/5> || 
>
>
> there might be 100-200 things in the filter list ... but there may be
> millions of instances of ?thing.
>
>
> The error thrown is:
>
> Virtuoso 37000 Error SQ156: Internal Optimized compiler error : unknown
> table for a column dfe in sqldf.c:1422.
> Please report the statement compiled.
>
> SPARQL query:
> Virtuoso 37000 Error SQ156: Internal Optimized compiler error : unknown
> table for a column dfe in sqldf.c:1422.
> Please report the statement compiled.
>
> With trace_on() setup, it l;ooks like the filter is being truncated. Can
> you try and replicate such a test case. It's important for my
> application, as I'm using the OR filter pattern, as a way of delivering
> data services of the form ... do a search to identify a set of things of
> interest and then return lots of data about the items that have been
> returned by the search . I'm open to suggestions of a workaround
> tpo, if this is aknown problem, to be able to handle such a data pattern.
>
> Ian
>
> --
> Ian HarrisonEmail: i...@big-data-analytics.com
> Tel: +44 (0)7580 618125
>
>
>
> --
> 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=84349831&iu=/4140/ostg.clktrk
> ___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>



-- 
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=84349831&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Performance in graph filters

2013-12-22 Thread Quentin
Thanks Hugh,
We don't have a problem with this but I'm a bit ignorant when it comes to
the sql implications of some sparql constructs and I wanted to get some
idea of the potential pitfalls.

It sounds like the construct I was intending is potentially problematic
right now but will be fine in the future.  So I guess I just implement it
as written and it will work itself out.




On 20 December 2013 01:00, Hugh Williams  wrote:

> Hi Quentin,
>
> Development indicate that the correct way is using an "INI" clause ie "?g
> in (, >G2>, …)" , as this does not make temporary tables. The problem
> you are getting is that you get one indexed access per distinct g because g
> is a key part of the rdf quad table, which is due to a bad query plan.
> There is an update already done and pending inclusion into open source that
> does the "IN" clause as an invisible hash join, i.e. hash join merged into
> index lookup and is one of the fastest on the block, including all the
> specialized column store data warehouses. With  the update the not in case
> is also very efficient. If obtain a query plan with the "explain" or
> "profile" functions and you see an "in_iter" on the g in front of an access
> to rdf_quad in the plan explain then you have the wrong thing.  If you have
> the rdf quad first and then hash partition+bloom than it is the good one.
>
> 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 13 Dec 2013, at 06:43, Quentin  wrote:
>
> > Hi,
> >
> > If I'm executing a query in sparql, in Virtuoso 7, that uses heavy graph
> filtering along the lines of:
> >
> > SELECT *
> > { GRAPH ?G {
> > filter ( ?G in (, ) )
> > 
> > }}
> >
> > Will this cause large temporary tables to be created or will it just do
> lookups against the Graph column of the Quad store?
> >
> > If the above is a bad idea, is there a more efficient way to join or
> filter graphs?
> >
> > A secondary question is would this query be rendered much more expensive
> if it included a subclause along the lines of:
> > SELECT *
> > { GRAPH ?G {
> > filter ( ?G in (, ) )
> > { GRAPH ?Ginner {
> > filter (?Ginner in ( ,, ) )
> > 
> >
> > Does this type of construction force temporary tables?
> > --
> > 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=84349831&iu=/4140/ostg.clktrk___
> > Virtuoso-users mailing list
> > Virtuoso-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>
>


-- 
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=84349831&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Performance in graph filters

2013-12-12 Thread Quentin
Hi,

If I'm executing a query in sparql, in Virtuoso 7, that uses heavy graph
filtering along the lines of:

SELECT *
{ GRAPH ?G {
filter ( ?G in (, ) )

}}

Will this cause large temporary tables to be created or will it just do
lookups against the Graph column of the Quad store?

If the above is a bad idea, is there a more efficient way to join or filter
graphs?

A secondary question is would this query be rendered much more expensive if
it included a subclause along the lines of:
SELECT *
{ GRAPH ?G {
filter ( ?G in (, ) )
{ GRAPH ?Ginner {
filter (?Ginner in ( ,, ) )


Does this type of construction force temporary tables?
-- 
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=84349831&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Virtuoso batch transactions

2013-12-10 Thread Quentin
Hi,

If I'm executing an sql function that does some sparql, deletes some
triples and calls a few other functions, can I force this to occur all
within the context of one continuous transaction state?

So if I have something like the below function and the
someOtherFunction() throws an exception (or signal), can I abort the
transaction and rollback the sparql insert?  Or will I find some
results have already been committed?

create procedure test.test.oneTransaction();
{
log_enable (0);
exec('sparql insert.');
test.test.someOtherFunction();
log_enable (1);
commit work;
}

-- 
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=84349831&iu=/4140/ostg.clktrk
___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Graph level security

2013-12-08 Thread Quentin
Hi,

I'm playing around with graph level security and have a setup where
multiple users use odbc to call canned sparql queries from exec inside sql
functions.

After granting permissions for some users on a given graph, I decide to
remove permissions from it.  I haven't found a function to remove all
permissions for a graph so I call: "UPDATE DB.DBA.RDF_GRAPH_USER SET
RGU_PERMISSIONS=0 where RGU_GRAPH_IID = iri_to_id('
http://example.org/testUser/exampleGraph/');

Unfortunately, after this call, my users still have access to the graph via
odbc or isql.  I can confirm that the RGU permission in the table was set
to 0 and 'nobody' also has 0 permission and the user has 0 permission
against #i0 (which I think represents default permissions).

So is there something I have to do to push a direct sql udpate to the table
to cascade through to the RDF security mechanisms?

Alternatively, if it's not permitted to directly update that table, is
there a way to remove all permissions from a dataset without having to
iterate through all users and apply the removal individually and
redundantly?

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Crash in conductor

2013-12-04 Thread Quentin
$ virtuoso-t -?
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)

When opening the Schemas tab under Linked Data.
Error 42S22

SQ063: No column to_del.
while executing the following statement:
#line 2330 "/DAV/VAD/conductor/rdf_schemas.vspx-sql"
create method vc_render_frm1 (inout control vspx_form) for
"DB"."dba".page_908e67c2cf7b187e80c845d09496bd09VAD_conductor_rdf__schemas_vspx
...

Followed by a dump of that method.


Additionally, when opening the Linked Data->Graphs tab, I am taken to
User Security and the Graphs sub-tab is inaccessible (the td element
contains no href tag).

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Transitivity question (and crash report)

2013-12-03 Thread Quentin
If anyone is trying to do something like I was above, get all the triples
within a certain distance of an initial subject, then this is the sparql
that I ended up with:
==
prefix : <http://example.org/ontology/test/>
with <http://example.org/dataset/test/>
SELECT distinct ?s ?p ?o bif:either(isIri(?o),'URI',datatype(?o)) as ?type
WHERE
{
 ?anchor ?pp ?s
  OPTION ( TRANSITIVE,
   t_min (0),
   t_max (2), #
   t_in (?anchor),
   t_out (?s),
   t_no_cycles,
   t_distinct ) .
  FILTER ( ?anchor = <
http://example.org/data/test/DummyClass_1>)
 ?s ?p ?o .
  }
ORDER BY ?s
==

Transitivity in Virtuoso seems very elegant, this replaced pages of code
that was generating complicated nested queries and seems to work very well.


On 3 December 2013 18:48, Quentin  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  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 ('st

Re: [Virtuoso-users] Transitivity question (and crash report)

2013-12-03 Thread Quentin
Testing in my own environment just now, it crashed on that query but after
applying last night's release to git/develop7, it survives and reports that
same error.

So it looks like DBPedia and git both received a patch that fixed this
sometime in the last 16 hours.


On 4 December 2013 09:53, Quentin  wrote:

> Interesting, I get that too this morning but last night the server hung
> for a while and then reported that it was unavailable.  Perhaps it was a
> coincidence.
>
> Thank you for the documentation link.
>
>
> On 3 December 2013 21:40, Hugh Williams  wrote:
>
>> 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  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  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.o

Re: [Virtuoso-users] Transitivity question (and crash report)

2013-12-03 Thread Quentin
Interesting, I get that too this morning but last night the server hung for
a while and then reported that it was unavailable.  Perhaps it was a
coincidence.

Thank you for the documentation link.


On 3 December 2013 21:40, Hugh Williams  wrote:

> 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  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  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 everythi

Re: [Virtuoso-users] Transitivity question (and crash report)

2013-12-02 Thread Quentin
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  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


[Virtuoso-users] Transitivity question (and crash report)

2013-12-02 Thread Quentin
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
--
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


[Virtuoso-users] SPARQL Transitive options - t_direction

2013-12-02 Thread Quentin
Having read through this:
http://www.openlinksw.com/dataspace/doc/dav/wiki/Main/VOSScalableInference

I've been playing with sparql transitivity and it seems pretty cool so
far.  I'm wondering if there is any documentation on the option parameter:
"t_direction"?

Evidently it can be 1 or 3 but I'm not sure what those values actually do.
-- 
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


Re: [Virtuoso-users] Sql exec function documentation

2013-12-02 Thread Quentin
The error I got was:

SQLState: 22023

Message: SR169: signal state should be an integer 100 (NO DATA FOUND)
or a string value, not an INTEGER


However it was my fault, I had overlooked the line "state := '0';" and
wasn't setting the state variable to an initial value as I had assumed the
'' was set by exec on a successful compilation/execution.  In fact, it
seems to be unchanged and the variable was initialised as integer 0 which
broke signal().


On 2 December 2013 22:45, Hugh Williams  wrote:

> Hi Quentin,
>
> The example as defined in the docs link does work (apart from minor error
> in variable declarations which will be corrected) :
>
> SQL> create procedure tb_is_empty (in tb varchar) {   declare state, msg,
> descs, rows any;   state := '0';   exec (sprintf ('select 1 from %s',
> tb), state, msg, vector (), 1, descs, rows);if (state <> '0')
>   signal (state, msg);if (length (rows) = 0) return 1;else
> return 0; };
>
> Done. -- 1 msec.
> SQL> create table hugh (c1 integer);
>
>
>
> Done. -- 10 msec.
> SQL> select tb_is_empty ('sys_users');
> tb_is_empty
> VARCHAR
>
> ___
>
> 0
>
> 1 Rows. -- 29 msec.
> SQL> select tb_is_empty ('hugh');
> tb_is_empty
> VARCHAR
>
> ___
>
> 1
>
> 1 Rows. -- 1 msec.
> SQL>
>
> Thus what is the use case in which you are encountering a problem ?
>
>   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 2 Dec 2013, at 06:13, Quentin  wrote:
>
> The documentation is a little outdated here:
> http://docs.openlinksw.com/virtuoso/fn_exec.html
>
> It describes catching exceptions with something like:
>
>   if (state <> '0')
> signal (state, msg);
>
> However this will not work and throws various errors.  Something like the
> below will work:
>
> declare errorCode, errorMessage any;
> ...
> if (errorCode <> 0)
> signal (cast(errorCode as VARCHAR), errorMessage);
>
>
> The state/errorCode variable needs to be an integer for comparison and a
> varchar or any in signal().
>
>
> --
> 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
>
>
>


-- 
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


[Virtuoso-users] Sql exec function documentation

2013-12-01 Thread Quentin
The documentation is a little outdated here:
http://docs.openlinksw.com/virtuoso/fn_exec.html

It describes catching exceptions with something like:

  if (state <> '0')
signal (state, msg);

However this will not work and throws various errors.  Something like the
below will work:

declare errorCode, errorMessage any;
...
if (errorCode <> 0)
signal (cast(errorCode as VARCHAR), errorMessage);

The state/errorCode variable needs to be an integer for comparison and a
varchar or any in signal().


-- 
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


[Virtuoso-users] Possible incorrect results using FILTER NOT EXISTS in DBPedia

2013-11-25 Thread Quentin
Incorrect results appear to be generated when running this against:
http://dbpedia.org/sparql

As written, two rows are returned which are correct.  When the NOT EXISTS
filter is uncommented, no results are returned despite that triple clearly
not existing.
==
prefix : <http://dbpedia.org/ontology/>
with <http://dbpedia.org>
SELECT distinct(?o) WHERE {
?s :birthPlace ?o .
FILTER ( ?o IN (<http://dbpedia.org/resource/Colchester>, <
http://dbpedia.org/resource/Cookstown>))

# If you uncomment this line, no results will be returned.
#FILTER NOT EXISTS { ?o  "NONEXISTENT
LITERAL"^^xsd:string .}
} LIMIT 10
==

Am I misinterpreting the implementation of NOT EXISTS?

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Virtuoso 7 crash in pl-sql function

2013-11-25 Thread Quentin
By dataset, I mean a url that represents a graph name.
As in: http://example.org/dataset/TestData/


On 26 November 2013 13:07, Quentin  wrote:

> The offending code, that reliably reproduces the crash in my environment,
> is:
> split_and_decode(in_datasets,0,'%3B');
>
> Where in_datasets is a urlencoded. semicolon separated list of datasets.
>
> $ virtuoso-t -?
> Virtuoso Open Source Edition (Column Store) (multi threaded)
> Version 7.0.1-dev.3203-pthreads as of Nov 11 2013
> Compiled for Linux (x86_64-unknown-linux-gnu)
>
> --
> Quentin | Clear Blue Water Pty Ltd
> quent...@clearbluewater.com.au
>



-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Virtuoso 7 crash in pl-sql function

2013-11-25 Thread Quentin
The offending code, that reliably reproduces the crash in my environment,
is:
split_and_decode(in_datasets,0,'%3B');

Where in_datasets is a urlencoded. semicolon separated list of datasets.

$ virtuoso-t -?
Virtuoso Open Source Edition (Column Store) (multi threaded)
Version 7.0.1-dev.3203-pthreads as of Nov 11 2013
Compiled for Linux (x86_64-unknown-linux-gnu)

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Odbc memory issue - Virtuoso 7

2013-11-21 Thread Quentin
Aah, apparently something in PHP/VirtuosoODBC really doesn't like
encountering DB_NULL as [a|the first] field in a resultset row.

Modifying the pl-sql function to prevent null values being returned
resolved the issue though something seems to be broken in the area of
allocating memory based on resultset field types.


On 21 November 2013 19:57, Quentin  wrote:

> I'm trying to track down a memory issue with apache/php/odbc when talking
> to Virtuoso.
>
> The error is: "PHP Fatal error:  Out of memory (allocated 3407872) (tried
> to allocate 18446744073709551613 bytes) in..."
> The actual line in PHP is: return (odbc_exec($this->db_link, $db_query));
>
> The db connection was opened with:  $this->db_link =
> odbc_connect($this->dsn, $this->db_user, $this->db_pass,
> SQL_CUR_USE_DRIVER);
>
> The virtuoso odbc drivers in use were taken from the build of the database
> being accessed (same architecture/OS on both boxen):
> Virtuoso Open Source Edition (Column Store) (multi threaded)
> Version 7.0.1-dev.3203-pthreads as of Nov 11 2013
> Compiled for Linux (x86_64-unknown-linux-gnu)
>
> Are there any current issues I should be aware of or is there any advice
> you could offer about this?
>
> The actual resultset is about 7 rows from a result set thrown by an sql
> function via exec_result_names/exec_result but it seems to ask for quite a
> lot of memory and I'm not sure our budget extends to exabytes of ram.
>
> --
> Quentin | Clear Blue Water Pty Ltd
> quent...@clearbluewater.com.au
>



-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Odbc memory issue - Virtuoso 7

2013-11-21 Thread Quentin
I'm trying to track down a memory issue with apache/php/odbc when talking
to Virtuoso.

The error is: "PHP Fatal error:  Out of memory (allocated 3407872) (tried
to allocate 18446744073709551613 bytes) in..."
The actual line in PHP is: return (odbc_exec($this->db_link, $db_query));

The db connection was opened with:  $this->db_link =
odbc_connect($this->dsn, $this->db_user, $this->db_pass,
SQL_CUR_USE_DRIVER);

The virtuoso odbc drivers in use were taken from the build of the database
being accessed (same architecture/OS on both boxen):
Virtuoso Open Source Edition (Column Store) (multi threaded)
Version 7.0.1-dev.3203-pthreads as of Nov 11 2013
Compiled for Linux (x86_64-unknown-linux-gnu)

Are there any current issues I should be aware of or is there any advice
you could offer about this?

The actual resultset is about 7 rows from a result set thrown by an sql
function via exec_result_names/exec_result but it seems to ask for quite a
lot of memory and I'm not sure our budget extends to exabytes of ram.

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] xsd:boolean in Virtuoso 7

2013-11-07 Thread Quentin
Is it likely that Virtuoso 7 will come to support xsd:boolean without
integer conversion?

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Virtuoso definition of calendar week

2013-09-19 Thread Quentin
In the meantime, this function will generate week numbers consistent with
ISO8601.

create procedure DB.DBA.ISOweek( IN targetDate datetime ) RETURNS integer
{
declare week, ISOweekdaynum integer;

-- ISO8601 is Monday based, Virtuoso is Sunday based
ISOweekdaynum := dayofweek(targetDate)-1;

-- source: http://en.wikipedia.org/wiki/ISO_week_date#Calculation
week := floor((dayofyear(targetDate) - ISOweekdaynum +10)/7);
 return week;
}



On 18 September 2013 16:47, Quentin  wrote:

> There are multiple standards for defining calendar weeks though ISO8601
> though most would have the 2013-01-01 in week one that ends on 6th
> January.  We use ISO8601 generally and it's pretty common (<
> http://en.wikipedia.org/wiki/ISO_8601#Week_dates>).
>
> There's unfortunately no information available about Virtuoso's
> implementation: <http://docs.openlinksw.com/virtuoso/fn_week.html>.
>
> Some experimentation shows the following results:
> select
> bif:week(xsd:datetime('2013-01-01T00:00:00Z')) as ?1stAsWeek
> bif:dayname(xsd:datetime('2013-01-01T00:00:00Z')) as ?1stAsDay
> bif:week(xsd:datetime('2013-01-07T00:00:00Z')) as ?7thAsWeek
> bif:dayname(xsd:datetime('2013-01-07T00:00:00Z')) as ?7thAsDay
> bif:week(xsd:datetime('2013-01-08T00:00:00Z')) as ?8thAsWeek
> bif:dayname(xsd:datetime('2013-01-08T00:00:00Z')) as ?8thAsDay
> {}   1stAsWeek 1stAsDay 7thAsWeek 7thAsDay 8thAsWeek 8thAsDay  1 Tuesday 1
> Monday 2 Tuesday
> It seems like this is just counting weeks from the 1st/Jan and counting a
> new week every seven days after that.  Are there any plans to provide more
> standardised usage of calendar weeks?
>
> --
> Quentin | Clear Blue Water Pty Ltd
> quent...@clearbluewater.com.au
>



-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Virtuoso definition of calendar week

2013-09-18 Thread Quentin
There are multiple standards for defining calendar weeks though ISO8601
though most would have the 2013-01-01 in week one that ends on 6th
January.  We use ISO8601 generally and it's pretty common (<
http://en.wikipedia.org/wiki/ISO_8601#Week_dates>).

There's unfortunately no information available about Virtuoso's
implementation: <http://docs.openlinksw.com/virtuoso/fn_week.html>.

Some experimentation shows the following results:
select
bif:week(xsd:datetime('2013-01-01T00:00:00Z')) as ?1stAsWeek
bif:dayname(xsd:datetime('2013-01-01T00:00:00Z')) as ?1stAsDay
bif:week(xsd:datetime('2013-01-07T00:00:00Z')) as ?7thAsWeek
bif:dayname(xsd:datetime('2013-01-07T00:00:00Z')) as ?7thAsDay
bif:week(xsd:datetime('2013-01-08T00:00:00Z')) as ?8thAsWeek
bif:dayname(xsd:datetime('2013-01-08T00:00:00Z')) as ?8thAsDay
{}   1stAsWeek 1stAsDay 7thAsWeek 7thAsDay 8thAsWeek 8thAsDay  1 Tuesday 1
Monday 2 Tuesday
It seems like this is just counting weeks from the 1st/Jan and counting a
new week every seven days after that.  Are there any plans to provide more
standardised usage of calendar weeks?

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Why does delete/insert time out but using WITH clause works fine

2013-06-13 Thread Quentin
Another detail that is relevant is that the SPO pattern exists in about 15
graphs but we're only doing an update to the set of triples in the named
graph.

The background is that we're storing a configured report for a given user
but for convenience we copied that report into the graphs used by a dozen
or so other users without changing the subject.  When we want to update a
user's copy of the report, we get this problem.


On 14 June 2013 11:54, Quentin  wrote:

> Also:
> $ virtuoso-t -?
> Virtuoso Open Source Edition (multi threaded)
> Version 6.1.6.3127-pthreads as of Nov 20 2012
> Compiled for Linux (x86_64-pc-linux-gnu)
>
>
> On 14 June 2013 11:47, Quentin  wrote:
>
>> I have a problem that I solved but I'm still not sure why it occurred.
>>
>> Our application is updating a small number of triples with the below
>> query, constructed in code rather than hand-written.
>>
>> delete from graph <
>> http://example.com/datasets/myProject/widgets/1631784244/>  {
>> <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/title> ?o0 .
>> <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/xAxisColumn> ?o1 .
>> <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/chartType> ?o2 .
>> <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/category> ?o3 .
>> <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/name> ?o4 .
>> <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/chartLevel> ?o5 .
>>   }  where {
>> optional { <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/title> ?o0 . }
>> optional { <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/xAxisColumn> ?o1 . }
>> optional { <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/chartType> ?o2 . }
>> optional { <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/category> ?o3 . }
>> optional { <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/name> ?o4 . }
>> optional { <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/chartLevel> ?o5 . }
>> }
>> insert into graph <
>> http://example.com/datasets/myProject/widgets/1631784244/> {
>> <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/title> "Report Name" .
>> <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/xAxisColumn> "AxisName" .
>> <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/chartType> "column" .
>> <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/category> "UserDefinedReports" .
>> <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/name> "Report Name" .
>> <http://example.com/data/myProject/5163c11f07720918117864> <
>> http://example.com/ontology/sdr/chartLevel> "" .
>> }
>>
>> When this query is performed in conductor, it times out.  When performed
>> by odbc then it succeeds but takes about 12m40s to execute.
>>
>> Refactoring as a WITH  DELETE {...} INSERT {...} WHERE {...} using
>> exactly the same patterns above, it all works in under a second.
>>
>> What's the difference there?  Is there an error in the first example that
>> is causing poor behaviour?
>>
>> I've looked at the explain plans for the two versions though I find them
>> difficult to interpret.
>>  --
>> Quentin | Clear Blue Water Pty Ltd
>> quent...@clearbluewater.com.au
>>
>
>
>
> --
> Quentin | Clear Blue Water Pty Ltd
> quent...@clearbluewater.com.au
>



-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Why does delete/insert time out but using WITH clause works fine

2013-06-13 Thread Quentin
Also:
$ virtuoso-t -?
Virtuoso Open Source Edition (multi threaded)
Version 6.1.6.3127-pthreads as of Nov 20 2012
Compiled for Linux (x86_64-pc-linux-gnu)


On 14 June 2013 11:47, Quentin  wrote:

> I have a problem that I solved but I'm still not sure why it occurred.
>
> Our application is updating a small number of triples with the below
> query, constructed in code rather than hand-written.
>
> delete from graph <
> http://example.com/datasets/myProject/widgets/1631784244/>  {
> <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/title> ?o0 .
> <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/xAxisColumn> ?o1 .
> <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/chartType> ?o2 .
> <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/category> ?o3 .
> <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/name> ?o4 .
> <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/chartLevel> ?o5 .
>   }  where {
> optional { <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/title> ?o0 . }
> optional { <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/xAxisColumn> ?o1 . }
> optional { <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/chartType> ?o2 . }
> optional { <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/category> ?o3 . }
> optional { <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/name> ?o4 . }
> optional { <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/chartLevel> ?o5 . }
> }
> insert into graph <
> http://example.com/datasets/myProject/widgets/1631784244/> {
> <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/title> "Report Name" .
> <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/xAxisColumn> "AxisName" .
> <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/chartType> "column" .
> <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/category> "UserDefinedReports" .
> <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/name> "Report Name" .
> <http://example.com/data/myProject/5163c11f07720918117864> <
> http://example.com/ontology/sdr/chartLevel> "" .
> }
>
> When this query is performed in conductor, it times out.  When performed
> by odbc then it succeeds but takes about 12m40s to execute.
>
> Refactoring as a WITH  DELETE {...} INSERT {...} WHERE {...} using
> exactly the same patterns above, it all works in under a second.
>
> What's the difference there?  Is there an error in the first example that
> is causing poor behaviour?
>
> I've looked at the explain plans for the two versions though I find them
> difficult to interpret.
> --
> Quentin | Clear Blue Water Pty Ltd
> quent...@clearbluewater.com.au
>



-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Why does delete/insert time out but using WITH clause works fine

2013-06-13 Thread Quentin
I have a problem that I solved but I'm still not sure why it occurred.

Our application is updating a small number of triples with the below query,
constructed in code rather than hand-written.

delete from graph <http://example.com/datasets/myProject/widgets/1631784244/>
 {
<http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/title> ?o0 .
<http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/xAxisColumn> ?o1 .
<http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/chartType> ?o2 .
<http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/category> ?o3 .
<http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/name> ?o4 .
<http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/chartLevel> ?o5 .
  }  where {
optional { <http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/title> ?o0 . }
optional { <http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/xAxisColumn> ?o1 . }
optional { <http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/chartType> ?o2 . }
optional { <http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/category> ?o3 . }
optional { <http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/name> ?o4 . }
optional { <http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/chartLevel> ?o5 . }
}
insert into graph <http://example.com/datasets/myProject/widgets/1631784244/>
{
<http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/title> "Report Name" .
<http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/xAxisColumn> "AxisName" .
<http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/chartType> "column" .
<http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/category> "UserDefinedReports" .
<http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/name> "Report Name" .
<http://example.com/data/myProject/5163c11f07720918117864> <
http://example.com/ontology/sdr/chartLevel> "" .
}

When this query is performed in conductor, it times out.  When performed by
odbc then it succeeds but takes about 12m40s to execute.

Refactoring as a WITH  DELETE {...} INSERT {...} WHERE {...} using
exactly the same patterns above, it all works in under a second.

What's the difference there?  Is there an error in the first example that
is causing poor behaviour?

I've looked at the explain plans for the two versions though I find them
difficult to interpret.
-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Virtuoso 6.16 and possible encoding weirdness?

2013-03-12 Thread Quentin
I occasionally get Virtuoso 37000 Error SQ074: syntax error at '#' before
'SELECT

It only seems to happen when copying a query from gmail into conductor.  Is
this a known weirdness with utf8 or something?

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Implicit type overrides explicit type on assignment

2012-11-12 Thread Quentin
Is this a bug?  It doesn't seem desirable behaviour.

=
create procedure
DB.q.testBug() returns varchar
{
declare str varchar;
declare intIn int;

intIn := 4;
str := intIn;

return concat('test:',str,'.');
}
=

In isql:
=
select DB.q.testBug();
=
Query result:  testBug
VARCHAR

SQLState: 22023

Message: SR007: Function concat needs a string or UNAME or NULL as
argument 2, not an arg of type INTEGER (189)

=

I would (perhaps naively) expect that the error should be in the uncast
assignment if we are being strictly typed or implicitly cast the variable
to varchar on assignment if we want to be weakly typed.

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] FILTERs not playing well with OPTIONAL?

2012-06-04 Thread Quentin
Hi,

Using VOS: 06.01.3127.

I have what looks like this
bug<http://sourceforge.net/tracker/?func=detail&aid=3397514&group_id=161622&atid=820574>
.

A query works fine up to a point and then returns zero results, despite
there being results to return.

The query has three FILTERs, one inside an OPTIONAL clause.  If the clause
is not optional then the query returns results, if one of the outside
FILTERs is removed then the query returns results.  If the OPTIONAL clause
is empty "OPTIONAL{}" then no results are returned but if removed then
results are returned.

The query is this (more or less):
prefix ont: <http://stuff/ontology>
select ?Item, xsd:int(?qtyA), xsd:int(?qtyB), ?Location  { GRAPH <
http://stuff>
{
?Header ont:Receiver "123"; ont:DateFrom ?dateFrom
filter((bif:month(xsd:date(?dateFrom)) = 2) &&
(bif:year(xsd:date(?dateFrom)) = 2012))
?Header ont:HeaderHasLines ?lis . ?lis ont:ItemID ?Item filter(?Item =
"AAA")

?lis ont:LineHasLineDetail  ?lidA . ?lidA ont:Code "X" ;
ont:LineDetailHasQuantity ?dqA . ?dqA ont:Quantity ?qtyA ; ont:LocationCode
?Location.

OPTIONAL {?lis ont:LineHasLineDetail  ?lidB . ?lidB ont:Code "Y" ;
ont:LineDetailHasQuantity ?dqB . ?dqB ont:Quantity ?qtyB ; ont:LocationCode
?LocationB filter(SAMETERM(?Location,?LocationB))}
} }

I think I just saw that the SAMETERM isn't strictly necessary but it still
feels like a bug to me.
-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au


[Virtuoso-users] SPARQL FILTER by xsd types

2012-05-22 Thread Quentin
Hi,

I have a bit of weirdness though it's been resolved/worked-around.

A query that looks like:
prefix ont: 
select ?dq { GRAPH <http://stuff> { ?li ont:code "S" . ?li ont:liHasDQ ?dq
. ?dq ont:Quantity ?qty . ?dq ont:Quantity "0"^^xsd:int } }

Or with a filter:
prefix ont: 
select ?dq { GRAPH <http://stuff> { ?li ont:code "S" . ?li ont:liHasDQ ?dq
. ?dq ont:Quantity ?qty . ?dq ont:Quantity ?qty FILTER (?qty= "0"^^xsd:int)
} }

These don't return and under some circumstances, crash Virtuoso.  Changing
the Quantity to a variable bind and with a FILTER doesn't help much though
I haven't observed it to crash.  But if I change the FILTER to "(?qty = 0)"
then it returns in a few seconds.

Any idea why this would happen?  The underlying literal is a typed as
(actual example): "01"^^<http://www.w3.org/2001/XMLSchema#int>.
Casting to xsd:int doesn't help either, that won't return in reasonable
time either.

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au


Re: [Virtuoso-users] Duplicate graphs and "empty" graphs

2012-05-15 Thread Quentin
Aah, both problems have the same cause.  It's "localhost" being helpfully
substituted into the uri by some operations.  Now I have a localhost/...
version of the graph as well as a a.b.c./... version of it.  And a
localhost version of a graph that was created by an "INSERT INTO
" that must be addressed as  to get results.

On Tue, May 15, 2012 at 4:58 PM, Quentin wrote:

> Hi,
>
> Are there any circumstances where the graphs tab of Conductor would show
> duplicate graphs?
>
> I have a bulk load of RDF that seems to occasionally create duplicate
> graphs with identical names.
>
> As a separate curiosity and more of a problem, I also have a graph that
> exists in the Conductor list and whose creation statement ("INSERT INTO
> <...> WHERE ...") was reported to insert triples but when I interrogate the
> graph, it seems to be empty or not really exist.
>
> Any ideas?
> --
> Quentin | Clear Blue Water Pty Ltd
> quent...@clearbluewater.com.au
>



-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au


[Virtuoso-users] Duplicate graphs and "empty" graphs

2012-05-15 Thread Quentin
Hi,

Are there any circumstances where the graphs tab of Conductor would show
duplicate graphs?

I have a bulk load of RDF that seems to occasionally create duplicate
graphs with identical names.

As a separate curiosity and more of a problem, I also have a graph that
exists in the Conductor list and whose creation statement ("INSERT INTO
<...> WHERE ...") was reported to insert triples but when I interrogate the
graph, it seems to be empty or not really exist.

Any ideas?
-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au


[Virtuoso-users] Handling large file sizes in variables

2012-05-01 Thread Quentin
Hi,

I'm attempting to manipulate a large file (4.4GB or so) in a procedure.

As part of my processing the file, I'm maintaining a buffer and index.  My
problem comes in comparing my index to the filesize.  file_stat(filePath,
1) returns the size as a varchar and atoi() over that gives me a truncated
value (423557276).  atof has precision problems, giving a value of
4718524416.00 instead of 4718524572 which proves to be an issue.

Are there any suggestions on ways to use file_stat on large files?  It
becomes an issue when I want to do something like
while(bufferIndex<=fileSize)...

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au


[Virtuoso-users] non-fatal errors during sponge

2012-04-17 Thread Quentin
Hi,

I'm doing a sponge of a large JSON file using a custom cartridge and if I
turn TRACE_ON() then somewhere during the import, I'm seeing pages and
pages of errors that look like:
"02:49:56 ERRS_0 42001 XPQ?? Magnitude is too big (950061485) to be
packed into int"

It doesn't seem to hurt the sponging any but I'm curious what it is and
whether it's evidence of something I'm doing wrong or something I should
worry about in the future?

Quentin
ClearBlueWater.com.au


[Virtuoso-users] Exposing views/tables to JDBC

2012-03-06 Thread Quentin Serrurier
Hi,

I'm connecting to Virtuoso via virtjdbc4.jar (OpenLink Virtuoso(TM) Driver
for JDBC(TM) Version 4.x [Build 3.57]) from RapidMiner 5.2.001.

I can access graphs using embedded SPARQL and that works ok if I hand-code
the SQL but the integrated functions in RapidMiner have problems, they see
DB/DBA/WS schema tables but only a subset of them and not any views that I
create.

I'm not at all sure that this is a Virtuoso problem but I am curious about
why some tables are visible and not others.  Is there anything that these
tables have in common that would make them more accessible to a naive use
of jdbc?

The exposed tables:
http://bayimg.com/FanimAaDb
http://bayimg.com/gAniBaADB

-- 
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au