Skip to content
Browse files

Further fixes for migration to MarkLogic.

  • Loading branch information...
1 parent e084876 commit ef297804d0a8b26acbfa3792df79756857d0d21d @philipfennell committed Feb 23, 2012
View
7 src/main/xquery/app/resources/xslt/lib/canonical-trix.xsl
@@ -49,8 +49,11 @@
<xsl:template match="id" mode="canon">
- <xsl:param name="idLUT" as="element()" tunnel="yes"/>
- <xsl:copy><xsl:value-of select="$idLUT/id[@value eq string(current())]/@replacement"/></xsl:copy>
+ <!--<xsl:param name="idLUT" as="element()" tunnel="yes"/>
+ <xsl:copy copy-namespaces="no"><xsl:value-of select="$idLUT/id[@value eq string(current())]/@replacement"/></xsl:copy>-->
+ <xsl:copy copy-namespaces="no">
+ <xsl:copy-of select="@*"/>
+ </xsl:copy>
</xsl:template>
View
214 src/main/xquery/app/resources/xslt/lib/normalise-rdf-xml.xsl
@@ -2,6 +2,7 @@
<xsl:transform
xmlns:err="http://www.marklogic.com/rdf/error"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:xdmp="http://marklogic.com/xdmp"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="#all"
@@ -28,7 +29,7 @@
<!-- The RDF root. -->
<xsl:template match="/rdf:RDF" mode="rdf" priority="1">
<xsl:copy>
- <xsl:copy-of select="@* except (@xml:base)"/>
+ <xsl:copy-of select="@* except (@xml:base)" copy-namespaces="no"/>
<xsl:apply-templates select="*" mode="rdf:node-elements"/>
</xsl:copy>
</xsl:template>
@@ -45,7 +46,7 @@
<!-- -->
<xsl:template match="rdf:Bag | rdf:Seq | rdf:Alt" mode="rdf:node-elements" priority="3">
<rdf:Description>
- <xsl:copy-of select="(rdf:resolve-uri-reference((@rdf:about | @rdf:ID)), @rdf:nodeID, rdf:generate-node-id-attr(.))[1]"/>
+ <xsl:copy-of select="(rdf:resolve-uri-reference((@rdf:about | @rdf:ID | @rdf:bagID)), @rdf:nodeID, rdf:generate-node-id-attr(.))[1]" copy-namespaces="no"/>
<rdf:type rdf:resource="{concat(namespace-uri-from-QName(resolve-QName(name(), .)), local-name())}"/>
<xsl:apply-templates select="*" mode="rdf:container"/>
</rdf:Description>
@@ -55,7 +56,7 @@
<!-- -->
<xsl:template match="*[rdf:is-typed-element-node(.)][rdf:li]" mode="rdf:node-elements" priority="3">
<rdf:Description>
- <xsl:copy-of select="(rdf:resolve-uri-reference((@rdf:about | @rdf:ID)), @rdf:nodeID, rdf:generate-node-id-attr(.))[1]"/>
+ <xsl:copy-of select="(rdf:resolve-uri-reference((@rdf:about | @rdf:ID | @rdf:bagID)), @rdf:nodeID, rdf:generate-node-id-attr(.))[1]" copy-namespaces="no"/>
<rdf:type rdf:resource="{concat(namespace-uri-from-QName(resolve-QName(name(), .)), local-name())}"/>
<xsl:apply-templates select="*" mode="rdf:container"/>
</rdf:Description>
@@ -73,7 +74,7 @@
<!-- -->
<xsl:template match="rdf:li[@rdf:resource]" mode="rdf:container rdf:node-elements rdf:property-elements" priority="4">
<xsl:element name="rdf:_{count(preceding-sibling::rdf:li) + 1}">
- <xsl:copy-of select="@rdf:resource"/>
+ <xsl:copy-of select="@rdf:resource" copy-namespaces="no"/>
</xsl:element>
</xsl:template>
@@ -89,7 +90,7 @@
<!-- -->
<xsl:template match="rdf:*[matches(local-name(), '_\d+')]" mode="rdf:container">
<xsl:copy>
- <xsl:copy-of select="@*"/>
+ <xsl:copy-of select="@*" copy-namespaces="no"/>
<xsl:apply-templates select="* | text()" mode="rdf:node-elements"/>
</xsl:copy>
</xsl:template>
@@ -98,88 +99,88 @@
<!-- Node Elements with no child Node ELements. -->
<xsl:template match="rdf:Description[not(*)]" mode="rdf:node-elements" priority="2">
<xsl:copy>
- <xsl:copy-of select="(rdf:resolve-uri-reference((@rdf:about|@rdf:ID)), rdf:generate-node-id-attr(..))[1]"/>
- <xsl:copy-of select="@xml:*"/>
+ <xsl:copy-of select="(rdf:resolve-uri-reference((@rdf:about | @rdf:ID | @rdf:bagID)), rdf:generate-node-id-attr(..))[1]" copy-namespaces="no"/>
+ <xsl:copy-of select="@xml:*" copy-namespaces="no"/>
<xsl:apply-templates select="@* except (@rdf:about, @rdf:ID, @rdf:nodeID, @xml:*)" mode="rdf:property-attributes"/>
</xsl:copy>
</xsl:template>
<!-- Node Elements. -->
<xsl:template match="rdf:Description" mode="rdf:node-elements" priority="1">
- <xsl:param name="nodeIDAttr" as="attribute()?" select="@rdf:nodeID"/>
+ <xsl:param name="nodeIDAttr" as="attribute()?" select="@rdf:nodeID" tunnel="yes"/>
<xsl:variable name="subjectAttr" as="attribute()"
- select="(rdf:resolve-uri-reference((@rdf:about | @rdf:ID)), $nodeIDAttr, rdf:generate-node-id-attr(.))[1]"/>
+ select="(rdf:resolve-uri-reference((@rdf:about | @rdf:ID | @rdf:bagID)), $nodeIDAttr, rdf:generate-node-id-attr(.))[1]"/>
<xsl:copy>
- <xsl:copy-of select="$subjectAttr"/>
- <xsl:apply-templates select="@* except (@rdf:*, @xml:*)" mode="rdf:property-attributes"/>
+ <xsl:copy-of select="$subjectAttr" copy-namespaces="no"/>
+ <xsl:apply-templates select="@* except (@xml:*)" mode="rdf:property-attributes"/>
<xsl:apply-templates select="*" mode="rdf:property-elements"/>
</xsl:copy>
<xsl:apply-templates select="*[element()]" mode="rdf:referred-node-element"/>
<xsl:apply-templates select="*" mode="rdf:reify-if-required">
- <xsl:with-param name="subjectAttr" as="attribute()" select="$subjectAttr"/>
+ <xsl:with-param name="subjectAttr" as="attribute()" select="$subjectAttr" tunnel="yes"/>
</xsl:apply-templates>
<xsl:apply-templates select="*" mode="rdf:property-elements-property-attributes"/>
</xsl:template>
<!-- Other elements in the RDF namespace that aren't rdf:Description. -->
<xsl:template match="rdf:*" mode="rdf:node-elements">
- <xsl:param name="nodeIDAttr" as="attribute()?">
+ <xsl:param name="nodeIDAttr" as="attribute()?" tunnel="yes">
<xsl:attribute name="nodeID" select="generate-id(..)"/>
</xsl:param>
<xsl:variable name="subjectAttr" as="attribute()"
- select="(rdf:resolve-uri-reference((@rdf:about|@rdf:ID)), $nodeIDAttr)[1]"/>
+ select="(rdf:resolve-uri-reference((@rdf:about | @rdf:ID | @rdf:bagID)), $nodeIDAttr)[1]"/>
<rdf:Description>
- <xsl:copy-of select="$subjectAttr"/>
+ <xsl:copy-of select="$subjectAttr" copy-namespaces="no"/>
<xsl:if test="not(../*[@rdf:parseType eq 'Resource'])">
<rdf:type rdf:resource="{concat(namespace-uri-from-QName(resolve-QName(name(), .)), local-name())}"/>
</xsl:if>
- <xsl:apply-templates select="@* except (@rdf:*, @xml:*)" mode="rdf:property-attributes"/>
+ <xsl:apply-templates select="@* except (@xml:*)" mode="rdf:property-attributes"/>
<xsl:apply-templates select="*" mode="rdf:property-elements"/>
</rdf:Description>
<xsl:apply-templates select="*[element()]" mode="rdf:referred-node-element"/>
<xsl:apply-templates select="*" mode="rdf:reify-if-required">
- <xsl:with-param name="subjectAttr" as="attribute()" select="$subjectAttr"/>
+ <xsl:with-param name="subjectAttr" as="attribute()" select="$subjectAttr" tunnel="yes"/>
</xsl:apply-templates>
</xsl:template>
<!-- Typed Element Nodes. -->
<xsl:template match="*[rdf:is-typed-element-node(.)]" mode="rdf:node-elements">
- <xsl:param name="nodeIDAttr" as="attribute()?">
+ <xsl:param name="nodeIDAttr" as="attribute()?" tunnel="yes">
<xsl:attribute name="rdf:nodeID" select="generate-id(..)"/>
</xsl:param>
<xsl:variable name="subjectAttr" as="attribute()"
- select="(rdf:resolve-uri-reference((@rdf:about|@rdf:ID)), $nodeIDAttr)[1]"/>
+ select="(rdf:resolve-uri-reference((@rdf:about | @rdf:ID | @rdf:bagID)), $nodeIDAttr)[1]"/>
<rdf:Description>
- <xsl:copy-of select="$subjectAttr"/>
+ <xsl:copy-of select="$subjectAttr" copy-namespaces="no"/>
<xsl:if test="not(../*[@rdf:parseType eq 'Resource'])">
<rdf:type rdf:resource="{concat(namespace-uri-from-QName(resolve-QName(name(), .)), local-name())}"/>
</xsl:if>
- <xsl:apply-templates select="@* except (@rdf:*, @xml:*)" mode="rdf:property-attributes"/>
+ <xsl:apply-templates select="@* except (@xml:*)" mode="rdf:property-attributes"/>
<xsl:apply-templates select="*" mode="rdf:property-elements"/>
</rdf:Description>
<xsl:apply-templates select="*[element()]" mode="rdf:referred-node-element"/>
<xsl:apply-templates select="*" mode="rdf:reify-if-required">
- <xsl:with-param name="subjectAttr" as="attribute()" select="$subjectAttr"/>
+ <xsl:with-param name="subjectAttr" as="attribute()" select="$subjectAttr" tunnel="yes"/>
</xsl:apply-templates>
</xsl:template>
<!-- Typed Element Nodes. -->
<xsl:template match="*[rdf:is-typed-element-node(.)]" mode="rdf:typed-node-elements">
- <xsl:param name="nodeIDAttr" as="attribute()?">
+ <xsl:param name="nodeIDAttr" as="attribute()?" tunnel="yes">
<xsl:attribute name="rdf:nodeID" select="generate-id(..)"/>
</xsl:param>
<xsl:variable name="subjectAttr" as="attribute()"
- select="(rdf:resolve-uri-reference((@rdf:about|@rdf:ID)), $nodeIDAttr)[1]"/>
+ select="(rdf:resolve-uri-reference((@rdf:about | @rdf:ID | @rdf:bagID)), $nodeIDAttr)[1]"/>
<rdf:Description>
- <xsl:copy-of select="$subjectAttr"/>
+ <xsl:copy-of select="$subjectAttr" copy-namespaces="no"/>
<xsl:if test="not(../*[@rdf:parseType eq 'Resource'])">
<rdf:type rdf:resource="{concat(namespace-uri-from-QName(resolve-QName(name(), .)), local-name())}"/>
</xsl:if>
@@ -188,13 +189,35 @@
<!-- Expand property attributes into property elements. -->
- <xsl:template match="@rdf:type" mode="rdf:property-attributes">
+ <xsl:template match="@rdf:type" mode="rdf:property-attributes" priority="4">
<xsl:element name="{name()}" namespace="{namespace-uri()}">
<xsl:attribute name="rdf:resource" select="."/>
</xsl:element>
</xsl:template>
+ <!-- Expand allowed RDF property attributes into property elements. -->
+ <xsl:template match="@rdf:Seq | @rdf:Bag | @rdf:Alt | @rdf:Statement | @rdf:Property | @rdf:List" mode="rdf:property-attributes" priority="2">
+ <xsl:element name="{name()}" namespace="{namespace-uri()}">
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:template>
+
+
+ <!-- Ignore these RDF Attributes. -->
+ <xsl:template match="@rdf:about | @rdf:ID | @rdf:parseType | @rdf:resource | @rdf:nodeID" mode="rdf:property-attributes" priority="1"/>
+
+
+ <!-- Warn about non-standard RDF property attributes. -->
+ <xsl:template match="@rdf:*" mode="rdf:property-attributes">
+ <xsl:message use-when="system-property('xsl:product-name') eq 'SAXON'" select="concat('[GRIP] ', name(), ' is not a recognized RDF property or type.')"/>
+ <xsl:copy-of use-when="system-property('xsl:product-name') eq 'MarkLogic Server'" select="xdmp:log(concat('[GRIP] ', name(), ' is not a recognized RDF property or type.'), 'warning')" copy-namespaces="no"/>
+ <xsl:element name="{name()}" namespace="{namespace-uri()}">
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:template>
+
+
<!-- Expand property attributes into property elements. -->
<xsl:template match="@*" mode="rdf:property-attributes">
<xsl:element name="{name()}" namespace="{namespace-uri()}">
@@ -214,7 +237,7 @@
<!-- Resource References -->
<xsl:template match="*[@rdf:resource][not(*)]" mode="rdf:property-elements" priority="2">
<xsl:copy>
- <xsl:copy-of select="rdf:resolve-uri-reference(@rdf:resource)"/>
+ <xsl:copy-of select="rdf:resolve-uri-reference(@rdf:resource)" copy-namespaces="no"/>
</xsl:copy>
</xsl:template>
@@ -262,7 +285,7 @@
<!-- Generate reference to a Resource. -->
<xsl:template match="*[@rdf:parseType eq 'Resource']" mode="rdf:property-elements" priority="2">
<xsl:copy>
- <xsl:copy-of select="@rdf:parseType"/>
+ <xsl:copy-of select="@rdf:parseType" copy-namespaces="no"/>
<xsl:if test="not(@rdf:nodeID)">
<xsl:attribute name="rdf:nodeID" select="generate-id()"/>
</xsl:if>
@@ -313,14 +336,14 @@
<!-- Empty Property Elements require reification. -->
<xsl:template match="*[@rdf:ID][not(* | text())]" mode="rdf:reify-if-required">
- <xsl:param name="subjectAttr" as="attribute()"/>
+ <xsl:param name="subjectAttr" as="attribute()" tunnel="yes"/>
- <rdf:Description rdf:about="{rdf:resolve-uri-reference(@rdf:ID)}">
+ <rdf:Description rdf:about="{rdf:resolve-uri-reference(@rdf:ID | @rdf:bagID)}">
<rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/>
<rdf:subject>
<xsl:choose>
<xsl:when test="$subjectAttr instance of attribute(rdf:nodeID)">
- <xsl:copy-of select="$subjectAttr"/>
+ <xsl:copy-of select="$subjectAttr" copy-namespaces="no"/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="rdf:resource" select="string($subjectAttr)"></xsl:attribute>
@@ -331,12 +354,12 @@
<xsl:choose>
<xsl:when test="@rdf:parseType eq 'Resource'">
<rdf:object>
- <xsl:copy-of select="rdf:generate-node-id-attr(.)"/>
+ <xsl:copy-of select="rdf:generate-node-id-attr(.)" copy-namespaces="no"/>
</rdf:object>
</xsl:when>
<xsl:when test="@rdf:nodeID">
<rdf:object>
- <xsl:copy-of select="@rdf:nodeID"/>
+ <xsl:copy-of select="@rdf:nodeID" copy-namespaces="no"/>
</rdf:object>
</xsl:when>
<xsl:otherwise>
@@ -364,7 +387,7 @@
<!-- Replicate all other literal attributes (normally just @xml:lang) -->
<xsl:template match="@*" mode="rdf:literal-attributes">
- <xsl:copy-of select="."/>
+ <xsl:copy-of select="." copy-namespaces="no"/>
</xsl:template>
@@ -420,7 +443,7 @@
<!-- -->
<xsl:template match="*[rdf:is-typed-element-node(element()) and */@rdf:about]" mode="rdf:referred-node-element" priority="2">
<xsl:apply-templates select="*" mode="rdf:typed-node-elements">
- <xsl:with-param name="nodeIDAttr" as="attribute()?">
+ <xsl:with-param name="nodeIDAttr" as="attribute()?" tunnel="yes">
<xsl:attribute name="rdf:about" select="rdf:resolve-uri(*/@rdf:about)"/>
</xsl:with-param>
</xsl:apply-templates>
@@ -430,9 +453,9 @@
<!-- -->
<xsl:template match="*[not(rdf:Description)]" mode="rdf:referred-node-element" priority="1">
<xsl:apply-templates select="." mode="rdf:node-elements">
- <xsl:with-param name="nodeIDAttr" as="attribute()?">
+ <xsl:with-param name="nodeIDAttr" as="attribute()?" tunnel="yes">
<!-- When the rdf:Description is a child of a Typed Property Element ignore its rdf:nodeID. -->
- <xsl:attribute name="rdf:nodeID" select="(if (@rdf:*) then () else @rdf:nodeID, generate-id())[1]"/>
+ <xsl:attribute name="rdf:nodeID" select="generate-id()"/>
</xsl:with-param>
</xsl:apply-templates>
</xsl:template>
@@ -519,4 +542,121 @@
<!-- === Errors or Unsupported. ======================================== -->
+ <!-- -->
+ <xsl:template match="*[@rdf:ID]" mode="#all" priority="14">
+ <xsl:choose>
+ <xsl:when test="exists(preceding-sibling::*[rdf:resolve-uri-reference(@rdf:ID) eq rdf:resolve-uri-reference(current()/@rdf:ID)])">
+ <xsl:copy-of select="error(xs:QName('err:Error'), concat('Two elements cannot use the same ID ''', @rdf:ID, '''.'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:next-match/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- rdf:li is not allowed as an attribute -->
+ <xsl:template match="@rdf:li" mode="rdf:property-attributes" priority="10">
+ <xsl:copy-of select="error(xs:QName('err:Error'), 'rdf:li is not allowed as an attribute')"/>
+ </xsl:template>
+
+
+ <!-- rdf:li elements as typed nodes - a bizarre case - as specified in:
+ http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2001Nov/0651.html
+ is now an error. -->
+ <xsl:template match="rdf:li" mode="rdf:node-elements" priority="10">
+ <xsl:copy-of select="error(xs:QName('err:Error'), 'rdf:li elements as typed nodes is now an error.')"/>
+ </xsl:template>
+
+
+ <!-- aboutEach removed from the RDF specifications. -->
+ <xsl:template match="rdf:Description[@rdf:aboutEach]" mode="rdf:node-elements" priority="10">
+ <xsl:copy-of select="error(xs:QName('err:Error'), 'rdf:aboutEach attribute removed from the RDF specifications.')"/>
+ </xsl:template>
+
+
+ <!-- aboutEachPrefix removed from the RDF specifications. -->
+ <xsl:template match="rdf:Description[@rdf:aboutEachPrefix]" mode="rdf:node-elements" priority="10">
+ <xsl:copy-of select="error(xs:QName('err:Error'), 'rdf:aboutEachPrefix attribute removed from the RDF specifications.')"/>
+ </xsl:template>
+
+
+ <!-- It is not legal RDF to specify an rdf:parseType of "Literal" and an rdf:resource attribute at the same time. -->
+ <xsl:template match="*[@rdf:parseType and @rdf:resource]" mode="rdf:property-elements" priority="12">
+ <xsl:copy-of select="error(xs:QName('err:Error'), 'It is not legal RDF to specify an rdf:parseType of ''Literal'' and an rdf:resource attribute at the same time.')"/>
+ </xsl:template>
+
+
+ <!-- The attribute rdf:parseType is not permitted with property attributes on a property element. -->
+ <xsl:template match="*[@rdf:parseType and @* except (@rdf:parseType, @rdf:*, @xml:*)]" mode="rdf:property-elements" priority="10">
+ <xsl:copy-of select="error(xs:QName('err:Error'), 'The attribute rdf:parseType is not permitted with property attributes on a property element.')"/>
+ </xsl:template>
+
+
+ <!-- The value of rdf:ID or rdf:bagID must match the XML Name production -->
+ <xsl:template match="@rdf:ID | @rdf:bagID" mode="rdf:ref-attr rdf:literal-attributes" priority="10">
+ <xsl:choose>
+ <xsl:when test="rdf:is-xml-name(.)">
+ <xsl:next-match/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="error(xs:QName('err:Error'), concat('The value of ', name(), ' ''',. , ''' does not match the XML Name production.'))"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- The value of rdf:ID or rdf:bagID must match the XML Name production -->
+ <xsl:template match="*[@rdf:nodeID]" mode="#all" priority="10">
+ <xsl:choose>
+ <xsl:when test="rdf:is-xml-name(@rdf:nodeID)">
+ <xsl:next-match/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="error(xs:QName('err:Error'), concat('The value of rdf:nodeID ''', @rdf:nodeID, ' '' does not match the XML Name production.'))"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- Cannot have rdf:nodeID and rdf:ID. -->
+ <xsl:template match="rdf:Description[@rdf:nodeID and @rdf:ID]" mode="#all" priority="12">
+ <xsl:copy-of select="error(xs:QName('err:Error'), 'Cannot have rdf:nodeID and rdf:ID.')"/>
+ </xsl:template>
+
+
+ <!-- Cannot have rdf:nodeID and rdf:about. -->
+ <xsl:template match="*[@rdf:nodeID and @rdf:about]" mode="#all" priority="12">
+ <xsl:copy-of select="error(xs:QName('err:Error'), 'Cannot have rdf:nodeID and rdf:about')"/>
+ </xsl:template>
+
+
+ <!-- Cannot have rdf:nodeID and rdf:resource. -->
+ <xsl:template match="*[@rdf:nodeID and @rdf:resource]" mode="#all" priority="12">
+ <xsl:copy-of select="error(xs:QName('err:Error'), 'Cannot have rdf:nodeID and rdf:resource')"/>
+ </xsl:template>
+
+
+ <!-- Forbidden as a node element name. -->
+ <xsl:template match="rdf:RDF | rdf:ID | rdf:about | rdf:aboutEach | rdf:bagID |
+ rdf:parseType | rdf:resource | rdf:nodeID | rdf:li | rdf:aboutEachPrefix"
+ mode="rdf:node-elements" priority="10">
+ <xsl:copy-of select="error(xs:QName('err:Error'), concat(name(), ' is forbidden as a node element name.'))"/>
+ </xsl:template>
+
+
+ <!-- Forbidden as a property element name. -->
+ <xsl:template match="rdf:RDF | rdf:Description | rdf:ID | rdf:about | rdf:aboutEach | rdf:bagID |
+ rdf:parseType | rdf:resource | rdf:nodeID | rdf:aboutEachPrefix"
+ mode="rdf:property-elements" priority="10">
+ <xsl:copy-of select="error(xs:QName('err:Error'), concat(name(), ' is forbidden as a property element name.'))"/>
+ </xsl:template>
+
+
+ <!-- Returns true if the passed string matches the XML name production (as modified by XML Namespaces). -->
+ <xsl:function name="rdf:is-xml-name" as="xs:boolean">
+ <xsl:param name="string" as="xs:string"/>
+
+ <xsl:value-of select="matches($string, '^([A-Za-z_])([A-Za-z]|[0-9]|\.|-|_)*$')"/>
+ </xsl:function>
</xsl:transform>
View
2 src/main/xquery/app/resources/xslt/lib/rdf-xml-to-trix.xsl
@@ -5,7 +5,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- exclude-result-prefixes="#all"
+ exclude-result-prefixes="err"
version="2.0">
<xsl:import href="normalise-rdf-xml.xsl"/>
View
4 src/main/xquery/app/resources/xslt/lib/trix-set-graph-uri.xsl
@@ -22,12 +22,12 @@
<xsl:template match="trix:graph/trix:uri">
- <xsl:copy><xsl:value-of select="$GRAPH_URI"/></xsl:copy>
+ <xsl:copy copy-namespaces="no"><xsl:value-of select="$GRAPH_URI"/></xsl:copy>
</xsl:template>
<xsl:template match="*">
- <xsl:copy>
+ <xsl:copy copy-namespaces="no">
<xsl:copy-of select="@*"/>
<xsl:apply-templates select="* | text()"/>
</xsl:copy>
View
4 src/test/sandbox/retrieve-graph.xpl
@@ -17,6 +17,8 @@
<p:import href="test/resources/xproc/test.xpl"/>
- <gsp:retrieve-graph uri="http://localhost:8005/merge-to-service-test"/>
+ <gsp:retrieve-graph uri="http://localhost:8005/graphs"
+ graph="http://www.w3.org/2000/10/rdf-tests/rdfcore/rdfms-syntax-incomplete/test002.rdf"
+ media-type="application/xml"/>
</p:declare-step>
View
10 src/test/sandbox/retrieve-named-graph.xqy
@@ -0,0 +1,10 @@
+xquery version "1.0-ml" encoding "utf-8";
+
+declare default function namespace "http://www.w3.org/2005/xpath-functions";
+
+import module namespace gsp="http://www.w3.org/TR/sparql11-http-rdf-update/" at
+ "/lib/lib-gsp.xqy";
+
+(: Tests the retrieval of a named graph. :)
+
+gsp:get-graph('http://www.w3.org/2000/10/rdf-tests/rdfcore/rdfms-syntax-incomplete/test004.rdf')

0 comments on commit ef29780

Please sign in to comment.
Something went wrong with that request. Please try again.