Skip to content

Commit cfa7d56

Browse files
committed
Restored ldh:ChildrenViewContructor
1 parent 091a1c5 commit cfa7d56

5 files changed

Lines changed: 34 additions & 17 deletions

File tree

src/main/resources/com/atomgraph/linkeddatahub/ldh.ttl

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,14 +576,29 @@ dh:Item spin:constructor :TitleConstructor, :DescriptionConstructor, :PrimaryTop
576576
WHERE {}""" ;
577577
rdfs:isDefinedBy : .
578578

579+
:ChildrenViewContructor a :Constructor ;
580+
rdfs:label "Container content constructor" ;
581+
sp:text """
582+
PREFIX ldh: <https://w3id.org/atomgraph/linkeddatahub#>
583+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
584+
PREFIX spin: <http://spinrdf.org/spin#>
585+
586+
CONSTRUCT {
587+
$this rdf:_1 [
588+
a ldh:Object ;
589+
rdf:value ldh:ChildrenView ;
590+
] .
591+
}
592+
WHERE {}""" ;
593+
rdfs:isDefinedBy : .
594+
579595
:MissingContainer a :MissingPropertyValue ;
580596
rdfs:label "Missing container" ;
581597
rdfs:comment "Requires items to have a parent container" ;
582598
sp:arg1 sioc:has_container ;
583599
rdfs:isDefinedBy : .
584600

585-
dh:Container spin:constructor :TitleConstructor, :DescriptionConstructor, :PrimaryTopicConstructor ;
586-
:template :ChildrenView .
601+
dh:Container spin:constructor :TitleConstructor, :DescriptionConstructor, :PrimaryTopicConstructor, :ChildrenViewContructor .
587602

588603
:MissingParent a :MissingPropertyValue ;
589604
rdfs:label "Missing parent" ;
@@ -678,4 +693,4 @@ sd:Service spin:constructor :ServiceConstructor ;
678693
}
679694
WHERE {}""" ;
680695
rdfs:label "Service constructor" ;
681-
rdfs:isDefinedBy : .
696+
rdfs:isDefinedBy : .

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ exclude-result-prefixes="#all"
115115

116116
<!-- TEMPLATES -->
117117

118+
<!-- identity transform -->
119+
120+
<xsl:template match="@* | node()" mode="ldh:Identity">
121+
<xsl:copy>
122+
<xsl:apply-templates select="@* | node()" mode="#current"/>
123+
</xsl:copy>
124+
</xsl:template>
125+
118126
<!-- render row -->
119127

120128
<xsl:template match="*" mode="ldh:RenderRow" as="(function(item()?) as map(*))?">

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,9 @@ exclude-result-prefixes="#all"
4343
<xsl:attribute name="class" select="concat($class, ' ', 'btn-run-query')"/>
4444
</xsl:template>
4545

46-
<!-- identity transform -->
47-
48-
<xsl:template match="@* | node()" mode="ldh:SetQueryString">
49-
<xsl:copy>
50-
<xsl:apply-templates select="@* | node()" mode="#current"/>
51-
</xsl:copy>
52-
</xsl:template>
53-
5446
<!-- set query string -->
5547

56-
<xsl:template match="sp:text/text()" mode="ldh:SetQueryString" priority="1">
48+
<xsl:template match="sp:text/text()" mode="ldh:Identity" priority="1">
5749
<xsl:param name="query-string" as="xs:string" tunnel="yes"/>
5850

5951
<xsl:sequence select="$query-string"/>
@@ -467,7 +459,7 @@ exclude-result-prefixes="#all"
467459

468460
<!-- replace the query string (sp:text value) on the query resource -->
469461
<xsl:variable name="query" as="element()">
470-
<xsl:apply-templates select="$query" mode="ldh:SetQueryString">
462+
<xsl:apply-templates select="$query" mode="ldh:Identity">
471463
<xsl:with-param name="query-string" select="$query-string" tunnel="yes"/>
472464
</xsl:apply-templates>
473465
</xsl:variable>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ WHERE
107107
<xsl:template match="*[rdf:type/@rdf:resource = ('&spin;ConstraintViolation', '&sh;ValidationResult', '&sh;ValidationReport', '&http;Response')]" mode="bs2:Form" priority="3"/>
108108

109109
<!-- suppress the system properties of document resources (they are set automatically by LinkedDataHub) -->
110-
<xsl:template match="*[rdf:type/@rdf:resource = ('&def;Root', '&dh;Container', '&dh;Item')]/dct:created | *[rdf:type/@rdf:resource = ('&def;Root', '&dh;Container', '&dh;Item')]/dct:modified | *[rdf:type/@rdf:resource = ('&def;Root', '&dh;Container', '&dh;Item')]/sioc:has_container | *[rdf:type/@rdf:resource = ('&def;Root', '&dh;Container', '&dh;Item')]/sioc:has_parent | *[rdf:type/@rdf:resource = ('&def;Root', '&dh;Container', '&dh;Item')]/dct:creator | *[rdf:type/@rdf:resource = ('&def;Root', '&dh;Container', '&dh;Item')]/acl:owner | *[rdf:type/@rdf:resource = ('&def;Root', '&dh;Container', '&dh;Item')]/*[namespace-uri() = '&rdf;'][starts-with(local-name(), '_')]" mode="bs2:FormControl" priority="1"/>
110+
<xsl:template match="*[rdf:type/@rdf:resource = ('&def;Root', '&dh;Container', '&dh;Item')]/dct:created | *[rdf:type/@rdf:resource = ('&def;Root', '&dh;Container', '&dh;Item')]/dct:modified | *[rdf:type/@rdf:resource = ('&def;Root', '&dh;Container', '&dh;Item')]/sioc:has_container | *[rdf:type/@rdf:resource = ('&def;Root', '&dh;Container', '&dh;Item')]/sioc:has_parent | *[rdf:type/@rdf:resource = ('&def;Root', '&dh;Container', '&dh;Item')]/dct:creator | *[rdf:type/@rdf:resource = ('&def;Root', '&dh;Container', '&dh;Item')]/acl:owner | *[rdf:type/@rdf:resource = ('&def;Root', '&dh;Container', '&dh;Item')]/*[namespace-uri() = '&rdf;'][starts-with(local-name(), '_')][@rdf:resource]" mode="bs2:FormControl" priority="1"/>
111111

112112
<!-- canonicalize XML in rdf:XMLLiterals -->
113113
<xsl:template match="json:string[@key = 'object'][ends-with(., '^^&rdf;XMLLiteral')]" mode="ldh:CanonicalizeXML" priority="1">

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/layout.xsl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,10 @@ LIMIT 100
805805
<xsl:param name="typeof" select="key('resources', ac:absolute-path(ldh:base-uri(.)))/rdf:type/@rdf:resource/xs:anyURI(.)" as="xs:anyURI*"/>
806806
<xsl:param name="doc-types" select="key('resources', ac:absolute-path(ldh:base-uri(.)))/rdf:type/@rdf:resource[ . = ('&def;Root', '&dh;Container', '&dh;Item')]" as="xs:anyURI*"/>
807807
<!-- take care not to load unnecessary documents over HTTP when $doc-types is empty -->
808-
<xsl:param name="block-values" select="if (exists($doc-types)) then (if (doc-available(resolve-uri('ns?query=ASK%20%7B%7D', $ldt:base))) then (ldh:query-result(map{}, resolve-uri('ns', $ldt:base), $template-query || ' VALUES $Type { ' || string-join(for $type in $doc-types return '&lt;' || $type || '&gt;', ' ') || ' }')//srx:binding[@name = 'block']/srx:uri/xs:anyURI(.)) else ()) else ()" as="xs:anyURI*"/>
809-
<xsl:param name="has-content" select="key('resources', key('resources', ac:absolute-path(ldh:base-uri(.)))/rdf:*[starts-with(local-name(), '_')]/@rdf:resource) or exists($block-values)" as="xs:boolean"/>
808+
<xsl:param name="template-block-uris" select="if (exists($doc-types)) then (if (doc-available(resolve-uri('ns?query=ASK%20%7B%7D', $ldt:base))) then (ldh:query-result(map{}, resolve-uri('ns', $ldt:base), $template-query || ' VALUES $Type { ' || string-join(for $type in $doc-types return '&lt;' || $type || '&gt;', ' ') || ' }')//srx:binding[@name = 'block']/srx:uri/xs:anyURI(.)) else ()) else ()" as="xs:anyURI*"/>
809+
<xsl:param name="block-uris" select="key('resources', ac:absolute-path(ldh:base-uri(.)))/rdf:*[starts-with(local-name(), '_')]/@rdf:resource" as="xs:anyURI*"/>
810+
<!-- document has content when either explicitly declared document-level blocks exist or template-declared class-level blocks exist -->
811+
<xsl:param name="has-content" select="exists(for $block-uri in $block-uris return (if (doc-available(ac:document-uri($block-uri))) then key('resources', $block-uri, document(ac:document-uri($block-uri))) else ())) or exists($template-block-uris)" as="xs:boolean"/>
810812

811813
<div>
812814
<xsl:if test="$id">
@@ -838,7 +840,7 @@ LIMIT 100
838840
</xsl:when>
839841
<!-- check if the current document has content or its class has content -->
840842
<xsl:when test="(empty($ac:mode) and $has-content) or $ac:mode = '&ldh;ContentMode'">
841-
<xsl:for-each select="$block-values">
843+
<xsl:for-each select="$template-block-uris">
842844
<xsl:if test="doc-available(ac:document-uri(.))">
843845
<xsl:apply-templates select="key('resources', ., document(ac:document-uri(.)))" mode="bs2:Row"/>
844846
</xsl:if>

0 commit comments

Comments
 (0)