"2017-06-13T05:42:16.997509"^^ . "VirtSPARUL" . . . . "2017-06-13T05:42:16Z" . "VirtSPARUL" . . "2017-06-13T05:42:16Z" . . . . . . . . . "%VOSWARNING%\n\n\n%META:TOPICPARENT{name=\"VOSSPARQL\"}%\n---++SPARUL\n\nSPARUL is an Update Language For RDF Graphs.\n\nSince version 5.0, Virtuoso has supported the [[http://jena.hpl.hp.com/~afs/SPARQL-Update.html][SPARQL/Update]] (SPARUL) extension of SPARQL.\nThis is sufficient for most routine data manipulation operations. \n\nIf SPARQL_UPDATE role is granted to SPARQL user, then data manipulation statements may be executed via the SPARQL Web service endpoint; if SPARQL_UPDATE role is not granted, users are limited to data querying statements.\n\n---+++ Related Functions\n\nTwo functions allow the user to alter RDF storage by inserting or deleting all triples listed in some vector.\n\nBoth functions receive an IRI of a graph that should be altered and a vector of triples that should be added or removed. The graph IRI can be either IRI ID or a string. \n\nThe return values of these functions are not defined and should not be used by applications.\n\n\ncreate function DB.DBA.RDF_INSERT_TRIPLES (in graph_iri any, in triples any);\ncreate function DB.DBA.RDF_DELETE_TRIPLES (in graph_iri any, in triples any);\n\n\nSimple operations may be faster if written as low-level SQL code instead of using SPARUL.\nFor instance, the use of SPARQL DELETE is redundant when the application can delete from RDF_QUAD by using simple filters like:\n\n\ndelete from DB.DBA.RDF_QUAD\nwhere G = DB.DBA.RDF_MAKE_IID_OF_QNAME (\n 'http://local.virt/DAV/sparql_demo/data/data-xml/source-simple2/source-data-01.rdf' );\n\n\nOn the other hand, simple filters do not work when search criteria refer to triples that are affected by the modification.\n\nConsider a function that deletes all triples whose subjects are nodes of type 'http://xmlns.com/foaf/0.1/Person'. Type information is stored in triples that will be deleted, so the simplest function is something like this:\n\n\ncreate procedure DELETE_PERSONAL_DATA (in foaf_graph varchar)\n{\n declare pdata_dict, pdata_array any;\n-- Step 1: select everything that should be deleted\n pdata_dict := ((\n sparql construct { ?s ?p ?o }\n where { graph ?:foaf_graph {\n ?s ?p ?o . ?s rdf:type \n } }\n ));\n-- Step 2: delete all found triples\n pdata_array := dict_list_keys (pdata_dict, 1);\n RDF_DELETE_TRIPLES (foaf_graph, pdata_array);\n};\n\nDELETE_PERSONAL_DATA (\n 'http://local.virt/DAV/sparql_demo/data/data-xml/source-simple2/source-data-01.rdf' );\n\n\nSince Virtuoso 5.0, applications may use SPARUL to do the same in a more convenient way:\n\n\ncreate procedure DELETE_PERSONAL_DATA (in foaf_graph varchar)\n{\n sparql delete { ?s ?p ?o }\n where { graph ?:foaf_graph {\n ?s ?p ?o . ?s rdf:type \n } }\n};\n\n\n\n---++Virtuoso's SPARUL Implementation\n\n---+++References\n#SparqlSpecs\n---++++Specs\n * [[http://jena.hpl.hp.com/~afs/SPARQL-Update.html][SPARQL/UPDATE]]\n * [[http://www.w3.org/TR/rdf-sparql-query/][SPARQL Query Language for RDF]]\n * [[http://www.w3.org/TR/2005/WD-rdf-sparql-XMLres-20050527/][SPARQL Query Results XML Format]]\n * [[http://www.w3.org/TR/rdf-sparql-protocol/][SPARQL Protocol for RDF]]\n#SparqlFaqs\n---++++FAQs\n#SparqlPresentations\n---++++Presentations\n#SparqlTutorials\n---++++Tutorials\n\nCategoryGlossary CategorySPARQL CategoryRDF CategoryVOS CategoryDocumentation" . . . "4c7b918507cd463c7d86da92f0a30b70" . . . . . . . "VirtSPARUL" . . . "2017-06-13T05:42:16.997509"^^ . .