1313 <!ENTITY srx " http://www.w3.org/2005/sparql-results#" >
1414 <!ENTITY http " http://www.w3.org/2011/http#" >
1515 <!ENTITY acl " http://www.w3.org/ns/auth/acl#" >
16+ <!ENTITY sd " http://www.w3.org/ns/sparql-service-description#" >
1617 <!ENTITY ldt " https://www.w3.org/ns/ldt#" >
1718 <!ENTITY dh " https://www.w3.org/ns/ldt/document-hierarchy#" >
1819 <!ENTITY sh " http://www.w3.org/ns/shacl#" >
@@ -39,6 +40,7 @@ xmlns:xsd="&xsd;"
3940xmlns:srx=" &srx; "
4041xmlns:http=" &http; "
4142xmlns:acl=" &acl; "
43+ xmlns:sd=" &sd; "
4244xmlns:ldt=" &ldt; "
4345xmlns:sh=" &sh; "
4446xmlns:sp=" &sp; "
@@ -117,6 +119,14 @@ exclude-result-prefixes="#all"
117119 <xsl : sequence select =" base-uri($arg)" />
118120 </xsl : function >
119121
122+ <xsl : function name =" ldt:base" as =" xs:anyURI" >
123+ <xsl : sequence select =" $ldt:base" />
124+ </xsl : function >
125+
126+ <xsl : function name =" sd:endpoint" as =" xs:anyURI" >
127+ <xsl : sequence select =" resolve-uri('sparql', ldt:base())" />
128+ </xsl : function >
129+
120130 <xsl : function name =" ldh:href" as =" xs:anyURI" >
121131 <xsl : param name =" uri" as =" xs:anyURI?" />
122132
@@ -137,7 +147,7 @@ exclude-result-prefixes="#all"
137147
138148 <xsl : choose >
139149 <!-- proxy URI - internal ones (relative to application's base URI) will be rewritten as absolute path in ApplicationFilter -->
140- <xsl : when test =" $uri and not(starts-with($uri, $ ldt:base))" >
150+ <xsl : when test =" $uri and not(starts-with($uri, ldt:base() ))" >
141151 <xsl : sequence select =" xs:anyURI(ac:build-uri(ac:absolute-path(ldh:request-uri()), map:merge((map{ 'uri': string($uri) }, $query-params))) || (if ($fragment) then ('#' || $fragment) else ()))" />
142152 </xsl : when >
143153 <!-- local URI -->
@@ -199,7 +209,7 @@ exclude-result-prefixes="#all"
199209
200210 <xsl : function name =" ldh:construct-forClass" as =" document-node()" cache =" yes" >
201211 <xsl : param name =" forClass" as =" xs:anyURI+" />
202- <xsl : variable name =" results-uri" select =" ac:build-uri(resolve-uri('ns', $ ldt:base), map{ 'forClass': for $class in $forClass return string($class), 'accept': 'application/rdf+xml' })" as =" xs:anyURI" />
212+ <xsl : variable name =" results-uri" select =" ac:build-uri(resolve-uri('ns', ldt:base() ), map{ 'forClass': for $class in $forClass return string($class), 'accept': 'application/rdf+xml' })" as =" xs:anyURI" />
203213 <xsl : variable name =" request-uri" select =" ldh:href($results-uri, map{})" as =" xs:anyURI" />
204214
205215 <xsl : sequence select =" document($request-uri)" />
@@ -524,7 +534,7 @@ exclude-result-prefixes="#all"
524534 <!-- subject resource -->
525535 <xsl : template match =" @rdf:about" mode =" xhtml:Anchor" >
526536<!-- <xsl:param name="graph" as="xs:anyURI?" tunnel="yes"/>-->
527- <xsl : param name =" fragment" select =" if (starts-with(., $ ldt:base)) then (if (contains(., '#')) then substring-after(., '#') else ()) else encode-for-uri(.)" as =" xs:string?" />
537+ <xsl : param name =" fragment" select =" if (starts-with(., ldt:base() )) then (if (contains(., '#')) then substring-after(., '#') else ()) else encode-for-uri(.)" as =" xs:string?" />
528538 <xsl : param name =" href" select =" ldh:href(xs:anyURI(.), map{}, $fragment)" as =" xs:anyURI" />
529539 <xsl : param name =" id" as =" xs:string?" />
530540 <xsl : param name =" title" select =" ." as =" xs:string?" />
@@ -535,13 +545,13 @@ exclude-result-prefixes="#all"
535545 <xsl : with-param name =" href" select =" $href" />
536546 <xsl : with-param name =" id" select =" $id" />
537547 <xsl : with-param name =" title" select =" $title" />
538- <xsl : with-param name =" class" select =" $class || (if (not(starts-with(., $ ldt:base))) then ' external' else())" />
548+ <xsl : with-param name =" class" select =" $class || (if (not(starts-with(., ldt:base() ))) then ' external' else())" />
539549 <xsl : with-param name =" target" select =" $target" />
540550 </xsl : next-match >
541551 </xsl : template >
542552
543553 <xsl : template match =" @rdf:about | @rdf:resource" mode =" svg:Anchor" >
544- <xsl : param name =" fragment" select =" if (starts-with(., $ ldt:base)) then (if (contains(., '#')) then substring-after(., '#') else ()) else encode-for-uri(.)" as =" xs:string?" />
554+ <xsl : param name =" fragment" select =" if (starts-with(., ldt:base() )) then (if (contains(., '#')) then substring-after(., '#') else ()) else encode-for-uri(.)" as =" xs:string?" />
545555 <xsl : param name =" href" select =" ldh:href(xs:anyURI(.), map{}, $fragment)" as =" xs:anyURI" />
546556 <xsl : param name =" id" select =" $fragment" as =" xs:string?" />
547557 <xsl : param name =" label" select =" if (parent::rdf:Description) then ac:svg-label(..) else ac:svg-object-label(.)" as =" xs:string" />
@@ -554,7 +564,7 @@ exclude-result-prefixes="#all"
554564 <xsl : with-param name =" id" select =" $id" />
555565 <xsl : with-param name =" label" select =" $label" />
556566 <xsl : with-param name =" title" select =" $title" />
557- <xsl : with-param name =" class" select =" $class || (if (not(starts-with(., $ ldt:base))) then ' external' else())" />
567+ <xsl : with-param name =" class" select =" $class || (if (not(starts-with(., ldt:base() ))) then ' external' else())" />
558568 <xsl : with-param name =" target" select =" $target" />
559569 </xsl : next-match >
560570 </xsl : template >
@@ -563,7 +573,7 @@ exclude-result-prefixes="#all"
563573
564574 <!-- proxy link URIs if they are external -->
565575 <xsl : template match =" @rdf:resource | srx:uri" priority =" 2" >
566- <xsl : param name =" fragment" select =" if (starts-with(., $ ldt:base)) then (if (contains(., '#')) then substring-after(., '#') else ()) else encode-for-uri(.)" as =" xs:string?" />
576+ <xsl : param name =" fragment" select =" if (starts-with(., ldt:base() )) then (if (contains(., '#')) then substring-after(., '#') else ()) else encode-for-uri(.)" as =" xs:string?" />
567577 <xsl : param name =" href" select =" ldh:href(xs:anyURI(.), map{}, $fragment)" as =" xs:anyURI" />
568578 <xsl : param name =" id" as =" xs:string?" />
569579 <xsl : param name =" title" select =" ." as =" xs:string?" />
@@ -574,7 +584,7 @@ exclude-result-prefixes="#all"
574584 <xsl : with-param name =" href" select =" $href" />
575585 <xsl : with-param name =" id" select =" $id" />
576586 <xsl : with-param name =" title" select =" $title" />
577- <xsl : with-param name =" class" select =" $class || (if (not(starts-with(., $ ldt:base))) then ' external' else())" />
587+ <xsl : with-param name =" class" select =" $class || (if (not(starts-with(., ldt:base() ))) then ' external' else())" />
578588 <xsl : with-param name =" target" select =" $target" />
579589 </xsl : next-match >
580590 </xsl : template >
0 commit comments