<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="rdf-ttl-002.xml"
        name="rdf-ttl-002.xml"
        expected="pass">
   <t:info>
      <t:title>rdf-ttl-002</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2025-02-15</t:date>
            <t:author>
               <t:name>Norm Tovey-Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Created test.</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Tests that text/turtle works in p:inline, p:document, and p:load.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
                      xmlns:p="http://www.w3.org/ns/xproc"
                      name="main"
                      version="3.0">
         <p:import href="https://xmlcalabash.com/ext/library/rdf.xpl"/>
         <p:output port="result"/>
         <p:identity>
            <p:with-input>
               <p:inline content-type="text/turtle">
@base &lt;https://spec.xproc.org/3.0/&gt; .
@prefix rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .
@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .
@prefix dc: &lt;http://purl.org/dc/terms/&gt; .
@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .
@prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt; .

_:walsh
  foaf:name "Norman Walsh";
  foaf:homepage &lt;https://nwalsh.com/&gt;;
  foaf:weblog &lt;https://so.nwalsh.com/&gt; .

_:berndzen
  foaf:name "Achim Berndzen" .

_:imsieke
  foaf:name "Gerrit Imsieke" .

_:siegel
  foaf:name "Erik Siegel" .

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

&lt;xproc/&gt;
  dc:title "XProc 3.0: An XML Pipeline Language";
  dc:date "2022-09-12"^^xsd:date;
  dc:type &lt;http://purl.org/dc/dcmitype/Text&gt;;
  dc:hasVersion "3.0";
  dc:isPartOf &lt;https://xproc.org/&gt;;
  dc:contributor _:walsh;
  dc:contributor _:berndzen;
  dc:contributor _:imsieke;
  dc:contributor _:siegel .

&lt;steps/&gt;
  dc:title "XProc 3.0: Standard Step Library";
  dc:date "2022-09-12"^^xsd:date;
  dc:type &lt;http://purl.org/dc/dcmitype/Text&gt;;
  dc:hasVersion "3.0";
  dc:isPartOf &lt;https://xproc.org/&gt;;
  dc:contributor _:walsh;
  dc:contributor _:berndzen;
  dc:contributor _:imsieke;
  dc:contributor _:siegel .
      </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="text/turtle" href="../documents/sample1.ttl"/>
            </p:with-input>
         </p:identity>
         <p:cast-content-type name="second" content-type="application/rdf+xml"/>
         <p:load content-type="text/turtle" href="../documents/sample1.ttl"/>
         <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>
   </t:pipeline>
   <t:schematron>
      <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>
   </t:schematron>
   <t:result name="rdf-ttl-002.xml">
      <wrapper>
         <rdf:RDF xmlns:dc="http://purl.org/dc/terms/"
                  xmlns:foaf="http://xmlns.com/foaf/0.1/"
                  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
            <rdf:Description rdf:about="https://spec.xproc.org/3.0/xproc/">
               <dc:title>XProc 3.0: An XML Pipeline Language</dc:title>
               <dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2022-09-12</dc:date>
               <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
               <dc:hasVersion>3.0</dc:hasVersion>
               <dc:isPartOf>
                  <rdf:Description rdf:about="https://xproc.org/">
                     <dc:title>XProc</dc:title>
                     <dc:type rdf:resource="http://purl.org/dc/dcmitype/Collection"/>
                  </rdf:Description>
               </dc:isPartOf>
               <dc:contributor>
                  <rdf:Description rdf:nodeID="A0">
                     <foaf:name>Norman Walsh</foaf:name>
                     <foaf:homepage rdf:resource="https://nwalsh.com/"/>
                     <foaf:weblog rdf:resource="https://so.nwalsh.com/"/>
                  </rdf:Description>
               </dc:contributor>
               <dc:contributor>
                  <rdf:Description rdf:nodeID="A1">
                     <foaf:name>Achim Berndzen</foaf:name>
                  </rdf:Description>
               </dc:contributor>
               <dc:contributor>
                  <rdf:Description rdf:nodeID="A2">
                     <foaf:name>Gerrit Imsieke</foaf:name>
                  </rdf:Description>
               </dc:contributor>
               <dc:contributor>
                  <rdf:Description rdf:nodeID="A3">
                     <foaf:name>Erik Siegel</foaf:name>
                  </rdf:Description>
               </dc:contributor>
            </rdf:Description>
            <rdf:Description rdf:about="https://spec.xproc.org/3.0/steps/">
               <dc:title>XProc 3.0: Standard Step Library</dc:title>
               <dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2022-09-12</dc:date>
               <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
               <dc:hasVersion>3.0</dc:hasVersion>
               <dc:isPartOf rdf:resource="https://xproc.org/"/>
               <dc:contributor rdf:nodeID="A0"/>
               <dc:contributor rdf:nodeID="A1"/>
               <dc:contributor rdf:nodeID="A2"/>
               <dc:contributor rdf:nodeID="A3"/>
            </rdf:Description>
         </rdf:RDF>
         <rdf:RDF xmlns:dc="http://purl.org/dc/terms/"
                  xmlns:foaf="http://xmlns.com/foaf/0.1/"
                  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
            <rdf:Description rdf:about="https://spec.xproc.org/3.0/xproc/">
               <dc:title>XProc 3.0: An XML Pipeline Language</dc:title>
               <dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2022-09-12</dc:date>
               <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
               <dc:hasVersion>3.0</dc:hasVersion>
               <dc:isPartOf>
                  <rdf:Description rdf:about="https://xproc.org/">
                     <dc:title>XProc</dc:title>
                     <dc:type rdf:resource="http://purl.org/dc/dcmitype/Collection"/>
                  </rdf:Description>
               </dc:isPartOf>
               <dc:contributor>
                  <rdf:Description rdf:nodeID="A0">
                     <foaf:name>Norman Walsh</foaf:name>
                     <foaf:homepage rdf:resource="https://nwalsh.com/"/>
                     <foaf:weblog rdf:resource="https://so.nwalsh.com/"/>
                  </rdf:Description>
               </dc:contributor>
               <dc:contributor>
                  <rdf:Description rdf:nodeID="A1">
                     <foaf:name>Achim Berndzen</foaf:name>
                  </rdf:Description>
               </dc:contributor>
               <dc:contributor>
                  <rdf:Description rdf:nodeID="A2">
                     <foaf:name>Gerrit Imsieke</foaf:name>
                  </rdf:Description>
               </dc:contributor>
               <dc:contributor>
                  <rdf:Description rdf:nodeID="A3">
                     <foaf:name>Erik Siegel</foaf:name>
                  </rdf:Description>
               </dc:contributor>
            </rdf:Description>
            <rdf:Description rdf:about="https://spec.xproc.org/3.0/steps/">
               <dc:title>XProc 3.0: Standard Step Library</dc:title>
               <dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2022-09-12</dc:date>
               <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
               <dc:hasVersion>3.0</dc:hasVersion>
               <dc:isPartOf rdf:resource="https://xproc.org/"/>
               <dc:contributor rdf:nodeID="A0"/>
               <dc:contributor rdf:nodeID="A1"/>
               <dc:contributor rdf:nodeID="A2"/>
               <dc:contributor rdf:nodeID="A3"/>
            </rdf:Description>
         </rdf:RDF>
         <rdf:RDF xmlns:dc="http://purl.org/dc/terms/"
                  xmlns:foaf="http://xmlns.com/foaf/0.1/"
                  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
            <rdf:Description rdf:about="https://spec.xproc.org/3.0/xproc/">
               <dc:title>XProc 3.0: An XML Pipeline Language</dc:title>
               <dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2022-09-12</dc:date>
               <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
               <dc:hasVersion>3.0</dc:hasVersion>
               <dc:isPartOf>
                  <rdf:Description rdf:about="https://xproc.org/">
                     <dc:title>XProc</dc:title>
                     <dc:type rdf:resource="http://purl.org/dc/dcmitype/Collection"/>
                  </rdf:Description>
               </dc:isPartOf>
               <dc:contributor>
                  <rdf:Description rdf:nodeID="A0">
                     <foaf:name>Norman Walsh</foaf:name>
                     <foaf:homepage rdf:resource="https://nwalsh.com/"/>
                     <foaf:weblog rdf:resource="https://so.nwalsh.com/"/>
                  </rdf:Description>
               </dc:contributor>
               <dc:contributor>
                  <rdf:Description rdf:nodeID="A1">
                     <foaf:name>Achim Berndzen</foaf:name>
                  </rdf:Description>
               </dc:contributor>
               <dc:contributor>
                  <rdf:Description rdf:nodeID="A2">
                     <foaf:name>Gerrit Imsieke</foaf:name>
                  </rdf:Description>
               </dc:contributor>
               <dc:contributor>
                  <rdf:Description rdf:nodeID="A3">
                     <foaf:name>Erik Siegel</foaf:name>
                  </rdf:Description>
               </dc:contributor>
            </rdf:Description>
            <rdf:Description rdf:about="https://spec.xproc.org/3.0/steps/">
               <dc:title>XProc 3.0: Standard Step Library</dc:title>
               <dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2022-09-12</dc:date>
               <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
               <dc:hasVersion>3.0</dc:hasVersion>
               <dc:isPartOf rdf:resource="https://xproc.org/"/>
               <dc:contributor rdf:nodeID="A0"/>
               <dc:contributor rdf:nodeID="A1"/>
               <dc:contributor rdf:nodeID="A2"/>
               <dc:contributor rdf:nodeID="A3"/>
            </rdf:Description>
         </rdf:RDF>
      </wrapper>
   </t:result>
</t:test>
