Not logged in : Login
(Sponging disallowed)

About: VirtSPARQLXSLT     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : atom:Entry, within Data Space : www.openlinksw.com associated with source document(s)
QRcode icon
http://www.openlinksw.com/describe/?url=http%3A%2F%2Fwww.openlinksw.com%2Fdataspace%2Fdav%2Fwiki%2FMain%2FVirtSPARQLXSLT

AttributesValues
has container
Date Created
maker
topic
described by
seeAlso
Date Modified
link
id
  • b3ea7a62460318ccc5f906662239cb9f
content
  • %META:TOPICPARENT{name="VOSIndex"}% ---+ Guide to using SPARQL inside XSLT This guide demonstrates how Virtuoso allows SPARQL queries to be embedded into an XSLT style sheet, and executed against a remote SPARQL endpoint (here, we use the [[http://lod.openlinksw.com/sparql/][LOD Cloud Cache]]) to retrieve data for use in HTML output. ---++Implementation * The key component of this feature is the <xsl:for-each-row> control element. This element has one attribute, named either "sparql" or "sql"; the value of the attribute is an XPath expression that returns the text of the query to executed, e.g., * The XPath expression can be a plain string constant, but because the query can be quite long, it is usually more convenient to store the text in a variable and refer to that variable. * The SPARQL query may contain parameters (written in the form ?:name). A parameter of this sort will get its value from the XSLT variable $name. (If there is any nesting or recursion, the value(s) will come from the innermost variables.) * The query execution in turn creates new XSLT variables that exist inside the body of <xsl:for-each-row>. Each result column of a query becomes one XSLT variable. * The body of <xsl:for-each-row> is instantiated once for each row of the query result set, with new values for the variables in each instantiation. ---++Example 1 Execute from iSQL: SQL> xslt_sheet ('local://friends.xsl', xtree_doc (' SELECT DISTINCT ?maxlinkg ?fnick ?ffullname ?ffname ?flname ?fimg WHERE { SERVICE (DEFINE lang:dialect 65535) { { SELECT DISTINCT ?maxlinkg ?fg ?fnick ?ffullname ?ffname (bif:__max_notnull (?flname1, ?flname2)) AS ?flname ?fimg WHERE { { SELECT (MAX(?linkg)) AS ?maxlinkg ?f WHERE { { SELECT DISTINCT ?k WHERE { GRAPH ?kg { { ?k foaf:firstName ?:fname ; foaf:familyName ?:lname } UNION { ?k foaf:firstName ?:fname ; foaf:family_name ?:lname } UNION { ?k foaf:name ?:fullname } } } } GRAPH ?linkg { ?k foaf:knows ?f } } } GRAPH ?fg { ?f a . OPTIONAL { ?f foaf:firstName ?ffname } OPTIONAL { ?f foaf:nickname ?fnick } OPTIONAL { ?f foaf:name ?ffullname } OPTIONAL { ?f foaf:familyName ?flname1 } OPTIONAL { ?f foaf:family_name ?flname2 } OPTIONAL { ?f foaf:img ?fimg } } FILTER ( bound ( ?ffullname ) || ( bound ( ?ffname ) && ( bound ( ?flname1 ) || bound ( ?flname2 ) ) ) ) } ORDER BY ?fullname ?ffname } } } ]]> Simple demo for SPARQL inside XSLT

    Known friends of  

     
    Nick:
    (data from )
    ')); DB.DBA.VHOST_DEFINE ( lpath=>'/friends/', ppath => '/!friends/', is_dav => 1, vsp_user => 'dba', opts => vector('noinherit', 1) ); CREATE PROCEDURE WS.WS."/!friends/" ( INOUT path VARCHAR, INOUT params ANY, INOUT lines ANY ) { http_value (xslt ('local://friends.xsl', xtree_doc (''), params)); } ; registry_set ('/!friends/', 'no_vsp_recompile') ;
    1 Go to [[http://cname/friends/][http://cname/friends/]], where results should look something like this: %BR%%BR%%BR%%BR% %BR%%BR%%BR%%BR%
Title
  • VirtSPARQLXSLT
attachment
  • http://www.usnet.private:8889/wiki/main/Main/VirtSPARQLXSLT/xslt1.png
  • http://www.usnet.private:8889/wiki/main/Main/VirtSPARQLXSLT/xslt2.png
has creator
is described using
atom:source
atom:updated
  • 2014-04-10T15:14:15Z
atom:title
  • VirtSPARQLXSLT
links to
atom:author
label
  • VirtSPARQLXSLT
topic
atom:published
  • 2010-10-26T11:59:14Z
type
is topic of
is interest of
Faceted Search & Find service v1.17_git122 as of Jan 03 2023


Alternative Linked Data Documents: iSPARQL | ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.03.3330 as of Apr 5 2024, on Linux (x86_64-generic-linux-glibc25), Single-Server Edition (30 GB total memory, 26 GB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2024 OpenLink Software