Skip to content

Commit 142834d

Browse files
committed
Fixed $row-form construction
1 parent 51d894f commit 142834d

4 files changed

Lines changed: 7 additions & 19 deletions

File tree

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,6 @@ exclude-result-prefixes="#all">
6666
<!-- disable the right nav (backlinks etc.) -->
6767
<xsl:template match="*[*][@rdf:about or @rdf:nodeID][ac:absolute-path($ldh:requestUri) = resolve-uri(encode-for-uri('sign up'), $ldt:base)]" mode="bs2:Right" use-when="system-property('xsl:product-name') = 'SAXON'"/>
6868

69-
<!-- constraint violation -->
70-
<!-- <xsl:template match="rdf:RDF[ac:absolute-path($ldh:requestUri) = resolve-uri(encode-for-uri('sign up'), $ldt:base)][key('resources-by-type', '&spin;ConstraintViolation') or key('resources-by-type', '&sh;ValidationResult')]" mode="bs2:Row" priority="3">
71-
SIGNUP<xsl:apply-templates select="." mode="bs2:RowForm">
72-
<xsl:with-param name="id" select="'form-signup'"/>
73-
<xsl:with-param name="method" select="'post'"/> don't use PATCH which is the default
74-
<xsl:with-param name="action" select="ac:absolute-path(base-uri($main-doc))"/>
75-
<xsl:with-param name="enctype" select="()"/>
76-
<xsl:with-param name="create-resource" select="false()"/>
77-
<xsl:with-param name="base-uri" select="ac:absolute-path(base-uri($main-doc))" tunnel="yes"/> base-uri() is empty on constructed documents
78-
</xsl:apply-templates>/SIGNUP
79-
</xsl:template>-->
80-
8169
<xsl:template match="rdf:RDF[ac:absolute-path($ldh:requestUri) = resolve-uri(encode-for-uri('sign up'), $ldt:base)]" mode="bs2:Row" priority="2">
8270
<xsl:variable name="constructors" select="ldh:query-result(map{}, resolve-uri('ns', $ldt:base), $constructor-query || ' VALUES $Type { ' || string-join(for $type in '&foaf;Person' return '&lt;' || $type || '&gt;', ' ') || ' }')" as="document-node()?"/>
8371
<xsl:apply-templates select="ldh:construct(map{ xs:anyURI('&foaf;Person'): $constructors//srx:result[srx:binding[@name = 'Type'] = '&foaf;Person']/srx:binding[@name = 'construct']/srx:literal/string() })" mode="bs2:RowForm">

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,9 +1321,11 @@ WHERE
13211321
</xsl:document>
13221322
</xsl:variable>
13231323
<xsl:variable name="classes" select="()" as="element()*"/>
1324+
1325+
<!-- object blank nodes that only have a single rdf:type property from constructed models -->
1326+
<xsl:variable name="resource" select="key('resources-by-type', $forClass, $constructed-doc)[not(key('predicates-by-object', @rdf:nodeID))][* except rdf:type]" as="element()"/>
13241327

1325-
<xsl:variable name="resource" select="key('resources-by-type', $forClass, $constructed-doc)[not(key('predicates-by-object', @rdf:nodeID))]" as="element()"/>
1326-
<xsl:variable name="row-form" as="element()*">
1328+
<xsl:variable name="row-form" as="element()">
13271329
<!-- TO-DO: refactor to use asynchronous HTTP requests -->
13281330
<xsl:variable name="types" select="distinct-values($resource/rdf:type/@rdf:resource)" as="xs:anyURI*"/>
13291331
<xsl:variable name="query-string" select="'DESCRIBE $Type VALUES $Type { ' || string-join(for $type in $types return '&lt;' || $type || '&gt;', ' ') || ' }'" as="xs:string"/>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ exclude-result-prefixes="#all"
351351

352352
<!-- SET DOCUMENT URI -->
353353

354-
<xsl:template match="rdf:Description[@rdf:nodeID]" mode="ldh:SetResourceID" priority="1">
354+
<!-- resource has to have properties other than rdf:type -->
355+
<xsl:template match="rdf:Description[@rdf:nodeID][* except rdf:type]" mode="ldh:SetResourceID" priority="1">
355356
<xsl:param name="forClass" as="xs:anyURI" tunnel="yes"/>
356357
<xsl:param name="about" as="xs:anyURI?" tunnel="yes"/>
357358
<xsl:param name="nodeID" as="xs:string?" tunnel="yes"/>

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,10 +1081,7 @@ extension-element-prefixes="ixsl"
10811081
<!-- ROW FORM -->
10821082

10831083
<!-- hide object blank nodes that only have a single rdf:type property from constructed models, unless the type is owl:NamedIndividual -->
1084-
<xsl:template match="*[@rdf:nodeID][$ac:method = 'GET'][key('predicates-by-object', @rdf:nodeID)][not(* except rdf:type or rdf:type/@rdf:resource = '&owl;NamedIndividual')]" mode="bs2:RowForm" priority="2" use-when="system-property('xsl:product-name') = 'SAXON'"/>
1085-
1086-
<!-- hide object blank nodes that only have a single rdf:type property from constructed models, unless the type is owl:NamedIndividual -->
1087-
<xsl:template match="*[@rdf:nodeID][key('predicates-by-object', @rdf:nodeID)][not(* except rdf:type or rdf:type/@rdf:resource = '&owl;NamedIndividual')]" mode="bs2:RowForm" priority="2" use-when="system-property('xsl:product-name') eq 'SaxonJS'"/>
1084+
<xsl:template match="*[@rdf:nodeID][key('predicates-by-object', @rdf:nodeID)][not(* except rdf:type or rdf:type/@rdf:resource = '&owl;NamedIndividual')]" mode="bs2:RowForm" priority="2"/>
10881085

10891086
<xsl:template match="*[*][@rdf:about] | *[*][@rdf:nodeID]" mode="bs2:RowForm">
10901087
<xsl:param name="id" select="if (contains(@rdf:about, ac:absolute-path(ldh:base-uri(.)) || '#')) then substring-after(@rdf:about, ac:absolute-path(ldh:base-uri(.)) || '#') else generate-id()" as="xs:string?"/>

0 commit comments

Comments
 (0)