rdf-trig-002

Tests that application/trig works in p:inline, p:document, and p:load.

Test rdf-trig-002.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:identity>
      <p:with-input>
         <p:inline content-type="application/trig">
_:b0    &lt;http://xmlns.com/foaf/0.1/homepage&gt;
                &lt;https://nwalsh.com/&gt;;
        &lt;http://xmlns.com/foaf/0.1/name&gt;
                "Norman Walsh";
        &lt;http://xmlns.com/foaf/0.1/weblog&gt;
                &lt;https://so.nwalsh.com/&gt; .

_:b1    &lt;http://xmlns.com/foaf/0.1/name&gt;
                "Achim Berndzen" .

_:b2    &lt;http://xmlns.com/foaf/0.1/name&gt;
                "Gerrit Imsieke" .

_:b3    &lt;http://xmlns.com/foaf/0.1/name&gt;
                "Erik Siegel" .

&lt;https://xproc.org/&gt;  &lt;http://purl.org/dc/terms/title&gt;
                "XProc";
        &lt;http://purl.org/dc/terms/type&gt;
                &lt;http://purl.org/dc/dcmitype/Collection&gt; .

&lt;https://spec.xproc.org/3.0/xproc/&gt;
        &lt;http://purl.org/dc/terms/contributor&gt;
                _:b0 , _:b1 , _:b2 , _:b3;
        &lt;http://purl.org/dc/terms/date&gt;
                "2022-09-12"^^&lt;http://www.w3.org/2001/XMLSchema#date&gt;;
        &lt;http://purl.org/dc/terms/hasVersion&gt;
                "3.0";
        &lt;http://purl.org/dc/terms/isPartOf&gt;
                &lt;https://xproc.org/&gt;;
        &lt;http://purl.org/dc/terms/title&gt;
                "XProc 3.0: An XML Pipeline Language";
        &lt;http://purl.org/dc/terms/type&gt;
                &lt;http://purl.org/dc/dcmitype/Text&gt; .

&lt;https://spec.xproc.org/3.0/steps/&gt;
        &lt;http://purl.org/dc/terms/contributor&gt;
                _:b0 , _:b1 , _:b2 , _:b3;
        &lt;http://purl.org/dc/terms/date&gt;
                "2022-09-12"^^&lt;http://www.w3.org/2001/XMLSchema#date&gt;;
        &lt;http://purl.org/dc/terms/hasVersion&gt;
                "3.0";
        &lt;http://purl.org/dc/terms/isPartOf&gt;
                &lt;https://xproc.org/&gt;;
        &lt;http://purl.org/dc/terms/title&gt;
                "XProc 3.0: Standard Step Library";
        &lt;http://purl.org/dc/terms/type&gt;
                &lt;http://purl.org/dc/dcmitype/Text&gt; .
      </p:inline>
      </p:with-input>
   </p:identity>
   <p:cast-content-type name="first" content-type="application/rdf+xml"/>
   <p:identity>
      <p:with-input>
         <p:document content-type="application/trig" href="../documents/sample1.trig"/>
      </p:with-input>
   </p:identity>
   <p:cast-content-type name="second" content-type="application/rdf+xml"/>
   <p:load content-type="application/trig" href="../documents/sample1.trig"/>
   <p:cast-content-type name="third" content-type="application/rdf+xml"/>
   <p:wrap-sequence wrapper="wrapper">
      <p:with-input pipe="@first @second @third"/>
   </p:wrap-sequence>
</p:declare-step>

Schematron validation

<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <s:ns prefix="rdf" uri="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="wrapper">The root is wrong.</s:assert>
         <s:assert test="count(wrapper/rdf:RDF) = 3">RDF output is incorrect.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

15 Feb 2025, Norm Tovey-Walsh

Created test.