Tests that application/ld+json works in p:inline, p:document, and p:load.
Test rdf-jsonld-002.xml is expected to pass.
<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/ld+json">
{
"@graph": [
{
"@id": "_:b0",
"http://xmlns.com/foaf/0.1/name": "Norman Walsh",
"http://xmlns.com/foaf/0.1/homepage": {
"@id": "https://nwalsh.com/"
},
"http://xmlns.com/foaf/0.1/weblog": {
"@id": "https://so.nwalsh.com/"
}
},
{
"@id": "_:b1",
"http://xmlns.com/foaf/0.1/name": "Achim Berndzen"
},
{
"@id": "_:b2",
"http://xmlns.com/foaf/0.1/name": "Gerrit Imsieke"
},
{
"@id": "_:b3",
"http://xmlns.com/foaf/0.1/name": "Erik Siegel"
},
{
"@id": "https://xproc.org/",
"http://purl.org/dc/terms/title": "XProc",
"http://purl.org/dc/terms/type": {
"@id": "http://purl.org/dc/dcmitype/Collection"
}
},
{
"@id": "https://spec.xproc.org/3.0/xproc/",
"http://purl.org/dc/terms/title": "XProc 3.0: An XML Pipeline Language",
"http://purl.org/dc/terms/date": {
"@value": "2022-09-12",
"@type": "http://www.w3.org/2001/XMLSchema#date"
},
"http://purl.org/dc/terms/type": {
"@id": "http://purl.org/dc/dcmitype/Text"
},
"http://purl.org/dc/terms/hasVersion": "3.0",
"http://purl.org/dc/terms/isPartOf": {
"@id": "https://xproc.org/"
},
"http://purl.org/dc/terms/contributor": [
{
"@id": "_:b0"
},
{
"@id": "_:b1"
},
{
"@id": "_:b2"
},
{
"@id": "_:b3"
}
]
},
{
"@id": "https://spec.xproc.org/3.0/steps/",
"http://purl.org/dc/terms/title": "XProc 3.0: Standard Step Library",
"http://purl.org/dc/terms/date": {
"@value": "2022-09-12",
"@type": "http://www.w3.org/2001/XMLSchema#date"
},
"http://purl.org/dc/terms/type": {
"@id": "http://purl.org/dc/dcmitype/Text"
},
"http://purl.org/dc/terms/hasVersion": "3.0",
"http://purl.org/dc/terms/isPartOf": {
"@id": "https://xproc.org/"
},
"http://purl.org/dc/terms/contributor": [
{
"@id": "_:b0"
},
{
"@id": "_:b1"
},
{
"@id": "_:b2"
},
{
"@id": "_:b3"
}
]
}
]
}
</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/ld+json" href="../documents/sample1.jsonld"/>
</p:with-input>
</p:identity>
<p:cast-content-type name="second" content-type="application/rdf+xml"/>
<p:load content-type="application/ld+json" href="../documents/sample1.jsonld"/>
<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>
<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>
Created test.