. . "2017-06-13T05:38:28.417822"^^ . . "2017-06-13T05:38:28.417822"^^ . . . . . . . . "2017-06-13T05:38:28Z" . "VirtSpongerLinkedDataHooksIntoSPARQLEx46" . . "%META:TOPICPARENT{name=\"VirtSpongerLinkedDataHooksIntoSPARQL\"}%\n\n\n%META:TOPICPARENT{name=\"VirtSpongerLinkedDataHooksIntoSPARQL\"}%\n\n\n---+Example Performing Sponging with Private Graphs Using get:private pragma\n\n\nThe following example demonstrates how private sponging using get:private pragma works for database with private graphs.\n\n\n 1 Create few users in alphabetical order:\n\nDB.DBA.USER_CREATE ('Anna', 'Anna');\nDB.DBA.USER_CREATE ('Brad', 'Brad');\nDB.DBA.USER_CREATE ('Carl', 'Carl');\n\n 1 Set to Anna, Brad and Carl SPARQL SELECT, UPDATE and SPONGE permissions:\n\ngrant SPARQL_SELECT to \"Anna\";\ngrant SPARQL_SELECT to \"Brad\";\ngrant SPARQL_SELECT to \"Carl\";\n\ngrant SPARQL_UPDATE to \"Anna\";\ngrant SPARQL_UPDATE to \"Brad\";\ngrant SPARQL_UPDATE to \"Carl\";\n\ngrant SPARQL_SPONGE to \"Anna\";\ngrant SPARQL_SPONGE to \"Brad\";\ngrant SPARQL_SPONGE to \"Carl\";\n\n\n 1 Set specific privileges: Setup assuming 3 users: Anna, Brad and Carl where each of these individual users has read access to graphs:\n\n\n-- Close any public access to \"private\" graphs\nDB.DBA.RDF_DEFAULT_USER_PERMS_SET ('nobody', 0, 1);\n\n-- Set Read Only for public on graphs not listed as \"private\".\nDB.DBA.RDF_DEFAULT_USER_PERMS_SET ('nobody', 1);\n\nDB.DBA.RDF_DEFAULT_USER_PERMS_SET ('Anna', 0, 1);\nDB.DBA.RDF_DEFAULT_USER_PERMS_SET ('Brad', 0, 1);\nDB.DBA.RDF_DEFAULT_USER_PERMS_SET ('Carl', 0, 1);\n\nDB.DBA.RDF_DEFAULT_USER_PERMS_SET ('Anna', 1);\nDB.DBA.RDF_DEFAULT_USER_PERMS_SET ('Brad', 1);\nDB.DBA.RDF_DEFAULT_USER_PERMS_SET ('Carl', 1);\n\n 1 Assuming the following four sorts of access that are specified by four bits of an integer \"permission bit-mask\", following plain old UNIX style:\n * Bit 1 permits read access.\n * Bit 2 permits write access via SPARUL and is basically useless without bit 1 set.\n * Bit 4 permits write access via \"RDF Network Resource Fetch\" methods and is basically useless without bits 1 and 2 set.\n * Bit 8 allows retrieval of the list of members of a graph group. An IRI can be used as a graph IRI and as a graph group IRI at the same time, so bit 8 can be freely combined with any of bits 1, 2 or 4.\n * In the statements from below should be considered:\n * \"15 = 8+4+2+1 \" -- i.e. combining all the four sorts of access FROM above\n * \"9 = 8 + 1\" -- i.e. read access + access to retrieve the list of members for a given graph group\n\n\n-- Create Graph Group for Anna and set privileges:\nDB.DBA.RDF_GRAPH_GROUP_CREATE ('urn:Anna:Sponged:Data', 1);\nDB.DBA.RDF_GRAPH_USER_PERMS_SET ('urn:Anna:Sponged:Data', 'Anna', 15);\nDB.DBA.RDF_GRAPH_USER_PERMS_SET ('urn:Anna:Sponged:Data', 'Brad', 9);\nDB.DBA.RDF_GRAPH_USER_PERMS_SET ('urn:Anna:Sponged:Data', 'Carl', 9);\n\n-- Create Graph Group for Brad and set privileges:\nDB.DBA.RDF_GRAPH_GROUP_CREATE ('urn:Brad:Sponged:Data', 1);\nDB.DBA.RDF_GRAPH_USER_PERMS_SET ('urn:Brad:Sponged:Data', 'Anna', 9);\nDB.DBA.RDF_GRAPH_USER_PERMS_SET ('urn:Brad:Sponged:Data', 'Brad', 15);\nDB.DBA.RDF_GRAPH_USER_PERMS_SET ('urn:Brad:Sponged:Data', 'Carl', 9);\n\n-- Create Graph Group for Carl and set privileges:\nDB.DBA.RDF_GRAPH_GROUP_CREATE ('urn:Carl:Sponged:Data', 1);\nDB.DBA.RDF_GRAPH_USER_PERMS_SET ('urn:Carl:Sponged:Data', 'Anna', 9);\nDB.DBA.RDF_GRAPH_USER_PERMS_SET ('urn:Carl:Sponged:Data', 'Brad', 9);\nDB.DBA.RDF_GRAPH_USER_PERMS_SET ('urn:Carl:Sponged:Data', 'Carl', 15);\n\n\n-- Set Anna's, Brad's and Carl's graphs by inserting them into the virtrdf:PrivateGraphs graph group:\nDB.DBA.RDF_GRAPH_GROUP_INS ('http://www.openlinksw.com/schemas/virtrdf#PrivateGraphs', 'http://anna-example.com/');\nDB.DBA.RDF_GRAPH_GROUP_INS ('http://www.openlinksw.com/schemas/virtrdf#PrivateGraphs', 'http://brad-example.com/');\nDB.DBA.RDF_GRAPH_GROUP_INS ('http://www.openlinksw.com/schemas/virtrdf#PrivateGraphs', 'http://carl-example.com/');\n\n 1 Examples with invalid graph group names:\n 1 Example with Non-existing Graph Group:\n\n-- An error for non-existing Graph group will be raised.\n\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private \n SELECT *\n FROM \n WHERE\n { ?s ?p ?o };\n\n 1 Example with \"virtrdf:PrivateGraphs\" graph group which is reserved for system usage:\n\n-- An error for attempt to add a graph to special graph group will be raised.\n\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private virtrdf:PrivateGraphs\n SELECT * FROM \n WHERE\n { ?s ?p ?o };\n\n 1 Example with \"virtrdf:rdf_repl_graph_group\" graph group which is reserved for system usage:\n\n-- An error for attempt to add a graph to special graph group will be raised.\n\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private virtrdf:rdf_repl_graph_group\n SELECT * FROM \n WHERE\n { ?s ?p ?o };\n\n 1 Examples to check Anna's sponging permissions on different graph groups:\n 1 Example for adding graph to Anna's graph group <urn:Anna:Sponged:Data>:\n \n-- No error will be raised as Anna has the efficient rights for graph group \n\nreconnect \"Anna\";\n\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private \n SELECT *\n FROM \n WHERE\n { ?s ?p ?o };\n\n 1 Example for adding graph to Brad's graph group <urn:Brad:Sponged:Data>:\n \n-- An error will be rased because \"Anna\" has not enough rights on that group\n\nreconnect \"Anna\";\n\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private \n SELECT * FROM \n WHERE\n { ?s ?p ?o };\n\n 1 Example for adding graph to Carl's graph group <urn:Carl:Sponged:Data>:\n \n-- An error will be rased because \"Anna\" has not enough rights on that group\n\nreconnect \"Anna\";\n\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private \n SELECT *\n FROM \n WHERE\n { ?s ?p ?o };\n\n 1 Examples check Brad's sponging permissions on different graph groups:\n 1 Example for adding graph to Anna's graph group <urn:Anna:Sponged:Data>:\n \n-- An error will be rased because \"Brad\" has not enough rights on that group\n\nreconnect \"Brad\";\n\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private \n SELECT *\n FROM \n WHERE\n { ?s ?p ?o };\n\n 1 Example for adding graph to Brad's graph group <urn:Brad:Sponged:Data>:\n \n-- No error will be raised as Brad has the efficient rights for graph group \n\nreconnect \"Brad\";\n\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private \n SELECT *\n FROM \n WHERE\n { ?s ?p ?o };\n\n 1 Example for adding graph to Carl's graph group <urn:Carl:Sponged:Data>:\n \n-- An error will be rased because \"Brad\" has not enough rights on that group\n\nreconnect \"Brad\";\n\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private \n SELECT *\n FROM \n WHERE\n { ?s ?p ?o };\n\n 1 Examples check Carl's sponging permissions on different graph groups:\n 1 Example for adding graph to Anna's graph group <urn:Anna:Sponged:Data>:\n \n-- An error will be rased because \"Carl\" has not enough rights on that group\n\nreconnect \"Carl\";\n\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private \n SELECT *\n FROM \n WHERE\n { ?s ?p ?o };\n\n 1 Example for adding graph to Brad's graph group <urn:Brad:Sponged:Data>:\n \n-- An error will be rased because \"Carl\" has not enough rights on that group\n\nreconnect \"Carl\";\n\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private \n SELECT *\n FROM \n WHERE\n { ?s ?p ?o };\n\n 1 Example for adding graph to Carl's graph group <urn:Carl:Sponged:Data>:\n \n-- No error will be raised as Carl has the efficient rights for graph group \n\nreconnect \"Carl\";\n\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private \n SELECT *\n FROM \n WHERE\n { ?s ?p ?o };\n\n 1 User Carl performs private sponging:\n\n\nreconnect \"Carl\";\n\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private \n SELECT *\n FROM \n WHERE\n { ?s ?p ?o };\n\n-- Should return for ex. 365 rows.\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private \n SELECT COUNT(*)\n FROM \n WHERE\n { ?s ?p ?o };\n\n\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private \n SELECT *\n FROM NAMED \n FROM NAMED \n WHERE\n {\n graph ?g\n { ?s ?p ?o\n }\n };\n\n\n-- Should return for ex. 1317 rows.\nSPARQL\n DEFINE get:soft \"replacing\"\n DEFINE get:private \n SELECT COUNT(*)\n FROM NAMED \n FROM NAMED \n WHERE\n {\n graph ?g\n { ?s ?p ?o\n }\n };\n\n 1 User Anna reads Carl's data:\n\n\nreconnect \"Anna\"; \n\nSPARQL\n SELECT COUNT(*)\n FROM \n WHERE\n { ?s ?p ?o };\n\ncallret-0\nINTEGER\n_______________________________________________________________________________\n\n365\n\n1 Rows. -- 15 msec.\n\n\n\n---++Sponger Usage Examples\n\n * [[http://docs.openlinksw.com/virtuoso/virtuososponger.html#virtuosospongerusageprocessorex][SPARQL Processor Usage Example]]\n * [[http://docs.openlinksw.com/virtuoso/virtuososponger.html#virtuosospongerusageproxyex2][RDF Proxy Service Example]]\n * [[http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtDeployingLinkedDataGuide_BrowsingNorthwindRdfView#AncMozToc2][Browsing & Exploring RDF View Example Using ODE]]\n * [[http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtDeployingLinkedDataGuide_BrowsingNorthwindRdfView#AncMozToc3][Browsing & Exploring RDF View Example Using iSPARQL]]\n * [[http://docs.openlinksw.com/virtuoso/rdfinsertmethods.html#rdfinsertmethodplapissimpleexample][Basic Sponger Cartridge Example]]\n * [[http://docs.openlinksw.com/virtuoso/virtuososponger.html#virtuosospongerusagebriefex][HTTP Example for Extracting Metadata using CURL]]\n * [[http://docs.openlinksw.com/virtuoso/virtuososponger.html#virtuosospongercartridgetypesmetarestexamples][RESTFul Interaction Examples]]\n * [[http://docs.openlinksw.com/virtuoso/sect5_virtuosospongercreatecustcartrrgstflickr.html][Flickr Cartridge Example]]\n * [[http://docs.openlinksw.com/virtuoso/virtuososponger.html#virtuosospongercreatecustcartrexmp][MusicBrainz Metadatabase Example]]\n * [[VirtTipsAndTricksGuideAddTriplesNamedGraph][SPARQL Tutorial -- Magic of SPARUL and Sponger]]\n\n---++Related\n\n * [[VirtSpongerLinkedDataHooksIntoSPARQLEx45][Example Performing Sponging on a entirely confidential database using get:private pragma]]\n * [[VirtSpongerLinkedDataHooksIntoSPARQL][Sponger's Linked Data Middleware Hooks into SPARQL]]\n * [[VirtSponger][Virtuoso Sponger]]\n * [[http://virtuoso.openlinksw.com/Whitepapers/html/VirtSpongerWhitePaper.html][Technical White Paper]]\n * [[VirtSpongerCartridgeSupportedDataSources][Supported Virtuoso Sponger Cartridges]]\n * [[SPARQLSponger][SPARQL Sponger]]\n * [[VirtInteractSpongerMiddlewareRESTPatterns][Interacting with Sponger Middleware via RESTful Patterns]]\n * [[VirtSpongerCartridgeSupportedDataSourcesMetaRESTExamples][Interacting with Sponger Meta Cartridge via RESTful Patterns]]\n * [[VirtSpongerCartridgeRDFExtractor][Sponger Cartridge RDF Extractor]]\n * [[RDFMappers][ Extending SPARQL IRI Dereferencing with RDF Mappers]]\n * [[VirtSpongerCartridgeProgrammersGuide][Programmer Guide for Virtuoso Linked Data Middleware (\"Sponger\")]]\n * [[VirtProgrammerGuideRDFCartridge][Create RDF Custom Cartridge Tutorial]]\n * [[VirtSpongerCartridgeSupportedDataSources][OpenLink-supplied Virtuoso Sponger Cartridges]]\n * [[VirtAuthServerUI][Virtuoso Authentication Server]]\n * [[VirtOAuthSPARQL][Virtuoso SPARQL OAuth Tutorial]]\n * [[VirtSpongerACL][Virtuoso Sponger Access Control List (ACL) Setup]]\n * [[VirtSPARQLSecurityWebID][WebID Protocol & SPARQL Endpoint ACLs Tutorial]]\n * [[http://docs.openlinksw.com/virtuoso/virtuososponger.html][Virtuoso Documentation]]\n" . . . . . . . . . . . . . . . . . . . . "VirtSpongerLinkedDataHooksIntoSPARQLEx46" . . "2017-06-13T05:38:28Z" . . . . . . . "f5e16aea7c734f19d383da204188666d" . . "VirtSpongerLinkedDataHooksIntoSPARQLEx46" . . . .