@@ -772,8 +772,8 @@ WHERE
772772<!-- <xsl:variable name="resource" select="key('resources-by-type', $forClass, ?body)[not(key('predicates-by-object', @rdf:nodeID)[not(../rdf:type/@rdf:resource = '&spin;ConstraintViolation')])]" as="element()"/>-->
773773 <xsl : variable name =" body" select =" ?body" as =" document-node()" />
774774 <!-- TO-DO: refactor to use asynchronous HTTP requests -->
775- <xsl : variable name =" types" select =" distinct-values($resource /rdf:type/@rdf:resource)" as =" xs:anyURI*" />
776- <xsl : variable name =" property-uris" select =" distinct-values($resource /*/concat(namespace-uri(), local-name()))" as =" xs:string*" />
775+ <xsl : variable name =" types" select =" distinct-values($body/rdf:RDF/* /rdf:type/@rdf:resource)" as =" xs:anyURI*" />
776+ <xsl : variable name =" property-uris" select =" distinct-values($body/rdf:RDF /*/concat(namespace-uri(), local-name()))" as =" xs:string*" />
777777 <xsl : variable name =" query-string" select =" 'DESCRIBE $Type VALUES $Type { ' || string-join(for $uri in $property-uris return '< ' || $uri || '> ', ' ') || ' }'" as =" xs:string" />
778778 <xsl : variable name =" request-uri" select =" ac:build-uri(resolve-uri('ns', $ldt:base), map{ 'query': $query-string, 'accept': 'application/rdf+xml' })" as =" xs:anyURI" />
779779 <xsl : variable name =" property-metadata" select =" document($request-uri)" as =" document-node()" />
@@ -794,7 +794,7 @@ WHERE
794794 <xsl : variable name =" request-uri" select =" ac:build-uri(resolve-uri('ns', $ldt:base), map{ 'query': $query-string, 'accept': 'application/rdf+xml' })" as =" xs:anyURI" />
795795 <xsl : variable name =" shapes" select =" document($request-uri)" as =" document-node()" />
796796
797- <xsl : variable name =" object-uris" select =" distinct-values($resource /*/@rdf:resource[not(key('resources', .))])" as =" xs:string*" />
797+ <xsl : variable name =" object-uris" select =" distinct-values($body/rdf:RDF/* /*/@rdf:resource[not(key('resources', .))])" as =" xs:string*" />
798798 <xsl : variable name =" query-string" select =" $object-metadata-query || ' VALUES $this { ' || string-join(for $uri in $object-uris return '< ' || $uri || '> ', ' ') || ' }'" as =" xs:string" />
799799 <xsl : variable name =" request-uri" select =" ac:build-uri(resolve-uri('sparql', $ldt:base), map{ 'query': $query-string, 'accept': 'application/rdf+xml' })" as =" xs:anyURI" />
800800 <xsl : variable name =" object-metadata" select =" if (doc-available($request-uri)) then document($request-uri) else ()" as =" document-node()?" />
0 commit comments