Example with pragma sql:gs-app-callback
The following example demonstrates usage of the sql:gs-app-callback
pragma.
- Make sure the steps from the Blogs and Resource Sharing Examples are performed.
- Let user for ex.
"Anna" of application to get full access to graphs whose IRIs contain user's name in path.
In addition, let all of them permission to use all graph groups and let the "moderator" user read everything:
reconnect "dba"; create function DB.DBA.SPARQL_GS_APP_CALLBACK_TEST (in g_iid IRI_ID, in app_uid varchar) returns integer { declare g_uri varchar; -- A fake IRI ID #i0 is used to mention account's default permissions for all graphs. if (#i0 = g_iid) { if ('moderator' = app_uid) return 9; -- Moderator can read and list everything. return 8; -- Other users can list everything. } g_uri := id_to_iri (g_iid); if (strstr (g_uri, '/' || app_uid || '/')) return 15; -- User has full access to "his" graph. return 8; -- User can list any given graph group. } ; SPARQL define sql:gs-app-callback "TEST" define sql:gs-app-uid "Anna" SELECT ?g ?s WHERE { ?s <p> ?o } ;
Sponger Usage Examples
- SPARQL Processor Usage Example
- RDF Proxy Service Example
- Browsing & Exploring RDF View Example Using ODE
- Browsing & Exploring RDF View Example Using iSPARQL
- Basic Sponger Cartridge Example
- HTTP Example for Extracting Metadata using CURL
- RESTFul Interaction Examples
- Flickr Cartridge Example
- MusicBrainz Metadatabase Example
- SPARQL Tutorial -- Magic of SPARUL and Sponger
Related
- Sponger's Linked Data Middleware Hooks into SPARQL
- Virtuoso Sponger
- Technical White Paper
- Supported Virtuoso Sponger Cartridges
- SPARQL Sponger
- Interacting with Sponger Middleware via RESTful Patterns
- Interacting with Sponger Meta Cartridge via RESTful Patterns
- Sponger Cartridge RDF Extractor
- Extending SPARQL IRI Dereferencing with RDF Mappers
- Programmer Guide for Virtuoso Linked Data Middleware ("Sponger")
- Create RDF Custom Cartridge Tutorial
- OpenLink-supplied Virtuoso Sponger Cartridges
- Virtuoso Authentication Server
- Virtuoso SPARQL OAuth Tutorial
- Virtuoso Sponger Access Control List (ACL) Setup
- WebID Protocol & SPARQL Endpoint ACLs Tutorial
- Virtuoso Documentation