rdf-rdf-002

Tests that application/rdf+xml works in p:inline, p:document, and p:load.

Test is expected to pass.

The pipeline

<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
                xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:t="http://xproc.org/ns/testsuite/3.0" 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/rdf+xml">
            <rdf:RDF xmlns:j.0="http://purl.org/dc/terms/"
                     xmlns:j.1="http://xmlns.com/foaf/0.1/"
                     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
               <rdf:Description rdf:about="https://spec.xproc.org/3.0/xproc/">
                  <j.0:title>XProc 3.0: An XML Pipeline Language</j.0:title>
                  <j.0:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2022-09-12</j.0:date>
                  <j.0:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
                  <j.0:hasVersion>3.0</j.0:hasVersion>
                  <j.0:isPartOf>
                     <rdf:Description rdf:about="https://xproc.org/">
                        <j.0:title>XProc</j.0:title>
                        <j.0:type rdf:resource="http://purl.org/dc/dcmitype/Collection"/>
                     </rdf:Description>
                  </j.0:isPartOf>
                  <j.0:contributor>
                     <rdf:Description rdf:nodeID="A0">
                        <j.1:name>Norman Walsh</j.1:name>
                        <j.1:homepage rdf:resource="https://nwalsh.com/"/>
                        <j.1:weblog rdf:resource="https://so.nwalsh.com/"/>
                     </rdf:Description>
                  </j.0:contributor>
                  <j.0:contributor>
                     <rdf:Description rdf:nodeID="A1">
                        <j.1:name>Achim Berndzen</j.1:name>
                     </rdf:Description>
                  </j.0:contributor>
                  <j.0:contributor>
                     <rdf:Description rdf:nodeID="A2">
                        <j.1:name>Gerrit Imsieke</j.1:name>
                     </rdf:Description>
                  </j.0:contributor>
                  <j.0:contributor>
                     <rdf:Description rdf:nodeID="A3">
                        <j.1:name>Erik Siegel</j.1:name>
                     </rdf:Description>
                  </j.0:contributor>
               </rdf:Description>
               <rdf:Description rdf:about="https://spec.xproc.org/3.0/steps/">
                  <j.0:title>XProc 3.0: Standard Step Library</j.0:title>
                  <j.0:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2022-09-12</j.0:date>
                  <j.0:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
                  <j.0:hasVersion>3.0</j.0:hasVersion>
                  <j.0:isPartOf rdf:resource="https://xproc.org/"/>
                  <j.0:contributor rdf:nodeID="A0"/>
                  <j.0:contributor rdf:nodeID="A1"/>
                  <j.0:contributor rdf:nodeID="A2"/>
                  <j.0:contributor rdf:nodeID="A3"/>
               </rdf:Description>
            </rdf:RDF>
         </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/rdf+xml"
                     href="../documents/sample1.rdf"/>
      </p:with-input>
   </p:identity>
   <p:cast-content-type name="second"
                        content-type="application/rdf+xml"/>
   <p:load content-type="application/rdf+xml"
           href="../documents/sample1.rdf"/>
   <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>

Result

<wrapper xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <rdf:RDF xmlns:cx="http://xmlcalabash.com/ns/extensions"
            xmlns:j.0="http://purl.org/dc/terms/" xmlns:j.1="http://xmlns.com/foaf/0.1/"
            xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about="https://spec.xproc.org/3.0/xproc/">
         <j.0:title>XProc 3.0: An XML Pipeline Language</j.0:title>
         <j.0:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2022-09-12</j.0:date>
         <j.0:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
         <j.0:hasVersion>3.0</j.0:hasVersion>
         <j.0:isPartOf>
            <rdf:Description rdf:about="https://xproc.org/">
               <j.0:title>XProc</j.0:title>
               <j.0:type rdf:resource="http://purl.org/dc/dcmitype/Collection"/>
            </rdf:Description>
         </j.0:isPartOf>
         <j.0:contributor>
            <rdf:Description rdf:nodeID="A0">
               <j.1:name>Norman Walsh</j.1:name>
               <j.1:homepage rdf:resource="https://nwalsh.com/"/>
               <j.1:weblog rdf:resource="https://so.nwalsh.com/"/>
            </rdf:Description>
         </j.0:contributor>
         <j.0:contributor>
            <rdf:Description rdf:nodeID="A1">
               <j.1:name>Achim Berndzen</j.1:name>
            </rdf:Description>
         </j.0:contributor>
         <j.0:contributor>
            <rdf:Description rdf:nodeID="A2">
               <j.1:name>Gerrit Imsieke</j.1:name>
            </rdf:Description>
         </j.0:contributor>
         <j.0:contributor>
            <rdf:Description rdf:nodeID="A3">
               <j.1:name>Erik Siegel</j.1:name>
            </rdf:Description>
         </j.0:contributor>
      </rdf:Description>
      <rdf:Description rdf:about="https://spec.xproc.org/3.0/steps/">
         <j.0:title>XProc 3.0: Standard Step Library</j.0:title>
         <j.0:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2022-09-12</j.0:date>
         <j.0:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
         <j.0:hasVersion>3.0</j.0:hasVersion>
         <j.0:isPartOf rdf:resource="https://xproc.org/"/>
         <j.0:contributor rdf:nodeID="A0"/>
         <j.0:contributor rdf:nodeID="A1"/>
         <j.0:contributor rdf:nodeID="A2"/>
         <j.0:contributor rdf:nodeID="A3"/>
      </rdf:Description>
   </rdf:RDF>
   <rdf:RDF xmlns:j.0="http://purl.org/dc/terms/"
            xmlns:j.1="http://xmlns.com/foaf/0.1/"
            xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about="https://spec.xproc.org/3.0/xproc/">
         <j.0:title>XProc 3.0: An XML Pipeline Language</j.0:title>
         <j.0:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2022-09-12</j.0:date>
         <j.0:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
         <j.0:hasVersion>3.0</j.0:hasVersion>
         <j.0:isPartOf>
            <rdf:Description rdf:about="https://xproc.org/">
               <j.0:title>XProc</j.0:title>
               <j.0:type rdf:resource="http://purl.org/dc/dcmitype/Collection"/>
            </rdf:Description>
         </j.0:isPartOf>
         <j.0:contributor>
            <rdf:Description rdf:nodeID="A0">
               <j.1:name>Norman Walsh</j.1:name>
               <j.1:homepage rdf:resource="https://nwalsh.com/"/>
               <j.1:weblog rdf:resource="https://so.nwalsh.com/"/>
            </rdf:Description>
         </j.0:contributor>
         <j.0:contributor>
            <rdf:Description rdf:nodeID="A1">
               <j.1:name>Achim Berndzen</j.1:name>
            </rdf:Description>
         </j.0:contributor>
         <j.0:contributor>
            <rdf:Description rdf:nodeID="A2">
               <j.1:name>Gerrit Imsieke</j.1:name>
            </rdf:Description>
         </j.0:contributor>
         <j.0:contributor>
            <rdf:Description rdf:nodeID="A3">
               <j.1:name>Erik Siegel</j.1:name>
            </rdf:Description>
         </j.0:contributor>
      </rdf:Description>
      <rdf:Description rdf:about="https://spec.xproc.org/3.0/steps/">
         <j.0:title>XProc 3.0: Standard Step Library</j.0:title>
         <j.0:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2022-09-12</j.0:date>
         <j.0:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
         <j.0:hasVersion>3.0</j.0:hasVersion>
         <j.0:isPartOf rdf:resource="https://xproc.org/"/>
         <j.0:contributor rdf:nodeID="A0"/>
         <j.0:contributor rdf:nodeID="A1"/>
         <j.0:contributor rdf:nodeID="A2"/>
         <j.0:contributor rdf:nodeID="A3"/>
      </rdf:Description>
   </rdf:RDF>
   <rdf:RDF xmlns:j.0="http://purl.org/dc/terms/"
            xmlns:j.1="http://xmlns.com/foaf/0.1/"
            xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about="https://spec.xproc.org/3.0/xproc/">
         <j.0:title>XProc 3.0: An XML Pipeline Language</j.0:title>
         <j.0:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2022-09-12</j.0:date>
         <j.0:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
         <j.0:hasVersion>3.0</j.0:hasVersion>
         <j.0:isPartOf>
            <rdf:Description rdf:about="https://xproc.org/">
               <j.0:title>XProc</j.0:title>
               <j.0:type rdf:resource="http://purl.org/dc/dcmitype/Collection"/>
            </rdf:Description>
         </j.0:isPartOf>
         <j.0:contributor>
            <rdf:Description rdf:nodeID="A0">
               <j.1:name>Norman Walsh</j.1:name>
               <j.1:homepage rdf:resource="https://nwalsh.com/"/>
               <j.1:weblog rdf:resource="https://so.nwalsh.com/"/>
            </rdf:Description>
         </j.0:contributor>
         <j.0:contributor>
            <rdf:Description rdf:nodeID="A1">
               <j.1:name>Achim Berndzen</j.1:name>
            </rdf:Description>
         </j.0:contributor>
         <j.0:contributor>
            <rdf:Description rdf:nodeID="A2">
               <j.1:name>Gerrit Imsieke</j.1:name>
            </rdf:Description>
         </j.0:contributor>
         <j.0:contributor>
            <rdf:Description rdf:nodeID="A3">
               <j.1:name>Erik Siegel</j.1:name>
            </rdf:Description>
         </j.0:contributor>
      </rdf:Description>
      <rdf:Description rdf:about="https://spec.xproc.org/3.0/steps/">
         <j.0:title>XProc 3.0: Standard Step Library</j.0:title>
         <j.0:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2022-09-12</j.0:date>
         <j.0:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
         <j.0:hasVersion>3.0</j.0:hasVersion>
         <j.0:isPartOf rdf:resource="https://xproc.org/"/>
         <j.0:contributor rdf:nodeID="A0"/>
         <j.0:contributor rdf:nodeID="A1"/>
         <j.0:contributor rdf:nodeID="A2"/>
         <j.0:contributor rdf:nodeID="A3"/>
      </rdf:Description>
   </rdf:RDF>
</wrapper>

Schematron checks

<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron"
          xmlns:t="http://xproc.org/ns/testsuite/3.0" 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.