ferenda icon indicating copy to clipboard operation
ferenda copied to clipboard

SPARQL support for XPath

Open redhog opened this issue 3 years ago • 0 comments

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 &lt;&gt;...

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...

redhog avatar Aug 23 '21 21:08 redhog