Skip to content

Commit

Permalink
Use ixsl:location() instead of base-uri() in ldh:LoadContent
Browse files Browse the repository at this point in the history
  • Loading branch information
namedgraph committed Nov 13, 2023
1 parent ec597da commit dd23dcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void filter(ContainerRequestContext request) throws IOException
com.atomgraph.linkeddatahub.apps.model.Application app = appResource.as(com.atomgraph.linkeddatahub.apps.model.Application.class);
request.setProperty(LAPP.Application.getURI(), app); // wrap into a helper class so it doesn't interfere with injection of Application

// use the ?namedGraph URL parameter to override the effective request URI if its URI value is relative to the app's base URI
// use the ?graph URL parameter to override the effective request URI if its URI value is relative to the app's base URI
final URI requestURI;
if (request.getUriInfo().getQueryParameters().containsKey(LDH.graph.getLocalName()))
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ exclude-result-prefixes="#all"
<xsl:variable name="this" select="ancestor::div[@about][1]/@about" as="xs:anyURI"/>
<xsl:variable name="content-uri" select="(@about, $this)[1]" as="xs:anyURI"/> <!-- fallback to @about for charts, queries etc. -->
<xsl:variable name="content-value" select="ixsl:get(., 'dataset.contentValue')" as="xs:anyURI"/> <!-- get the value of the @data-content-value attribute -->
<xsl:variable name="graph" select="if (ixsl:contains(., 'dataset.contentGraph')) then xs:anyURI(ixsl:get(., 'dataset.contentGraph')) else ac:absolute-path(base-uri())" as="xs:anyURI"/> <!-- get the value of the @data-content-graph attribute -->
<xsl:variable name="graph" select="if (ixsl:contains(., 'dataset.contentGraph')) then xs:anyURI(ixsl:get(., 'dataset.contentGraph'))" as="xs:anyURI?"/> <!-- get the value of the @data-content-graph attribute -->
<xsl:variable name="mode" select="if (ixsl:contains(., 'dataset.contentMode')) then xs:anyURI(ixsl:get(., 'dataset.contentMode')) else ()" as="xs:anyURI?"/> <!-- get the value of the @data-content-mode attribute -->
<xsl:variable name="container" select="." as="element()"/>
<xsl:variable name="progress-container" select="if (contains-token(@class, 'row-fluid')) then ./div[contains-token(@class, 'main')] else ." as="element()"/>
Expand All @@ -1050,7 +1050,8 @@ exclude-result-prefixes="#all"
</xsl:result-document>
</xsl:for-each>

<xsl:variable name="request-uri" select="ldh:href($ldt:base, $graph, map{}, $content-value)" as="xs:anyURI"/>
<!-- don't use base-uri() because it's value comes from the last HTML document load -->
<xsl:variable name="request-uri" select="ldh:href($ldt:base, if ($graph) then $graph else ac:absolute-path(ixsl:location()), map{}, $content-value)" as="xs:anyURI"/>
<xsl:variable name="request" as="item()*">
<ixsl:schedule-action http-request="map{ 'method': 'GET', 'href': ac:document-uri($request-uri), 'headers': map{ 'Accept': 'application/rdf+xml' } }">
<xsl:call-template name="onContentValueLoad">
Expand Down

0 comments on commit dd23dcb

Please sign in to comment.