ferenda
ferenda copied to clipboard
SPARQL support for XPath
Closes https://github.com/staffanm/ferenda/issues/24
Current implementation
<xsl:for-each select="ferenda:sparql('
select ?subj
where {
?subj [http://lagen.nu/vocab/parliament#approve] [http://rinfo.lagrummet.se/publ/sfs/2021:743] .
}
')">
<li>
<xsl:value-of select="@subj"/>
</li>
</xsl:for-each>
Note the []
instead of <>
to be a valid xml attribute value - the more proper, but unreadable alternative would have been <>
...
The return value of ferenda:sparql
would be a sequence of <ferenda:SparqlResult bindname=value ... bindname=value>
elements.
Note that the type (uri or literal) for a value is not represented at all currently, as that would make the result nodes more complex and make the syntax more unwieldly...