On 11 October 2017 at 19:30, Martynas Jusevičius <[email protected]>
wrote:

> TriX is not particularly well-suited for XSLT processing as it's a raw list
> of statements. A nested resource/property structure like in RDF/XML is a
> more natural fit for the parent/child traversal that XSLT does best.
>

In XSLT you're not restricted to traversing from parent to child elements.
The "child" axis is only one of several XPath axes. There's also a very
common programming pattern in XSLT for traversing cross-references (such as
IDREF and internal URI references), by using an xsl:key to generate an
index, and then looking up elements using the key() function. This allows
you to look up triples by subject, or subject-and-predicate, etc:

<xsl:apply-templates select="key('triples-by-subject-and-predicate',
concat($my-subject, ' ', $my-predicate))"/>

The value of TriX for graph processing in XSLT is precisely *because* it is
just a list of statements. That is what makes it easy to process RDF *as a
graph* in XSLT. Whereas if your dataset is encoded in RDF/XML, it's
enormously difficult to process *as a graph*.

-- 
Conal Tuohy
http://conaltuohy.com/
@conal_tuohy
+61-466-324297

Reply via email to