rdf-trig-003

Tests application/trig can be queried.

Test rdf-trig-003.xml is expected to pass.

The pipeline

<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:p="http://www.w3.org/ns/xproc" name="main" version="3.0" expand-text="false">
   <p:import href="https://xmlcalabash.com/ext/library/rdf.xpl"/>
   <p:output port="result"/>
   <p:load content-type="application/trig" href="../documents/sample1.trig"/>
   <cx:sparql>
      <p:with-input port="query">
         <p:document content-type="application/sparql-query" href="../documents/query1.rq"/>
      </p:with-input>
   </cx:sparql>
</p:declare-step>

Schematron validation

<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <s:ns prefix="sr" uri="http://www.w3.org/2005/sparql-results#"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="sr:sparql">The root is wrong.</s:assert>
      </s:rule>
      <s:rule context="/sr:sparql">
         <s:assert test="sr:head">There’s no head</s:assert>
         <s:assert test="sr:results">There are no results</s:assert>
      </s:rule>
      <s:rule context="/sr:sparql/sr:head">
         <s:assert test="count(sr:variable) = 2">Wrong number of headers</s:assert>
      </s:rule>
      <s:rule context="/sr:sparql/sr:results">
         <s:assert test="count(sr:result) = 3">Wrong number of results</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

15 Feb 2025, Norm Tovey-Walsh

Created test.