Skip to content

Commit e20d1c1

Browse files
namedgraphclaude
andcommitted
Fallback to synthesized predicate description when proxy unavailable
When ENABLE_LINKED_DATA_PROXY=false, facet filter requests for external predicate URIs (e.g. schema.org) return 405, leaving the left-nav empty. Instead of silently ignoring the error, synthesize an rdf:Description with rdfs:label derived from the predicate's local name so bs2:FilterIn renders facet headers in both cases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent cbc5e7a commit e20d1c1

File tree

1 file changed

+21
-12
lines changed
  • src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block

1 file changed

+21
-12
lines changed

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block/view.xsl

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1910,19 +1910,28 @@ exclude-result-prefixes="#all"
19101910
<xsl:message>ldh:facet-filter-response</xsl:message>
19111911

19121912
<xsl:for-each select="$response">
1913-
<xsl:if test="?status = 200 and ?media-type = 'application/rdf+xml' and ?body">
1914-
<xsl:variable name="body" select="?body" as="document-node()"/>
1913+
<xsl:variable name="predicate-desc" as="element()">
1914+
<xsl:choose>
1915+
<xsl:when test="?status = 200 and ?media-type = 'application/rdf+xml' and ?body">
1916+
<xsl:sequence select="key('resources', $predicate, ?body)"/>
1917+
</xsl:when>
1918+
<xsl:otherwise>
1919+
<!-- fallback when proxy is unavailable: synthesize a description using the predicate's local name as label -->
1920+
<rdf:Description rdf:about="{$predicate}">
1921+
<rdfs:label><xsl:value-of select="tokenize($predicate, '[/#]')[last()]"/></rdfs:label>
1922+
</rdf:Description>
1923+
</xsl:otherwise>
1924+
</xsl:choose>
1925+
</xsl:variable>
19151926

1916-
<xsl:for-each select="$container">
1917-
<xsl:result-document href="?." method="ixsl:append-content">
1918-
<xsl:apply-templates select="key('resources', $predicate, $body)" mode="bs2:FilterIn">
1919-
<xsl:with-param name="subject-var-name" select="$subject-var-name"/>
1920-
<xsl:with-param name="object-var-name" select="$object-var-name"/>
1921-
</xsl:apply-templates>
1922-
</xsl:result-document>
1923-
</xsl:for-each>
1924-
</xsl:if>
1925-
<!-- ignore error response -->
1927+
<xsl:for-each select="$container">
1928+
<xsl:result-document href="?." method="ixsl:append-content">
1929+
<xsl:apply-templates select="$predicate-desc" mode="bs2:FilterIn">
1930+
<xsl:with-param name="subject-var-name" select="$subject-var-name"/>
1931+
<xsl:with-param name="object-var-name" select="$object-var-name"/>
1932+
</xsl:apply-templates>
1933+
</xsl:result-document>
1934+
</xsl:for-each>
19261935
</xsl:for-each>
19271936

19281937
<xsl:sequence select="$context"/>

0 commit comments

Comments
 (0)