VirtSpongerLinkedDataHooksIntoSPARQL Enhancements the Virtuoso Sponger brings to SPARQL Enhancements the Virtuoso Sponger brings to SPARQL Why? In the world of Linked Data, the Web is treated as a global data space where every data object has an identifier (URI) that serves as a key to its entity-attribute-value (3-tuple or triples)-based description. To make these "keys" work, data object URIs have to be dereferenceable — i.e., they must resolve to actual object content through functionality commonly delivered via data object locator and retriever URI specializations (or subtypes) such as URLs.What? Virtuoso's Sponger is a sophisticated piece of middleware that provides full Linked Data fidelity for pre-existing data objects or resources. This Linked Data is then accessible via HTTP-based Web Services, and SPARQL is enhanced with Sponger pragmas (or directives) and some optional additions to the FROM clause.How? Basics Sponger pragmas control various aspects of functionality — Identifier Dereference: handled by INPUT pragmas. Actual Data Retrieval: handled by GET pragmas. SQL Code Generation: handled by SQL pragmas. Output Format Adjustments: handled by OUTPUT pragmas. Pragmas are qualified at usage time using the following pattern: <pragma-type>:<actual-method> ["<method-modifier>"] Details INPUT Pragmas INPUT Pragmas enable you control dereference behavior applied to a SPARQL query. Net effect, fine-grained control over how variables and explicit data object identifiers are dereferenced en route to creating base data from which SPARQL query solutions are derived.Methods and method-modifiers associated with this pragma type include: <tgroup><thead /><tbody> <row /> <row><entry> <emphasis>input:default-graph-exclude</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> Works like "NOT FROM" clause </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx26">Example</ulink> </entry></row> <row><entry> <emphasis>input:default-graph-uri</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> Works like "FROM" clause </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx24">Example</ulink> </entry></row> <row><entry> <emphasis>input:freeze</emphasis> </entry><entry> </entry><entry> Blocks further changes in the list of source graphs. The web service endpoint (or similar non-web application) can edit an incoming query by placing a list of pragmas ending with input:freeze in front of the query text. If an intruder tries to place some graph names, they will get a compilation error, not access to the data. input:freeze disables all input:grab-... pragmas as well. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx28">Example</ulink> </entry></row> <row><entry> <emphasis>input:grab-all</emphasis> </entry><entry> <emphasis>"yes"</emphasis> </entry><entry> Instructs the SPARQL processor to dereference everything related to the query. All variables and literal IRIs in the query become values for input:grab-var and input:grab-iri. The resulting performance may be very bad. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx2">Example</ulink> </entry></row> <row><entry> <emphasis>input:grab-base</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> Specifies the base IRI to use when converting relative IRIs to absolute. (Default: empty string.) </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx3">Example</ulink> </entry></row> <row><entry> <emphasis>input:grab-depth</emphasis> </entry><entry> <emphasis>"0"</emphasis> </entry><entry> Sets the maximum 'degrees of separation' or links (predicates) between nodes in the target graph. Acceptable range is non-negative integers. 0 means unlimited. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx4">Example</ulink> </entry></row> <row><entry> <emphasis>input:grab-destination</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> Overrides the default IRI dereferencing and Local Graph IRI designation. Retrieved content (triples) is stored in a graph IRI designated by the modifier value. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx5">Example</ulink> </entry></row> <row><entry> <emphasis>input:grab-follow-predicate</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> Specifies a predicate IRI to be used when traversing a graph. (This pragma may be included multiple times). Synonym of input:grab-seealso. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx6">Example</ulink> </entry></row> <row><entry> <emphasis>input:grab-iri</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> Specifies an IRI that should be retrieved before executing the rest of the query, if it is not in the quad store already. (This pragma can be included multiple times). </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx7">Example</ulink> </entry></row> <row><entry> <emphasis>input:grab-limit</emphasis> </entry><entry> <emphasis>"<number>"</emphasis> </entry><entry> Sets the maximum number of resources (triple subject or object IRIs) to be de-referenced. Acceptable range is non-negative integers. 0 means unlimited. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx8">Example</ulink> </entry></row> <row><entry> <emphasis>input:grab-loader</emphasis> </entry><entry> <emphasis>"<procedure-name>"</emphasis> </entry><entry> Identifies the procedure used to retrieve, parse, and store content. (Default: DB.DBA.RDF_SPONGE_UP) </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx9">Example</ulink> </entry></row> <row><entry> <emphasis>input:grab-resolver</emphasis> </entry><entry> <emphasis>"<procedure-name>"</emphasis> </entry><entry> Identifies the procedure that handles IRI dereference and actual content retrieval via a specific data access protocol (e.g., HTTP). (Default: DB.DBA.RDF_GRAB_RESOLVER_DEFAULT.) </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx10">Example</ulink> </entry></row> <row><entry> <emphasis>input:grab-seealso</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> Synonym of input:grab-follow-predicate. </entry><entry><ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx11">Example</ulink> </entry></row> <row><entry> <emphasis>input:grab-var</emphasis> </entry><entry> <emphasis>"?<var-name>"</emphasis> </entry><entry> Specifies the name of the SPARQL variable whose values should be used as IRIs of resources that should be downloaded. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx1">Example</ulink> </entry></row> <row><entry> <emphasis>input:grab-group-destination</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> Resembles input:grab-destination but sponges will create individual graphs for Network Resource Fetch results, and in addition to this common routine, a copy of each Network Resource Fetch result will be added to the resource specified by the value of input:grab-group-destination. input:grab-destination redirects loadings; input:grab-group-destination duplicates them. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx17">Example</ulink> </entry></row> <row><entry> <emphasis>input:grab-intermediate</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> Extends the set of IRIs to sponge, useful in combination with input:grab-seealso. If present, then, for a given subject, Network Resource Fetch will retrieve not only values of see-also predicates for that subject, but also the subject itself. The define value is not used in current implementation. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx18">Example</ulink> </entry></row> <row><entry> <emphasis>input:ifp</emphasis> </entry><entry> <emphasis>"<keyword>"</emphasis> </entry><entry> Adds IFP keyword in OPTION (QUIETCAST, ...) clause in the generated SQL. The value of this define is not used yet; an empty string is safe for future extensions. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx21">Example</ulink> </entry></row> <row><entry> <emphasis>input:inference</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> Specifies the name of an inference rule to provide context for backward-chained reasoner. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx22">Example</ulink> </entry></row> <row><entry> <emphasis>input:named-graph-exclude</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> Works like "NOT FROM NAMED" clause </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx27">Example</ulink> </entry></row> <row><entry> <emphasis>input:named-graph-uri</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> Works like "FROM NAMED" clause </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx25">Example</ulink> </entry></row> <row><entry> <emphasis>input:param</emphasis> </entry><entry> <emphasis>"<variable-name>"</emphasis> </entry><entry> <para>Declares a variable name to be used as a custom SPARQL protocol parameter.</para> <para>SPARQL query leverages this custom parameter using the special "?::{variable}" sytnax (excluding quotation marks).</para> <para>If query text is generated by a query builder that does not understand Virtuoso's SPARQL-BI extensions, then the generated query text may contain a conventional query variable as long as it uses the define input:param "X" pragma in its preamble.</para> <para><emphasis><emphasis>Note:</emphasis> This will not work for positional parameters; i.e., you cannot replace a SPARQL-BI reference like ?::3 with ?3 combined with a define input:param "3" pragma.</emphasis></para> </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx23">Example</ulink> </entry></row> <row><entry> <emphasis>input:params</emphasis> </entry><entry> <emphasis>"<variable-name>"</emphasis> </entry><entry> Synonym of input:param </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx23">Example</ulink> </entry></row> <row><entry> <emphasis>input:same-as</emphasis> </entry><entry> <emphasis>"yes"</emphasis> </entry><entry> Sets inference context for owl:sameAs (entity equivalence by name) reasoning and union expansion. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx19">Example</ulink> </entry></row> <row><entry> <emphasis>input:storage</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> Sets dataset (quads) storage scope. The value is a storage identifier (IRI) where the default value is virtrdf:DefaultQuadStorage. If the value is an empty string, then only quads associated with Linked Data Views are used. This is a good choice for low-level admin procedures, for two reasons: they will not interfere with any changes in virtrdf:DefaultQuadStorage; and they will continue to work even if all compiler's metadata is corrupted, including the description of virtrdf:DefaultQuadStorage. (define input:storage "" switches the SPARQL compiler to a small set of metadata that is built in 'C' code and thus are very hard for end-users to corrupt.) </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx20">Example</ulink> </entry></row> <row><entry> <emphasis>input:target-fallback-graph-uri</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> This pragma tells the compiler to use <XXX> as target for SPARQL 1.1 INSERT and DELETE operations if no other graph is specified in the query. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx_29">Example</ulink> </entry></row> <row><entry> <emphasis>input:with-fallback-graph-uri</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> This pragma tells the compiler to use <XXX> as target both for SPARQL 1.1 operations if no other graph is specified and for default graph IRI if no other source graphs are named in the query. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx_30">Example</ulink> </entry></row> </tbody></tgroup></table> <para> </para> <bridgehead class="http://www.w3.org/1999/xhtml:h4"> GET Pragmas</bridgehead> GET Pragmas enables you to control actual data-object content-retrieval behavior applied to a SPARQL query. The net effect is fine-grained control over data-access-oriented matters such as —<itemizedlist mark="bullet" spacing="compact"><listitem>Data object content format, via content negotiation </listitem> <listitem>Cache invalidation </listitem> <listitem>Proxy handling</listitem> </itemizedlist><para>This pragma type is also usable as a comma-separated list of SPARQL ... FROM <options>. Its methods and method-modifiers include —</para> <table><title /><tgroup><thead /><tbody> <row /> <row><entry> <emphasis>get:accept</emphasis> </entry><entry> <emphasis>"application/xml"</emphasis> <emphasis>"application/rdf+xml"</emphasis> <emphasis>"application/rdf+turtle"</emphasis> <emphasis>"application/x-turtle"</emphasis> <emphasis>"application/turtle"</emphasis> <emphasis>"text/rdf+n3"</emphasis> <emphasis>"text/turtle"</emphasis> </entry><entry> get:accept is most commonly used to access a web service that returns HTML by default but can also return RDF if forced to do so. The default value is "application/rdf+xml; q=1.0, text/rdf+n3; q=0.9, application/rdf+turtle; q=0.5, application/x-turtle; q=0.6, application/turtle; q=0.5, text/turtle; q=1.0, application/xml; q=0.2, */*; q=0.1" </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx47">Example</ulink> </entry></row> <row><entry> <emphasis>get:cartridge</emphasis> </entry><entry> <emphasis>"extractor"</emphasis> <emphasis>"meta"</emphasis> </entry><entry> Designates the use of Sponger ?meta? or ?extractor? cartridges in the query being executed. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx29">Example</ulink> </entry></row> <row><entry> <emphasis>get:method</emphasis> </entry><entry> <emphasis>"GET"</emphasis> <emphasis>"MGET"</emphasis> </entry><entry> <itemizedlist mark="bullet" spacing="compact"><listitem>"GET" loads the resource itself.</listitem> <listitem>"MGET" loads metadata about the resource.</listitem></itemizedlist> </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx16">Example</ulink> </entry></row> <row><entry> <emphasis>get:private</emphasis> </entry><entry> <emphasis>""</emphasis> <emphasis><graph_group_IRI></emphasis> </entry><entry> When used for sponging graph X, it adjusts graph-level security of graph X (and of graph_group_IRI, if specified) so that X becomes a privately accessible graph of the user who sponges the X. If graph_group_IRI is specified, X becomes accessible to users that can access graph_group_IRI with the same permissions they have on graph_group_IRI. The exact rules are — <itemizedlist mark="bullet" spacing="compact"><listitem> If graph is virtrdf:, an error is signaled.</listitem> <listitem>If graph name is an IRI of handshaked web service endpoint or "public IRI" of a handshaked web service endpoint, an error is signaled.</listitem> <listitem>If access is public by default, even for private graphs, an error is signaled and sponging is not tried.</listitem> <listitem>If default is "no access" but someone (other than current user) has specifically granted read access to the graph in question AND current user is not dba AND current user has no bit 32 permission on this graph, an error is signaled.</listitem> <listitem>If read access is public by default for world and disabled for private graphs, then the graph to be sponged is added to the group of private graphs.</listitem> <listitem>If current user is not DBA, current user is granted read+write+sponge+admin access to the graph to be sponged. In addition, current user gets special permission bit 32, indicating that the graph is made by private sponge of this specific user.</listitem> <listitem>If the value of get:private is an IRI, then — <itemizedlist mark="bullet" spacing="compact"><listitem>the IRI is supposed to be an IRI of "plain" graph group. An error is signaled in case of non-existing graph group, group of private graphs, or group of graphs to be replicated.</listitem> <listitem>the graph is added to that group.</listitem><listitem>each non-dba user that can get list of files of the group will get permissions for the loaded graph equal to permissions they have on graph group minus "list" permission.</listitem></itemizedlist></listitem></itemizedlist> </entry><entry> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx45">Example for entirely confidential database</ulink> </listitem> <listitem><ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx46">Example using private graphs</ulink></listitem></itemizedlist> </entry></row> <row><entry> <emphasis>get:proxy</emphasis> </entry><entry> <emphasis>"<host[:port]>"</emphasis> </entry><entry> Similar to setting up a Web browser to work with a proxy-style HTTP server, this identifies the CNAME (URL host:port or authority component) to target if direct retrieval from the URL in the FROM clause or handling of a data object's dereferenceable identifier is not possible. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx12">Example</ulink> </entry></row> <row><entry> <emphasis>get:refresh</emphasis> </entry><entry> <emphasis>"<seconds>"</emphasis> </entry><entry> Limits the lifetime of a local cached copy of the source. The value is in seconds. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx15">Example</ulink> </entry></row> <row><entry> <emphasis>get:query</emphasis> </entry><entry> </entry><entry> </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx34">Example</ulink> </entry></row> <row><entry> <emphasis>get:soft</emphasis> </entry><entry> <emphasis>"soft"</emphasis> <emphasis>"replace"</emphasis> <emphasis>"add"</emphasis> </entry><entry> <itemizedlist mark="bullet" spacing="compact"><listitem>"soft" applies cache-invalidation to the sponged resource en route to replacing content or doing nothing.</listitem> <listitem>"replace" replaces triples stored in named graphs.</listitem> <listitem>"add" simply adds triples to existing named graphs.</listitem></itemizedlist> </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx13">Example</ulink> </entry></row> <row><entry> <emphasis>get:uri</emphasis> </entry><entry> <emphasis>"<IRI>"</emphasis> </entry><entry> Identifies a specific URI to be de-referenced, distinct from the document URL in the FROM clause of a SPARQL query. Typically, this would be used to deference a specific subject or object of a relation in the data retrieved in by the document URL in the FROM clause. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx14">Example</ulink> </entry></row> </tbody></tgroup></table> <para> </para> <bridgehead class="http://www.w3.org/1999/xhtml:h4"> SQL Pragmas</bridgehead> <para>Pragmas to control code generation:</para> <table><title /><tgroup><thead /><tbody> <row /> <row><entry> <emphasis>sql:assert-user</emphasis> </entry><entry> <emphasis>"<username>"</emphasis> </entry><entry> Defines the user who is supposed to be the single "proper" use for the query. If the compiler is launched by any other user, an error is signaled. The typical use is define sql:assist-user "dba". This is too weak to be a security measure, but may help in debugging of security issues. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx38">Example</ulink> </entry></row> <row><entry> <emphasis>sql:big-data-const</emphasis> </entry><entry> </entry><entry> </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx31">Example</ulink> </entry></row> <row><entry> <emphasis>sql:describe-mode</emphasis> </entry><entry> <emphasis>""</emphasis> <emphasis>"SPO"</emphasis> <emphasis>"CBD"</emphasis> <emphasis>"OBJCBD"</emphasis> <emphasis>"<custom>"</emphasis> </entry><entry> See detailed description <ulink url="http://docs.openlinksw.com/virtuoso/rdfsqlfromsparqldescribe/">here</ulink>. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx32">Example</ulink> </entry></row> <row><entry> <emphasis>sql:globals-mode</emphasis> </entry><entry> "XSLT" "SQL" </entry><entry> Tells how to print names of global variables. Supported values are <itemizedlist mark="bullet" spacing="compact"><listitem>"XSLT" — print colon before name of global variable</listitem> <listitem>"SQL" — print as usual</listitem></itemizedlist> </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx35">Example</ulink> </entry></row> <row><entry> <emphasis>sql:gs-app-callback</emphasis> </entry><entry> </entry><entry> Application-specific callback, returns permission bits of a given graph. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx39">Example</ulink> </entry></row> <row><entry> <emphasis>sql:gs-app-uid</emphasis> </entry><entry> </entry><entry> Application-specific user-id to use in callback. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx40">Example</ulink> </entry></row> <row><entry> <emphasis>sql:log-enable</emphasis> </entry><entry> </entry><entry> Value that will be passed to SPARUL procedures, where it will be passed to <ulink url="http://docs.openlinksw.com/virtuoso/fn_log_enable.html">log_enable()</ulink> BIF. define sql:log-enable N will result in log_enable(N, 1) at the beginning of the operation; another <ulink url="http://docs.openlinksw.com/virtuoso/fn_log_enable.html">log_enable()</ulink> call will restore previous mode of transaction log at exit from the procedure including any error signaled from it. For example, set to 2 to disable logging to avoid a huge transaction after-image when sponging is deep and wide. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx33">Example</ulink> </entry></row> <row><entry> <emphasis>sql:param</emphasis> </entry><entry> <emphasis>"<variable-name>"</emphasis> </entry><entry> Synonym of input:param </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx23">Example</ulink> </entry></row> <row><entry> <emphasis>sql:params</emphasis> </entry><entry> <emphasis>"<variable-name>"</emphasis> </entry><entry> Synonym of input:param </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx23">Example</ulink> </entry></row> <row><entry> <emphasis>sql:select-option</emphasis> </entry><entry> </entry><entry> Value will be added as a global OPTION() clause of the generated SQL SELECT. This clause is always printed; it is always at least OPTION (QUIETCAST, ...). The most popular use case is define sql:table-option "ORDER" to tell the SQL compiler to execute JOINs in the order of their use in the query; this can make query compilation much faster, but the compilation result can be terrible if you do not know precisely what you're doing and do not inspect the execution plan of the generated SQL query. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx37">Example</ulink> </entry></row> <row><entry> <emphasis>sql:signal-void-variables</emphasis> </entry><entry> </entry><entry> When set to 0, this forces the SPARQL compiler to signal errors if some variables cannot be bound due to, for instance, misspelled names or attempts to make joins across disjoint domains. These diagnostics are especially important when the query is long. It is the most useful debugging variable if Linked Data Views are in use. It tells the SPARQL compiler to signal an error if it can prove that some variable can never be bound. Usually it means an error in the query, like a typo in IRI or a totally wrong triple pattern. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx30">Example</ulink> </entry></row> <row><entry> <emphasis>sql:table-option</emphasis> </entry><entry> </entry><entry> Value will be added as an option to each triple in the query, and later it will be printed in TABLE OPTION (...) clause of source table clause. This works only for SQL code for plain triples from RDF_QUAD; fragments of queries related to RDF Views will remain unchanged. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx36">Example</ulink> </entry></row> </tbody></tgroup></table> <bridgehead class="http://www.w3.org/1999/xhtml:h4"> OUTPUT Pragmas</bridgehead> <para>Pragmas to control the type of the result.</para> <table><title /><tgroup><thead /><tbody> <row /> <row><entry> <emphasis>output:dict-format</emphasis> </entry><entry> "<format-specifier>" </entry><entry> Tells the compiler that the query should produce a string output with the serialization of the result, not a result set. Only CONSTRUCT and DESCRIBE queries are affected by the value of output:dict-format. Use output:scalar-format and/or output:format for ASK queries. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx44">Example</ulink> </entry></row> <row><entry> <emphasis>output:format</emphasis> </entry><entry> "<format-specifier>" </entry><entry> Tells the compiler that the query should produce a string output with the serialization of the result, not a result set. The value of output:format is primarily used for SELECT and data manipulation queries. It will also be used for CONSTRUCT, DESCRIBE, and ASK queries, if output:dict-format or output:scalar-format are not used. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx42">Example</ulink> </entry></row> <row><entry> <emphasis>output:scalar-format</emphasis> </entry><entry> "<format-specifier>" </entry><entry> Tells the compiler that the query should produce a string output with the serialization of the result, not a result set. Only ASK queries are affected by the value of output:scalar-format. Use output:dict-format and/or output:format for CONSTRUCT or DESCRIBE queries. </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx43">Example</ulink> </entry></row> <row><entry> <emphasis>output:valmode</emphasis> </entry><entry> "SQLVAL" "LONG" "AUTO" </entry><entry> Tells the compiler which SQL datatypes should be used for output values. <itemizedlist mark="bullet" spacing="compact"><listitem>"SQLVAL", the default, is appropriate for ODBC clients and the like which know nothing about RDF and expect plain SQL values.</listitem> <listitem>"LONG" tells the compiler to preserve RDF boxes as is and to return IRI IDs instead of IRI string value. This is good for when a Virtuoso/PL procedure is RDF-aware and keeps results to be passed on to other SPARQL queries or some low-level RDF routines.</listitem> <listitem>"AUTO", is for dirty hackers that do not want any conversion of any sort at the output to read the SQL output of SPARQL front-end, who will find the format of each column and add the needed conversions later.</listitem></itemizedlist> </entry><entry> <ulink url="VirtSpongerLinkedDataHooksIntoSPARQLEx41">Example</ulink> </entry></row> </tbody></tgroup></table> <bridgehead class="http://www.w3.org/1999/xhtml:h3"> Sponger Usage Examples</bridgehead> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://docs.openlinksw.com/virtuoso/virtuososponger.html#virtuosospongerusageprocessorex">SPARQL Processor Usage Example</ulink> </listitem> <listitem><ulink url="http://docs.openlinksw.com/virtuoso/virtuososponger.html#virtuosospongerusageproxyex2">RDF Proxy Service Example</ulink> </listitem> <listitem><ulink url="http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtDeployingLinkedDataGuide_BrowsingNorthwindRdfView#AncMozToc2">Browsing & Exploring RDF View Example Using ODE</ulink> </listitem> <listitem><ulink url="http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtDeployingLinkedDataGuide_BrowsingNorthwindRdfView#AncMozToc3">Browsing & Exploring RDF View Example Using iSPARQL</ulink> </listitem> <listitem><ulink url="http://docs.openlinksw.com/virtuoso/rdfinsertmethods.html#rdfinsertmethodplapissimpleexample">Basic Sponger Cartridge Example</ulink> </listitem> <listitem><ulink url="http://docs.openlinksw.com/virtuoso/virtuososponger.html#virtuosospongerusagebriefex">HTTP Example for Extracting Metadata using CURL</ulink> </listitem> <listitem><ulink url="http://docs.openlinksw.com/virtuoso/virtuososponger.html#virtuosospongercartridgetypesmetarestexamples">RESTFul Interaction Examples</ulink> </listitem> <listitem><ulink url="http://docs.openlinksw.com/virtuoso/sect5_virtuosospongercreatecustcartrrgstflickr.html">Flickr Cartridge Example</ulink> </listitem> <listitem><ulink url="http://docs.openlinksw.com/virtuoso/virtuososponger.html#virtuosospongercreatecustcartrexmp">MusicBrainz Metadatabase Example</ulink> </listitem> <listitem><ulink url="VirtTipsAndTricksGuideAddTriplesNamedGraph">SPARQL Tutorial — Magic of SPARUL and Sponger</ulink></listitem> </itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Related</bridgehead> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtSponger">Virtuoso Sponger</ulink> </listitem> <listitem><ulink url="http://virtuoso.openlinksw.com/Whitepapers/html/VirtSpongerWhitePaper.html">Technical White Paper</ulink> </listitem> <listitem><ulink url="VirtSpongerCartridgeSupportedDataSources">Supported Virtuoso Sponger Cartridges</ulink> </listitem> <listitem><ulink url="SPARQLSponger">SPARQL Sponger</ulink> </listitem> <listitem><ulink url="VirtInteractSpongerMiddlewareRESTPatterns">Interacting with Sponger Middleware via RESTful Patterns</ulink> </listitem> <listitem><ulink url="VirtSpongerCartridgeSupportedDataSourcesMetaRESTExamples">Interacting with Sponger Meta Cartridge via RESTful Patterns</ulink> </listitem> <listitem><ulink url="VirtSpongerCartridgeRDFExtractor">Sponger Cartridge RDF Extractor</ulink> </listitem> <listitem><ulink url="RDFMappers">Extending SPARQL IRI Dereferencing with RDF Mappers</ulink> </listitem> <listitem><ulink url="VirtSpongerCartridgeProgrammersGuide">Programmer Guide for Virtuoso Linked Data Middleware ("Sponger")</ulink> </listitem> <listitem><ulink url="VirtProgrammerGuideRDFCartridge">Create RDF Custom Cartridge Tutorial</ulink> </listitem> <listitem><ulink url="VirtSpongerCartridgeSupportedDataSources">OpenLink-supplied Virtuoso Sponger Cartridges</ulink> </listitem> <listitem><ulink url="VirtAuthServerUI">Virtuoso Authentication Server</ulink> </listitem> <listitem><ulink url="VirtOAuthSPARQL">Virtuoso SPARQL OAuth Tutorial</ulink> </listitem> <listitem><ulink url="VirtSpongerACL">Virtuoso Sponger Access Control List (ACL) Setup</ulink> </listitem> <listitem><ulink url="VirtSPARQLSecurityWebID">WebID Protocol & SPARQL Endpoint ACLs Tutorial</ulink> </listitem> <listitem><ulink url="http://docs.openlinksw.com/virtuoso/virtuososponger.html">Virtuoso Documentation</ulink> </listitem> <listitem><ulink url="VirtTipsAndTricksGuide">Virtuoso Tips and Tricks Collection</ulink> </listitem> </itemizedlist></section></docbook>