Hi, Beppe --

Bringing this back to the list (as you suggested I might), as 
others may notice something I have missed...


On Feb 7, 2017, at 04:16 AM, Beppe Mazzola <beppemazz...@gmail.com> wrote:
> 
> Hi Ted
> 
> Thank you for your answer.
> 
> 2017-02-06 20:21 GMT+00:00 Ted Thibodeau Jr <tthibod...@openlinksw.com>:
> 
>> On Feb 6, 2017, at 12:33 PM, Beppe Mazzola <beppemazz...@gmail.com> wrote:
>> >
>> > Hi to everybody
>> >
>> > I am new to Virtuoso. I am using Virtuoso Open Source 7 in
>> > both Windows and Linux
>> 
>> Hi, Beppe --
>> 
>> VOS 7 covers several years and includes many minor-versions.
>> It's often helpful (though not always necessary) to know the
>> exact version in use.  This is usually best discovered on the
>> command-line with --
>> 
>>    {virtuoso-binary-name} -?
>> 
>> -- e.g. --
>> 
>>    virtuoso-t -?
>> 
>> The first several lines should be provided, as they may all
>> be relevant.  The `Usage:` section can generally be left off.
> 
> The Virtuoso releases I am using are the following
> 
> WINDOWS
> Virtuoso Open Source Edition (multi threaded)
> Version 7.2.4.3217-threads as of Apr 25 2016
> Compiled for Win64 (x86_64-generic-win-64)
> Copyright (C) 1998-2016 OpenLink Software
> 
> LINUX
> Virtuoso Open Source Edition (Column Store) (multi threaded)
> Version 7.2.4.2.3217-pthreads as of Feb  3 2017
> Compiled for Linux (x86_64-unknown-linux-gnu)
> Copyright (C) 1998-2016 OpenLink Software

Those are indeed current; thank you for confirming.


>> > I am trying to delete the content of a graph with 75 triples.
>> > I have tried using the following statements both in ISQL and
>> > in the Orchestrator. The whole graph removal is tried as well.
>> >
>> > [...]
>> >
>> > They do not issue errors, but the graph content is not deleted.
>> 
>> 
>> This command should completely drop the graph and all statements
>> contained therein --
>> 
>>    SPARQL DROP SILENT <Graph-IRI> ;
>> 
>> 
>> If this call is made within a transaction, you might be losing
>> its effect by not concluding the transaction with --
>> 
>>    COMMIT WORK ;
>> 
>> 
>> I'm not aware of any bugs along this line, but it's possible
>> you've encountered one in the version you're running, or that
>> there's a larger context leading to the behavior you've described.
> 
> The context in which I have executed for example the DROP SILENT GRAPH 
> statement is I think the simplest. Here is Linux a session where I have used 
> the command that shows the graph is not dropped. I have used the suggested 
> commit work as well.

I'm wondering whether you may have some accidental error in your
graph name...  You can check by executing something like this --

   SPARQL SELECT DISTINCT ?g 
      WHERE 
        { GRAPH ?g { ?s ?p ?o } . 
          FILTER ( CONTAINS ( STR ( ?g ), "pesticides" ) ) 
        } ;



> [mazzola@s-sanco-cafe-apps virtuoso]$ ./bin/isql
> OpenLink Interactive SQL (Virtuoso), version 0.9849b.
> Type HELP; for help and EXIT; to exit.
> SQL> SPARQL DROP SILENT GRAPH 
> <http://test.com/semantic_webgate/dataset/pesticides/resource#> ;
> 
> Done. -- 15 msec.
> SQL> SPARQL select * from 
> <http://test.com/semantic_webgate/dataset/pesticides/resource#> { ?s ?p ?o };
> s                                                                             
>     p                                                                         
>         o
> VARCHAR                                                                       
>     LONG VARCHAR                                                              
>         LONG VARCHAR
> _______________________________________________________________________________
> 
> http://test.com/semantic_webgate/dataset/pesticides/resource/substance-1#this 
>  http://www.w3.org/1999/02/22-rdf-syntax-ns#type                              
>      
> http://test.com/schemas/semantic_webgate/dataset/pesticides/resource/SUBSTANCES
> ...
> 75 Rows. -- 20 msec.
> SQL> COMMIT WORK ;
> 
> Done. -- 1 msec.
> SQL> SPARQL select * from 
> <http://test.com/semantic_webgate/dataset/pesticides/resource#> { ?s ?p ?o };
> s                                                                             
>     p                                                                         
>         o
> VARCHAR                                                                       
>     LONG VARCHAR                                                              
>         LONG VARCHAR
> _______________________________________________________________________________
> 
> http://test.com/semantic_webgate/dataset/pesticides/resource/substance-1#this 
>  http://www.w3.org/1999/02/22-rdf-syntax-ns#type                              
>      
> http://test.com/schemas/semantic_webgate/dataset/pesticides/resource/SUBSTANCES
> ...
> 75 Rows. -- 19 msec.
> SQL>
> 
> I see there might be a work-around deleting the graph triples directly from 
> the relational table.
> Is this statement in my case equivalent to the CLEAR GRAPH command?
> 
> SQL> DELETE FROM DB.DBA.RDF_QUAD WHERE g = iri_to_id 
> ('http://test.com/semantic_webgate/dataset/pesticides/resource#');

It's usually better to use SPARQL features against graph data,
than to jump into the SQL tables.  Virtuoso does a fair amount
of management work under the covers, and there may be several
SQL actions necessary to replace a single SPARQL action.

Her are two equivalent commands you can use to remove all the
statements from a given graph -- 

   CLEAR GRAPH <graphname>

   DELETE FROM <graphname> WHERE { ?s ?p ?o } 

Worth noting, it isn't usually necessary to explicitly DROP a GRAPH 
by name, as removing all its triples (whether with CLEAR or DELETE) 
does most everything Virtuoso cares about.

See --

- http://docs.openlinksw.com/virtuoso/rdfsparul/#rdfsparulexamples2

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



>> > It happens both in Windows and in Linux as well as with other 
>> > graphs.
>> >
>> > To execute the commands the user I am logged in is the one
>> > who have generated the graph with R2RML, and has the dba role.
>> >
>> > If I query the available graphs I see the one I am trying to
>> > empty. So it's there.
>> >
>> > SELECT ?g count(?g) as ?cnt
>> > {
>> >  GRAPH ?g {?s ?p ?o .}
>> > } GROUP BY ?g
>> >
>> > g     cnt
>> > http://test.com/semantic_webgate/dataset/pesticides/resource#
>> > 75
>> >
>> >
>> > My virtuoso.ini file has only these lines modified.
>> > SQL_UTF8_EXECS   = 1
>> > DefaultHost                = test.com
>> > DirsAllowed                = ., ../vad, C:/tmp
>> 
>> 
>> Note that "test.com" is a live domain, so you may get some
>> surprising results when working with this setting.
>> 
>> "example.com" is usually a better choice, or an actual FQDN
>> under your control, optimally resolving to your Virtuoso host.
> 
> I just substituted my host name with a fancy one before
> sending the e-mail. But is the IRI treated in Virtuoso just
> like a unique string? I mean, is it needed it resolves to an
> HTTP correct response?

It's neither a necessarily unique string, nor required that it
be dereferenceable -- but it is better if both of these are true.

It is best to get into the habit of uniquely naming things with 
derefernceable URIs (that is, each URI should identify only one 
thing, though each thing may be identified  ["co-referenced"] by 
multiple "synonym" URIs; and each URI should resolve, so you can 
look them up at any time).  You never know what experiment will
be the winner, and it's often easier to keep results that work
than to exactly re-execute the steps that got you there.

I hope that helps!

Ted



> Thanks Ted a lot for your help!
> 
> Cheers
> 
> Beppe
> 
> 
> 
>> Regards,
>> 
>> Ted
>> 
>> 
>> > Anyone has any idea of the reason why I cannot delete the graph content?
>> >
>> > Thanks a lot in advance!
>> >
>> > Cheers
>> >
>> > Beppe

--
A: Yes.                          http://www.idallen.com/topposting.html
| Q: Are you sure?           
| | A: Because it reverses the logical flow of conversation.
| | | Q: Why is top posting frowned upon?

Ted Thibodeau, Jr.           //               voice +1-781-273-0900 x32
Senior Support & Evangelism  //        mailto:tthibod...@openlinksw.com
                             //              http://twitter.com/TallTed
OpenLink Software, Inc.      //              http://www.openlinksw.com/
         10 Burlington Mall Road, Suite 265, Burlington MA 01803
     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








Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

Reply via email to