Skip to content

Commit 5da7a04

Browse files
committed
Fixed chart creation from query
Views have optional titles now
1 parent 7c09fc4 commit 5da7a04

File tree

2 files changed

+15
-5
lines changed
  • src/main
    • resources/com/atomgraph/linkeddatahub
    • webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block

2 files changed

+15
-5
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ ldh:Import spin:constructor ldh:TitleConstructor, ldh:DescriptionConstructor ;
5353
ldh:Chart spin:constructor ldh:TitleConstructor, ldh:DescriptionConstructor ;
5454
spin:constraint :MissingTitle .
5555

56+
ldh:View spin:constructor ldh:TitleConstructor, ldh:DescriptionConstructor .
57+
# spin:constraint :MissingTitle .
58+
5659
nfo:FileDataObject rdfs:label "File" ;
5760
spin:constructor ldh:TitleConstructor, ldh:DescriptionConstructor ;
5861
spin:constraint :MissingTitle .

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,19 @@ exclude-result-prefixes="#all"
496496
</rdf:RDF>
497497
</xsl:document>
498498
</xsl:variable>
499-
500499
<xsl:variable name="doc-uri" select="ac:absolute-path(ldh:base-uri(.))" as="xs:anyURI"/>
500+
<xsl:variable name="id" select="'id' || ac:uuid()" as="xs:string"/>
501+
<xsl:variable name="this" select="xs:anyURI($doc-uri || '#' || $id)" as="xs:anyURI"/>
502+
<!-- set document URI instead of blank node -->
503+
<xsl:variable name="constructed-doc" as="document-node()">
504+
<xsl:document>
505+
<xsl:apply-templates select="$constructed-doc" mode="ldh:SetResourceID">
506+
<xsl:with-param name="forClass" select="$forClass" tunnel="yes"/>
507+
<xsl:with-param name="about" select="$this" tunnel="yes"/>
508+
</xsl:apply-templates>
509+
</xsl:document>
510+
</xsl:variable>
511+
501512
<xsl:variable name="method" select="'post'" as="xs:string"/>
502513
<xsl:variable name="resource" select="key('resources-by-type', $forClass, $constructed-doc)[not(key('predicates-by-object', @rdf:nodeID))]" as="element()"/>
503514
<xsl:variable name="row-form" as="element()*">
@@ -516,10 +527,6 @@ exclude-result-prefixes="#all"
516527
<xsl:variable name="request-uri" select="ac:build-uri(resolve-uri('ns', $ldt:base), map{ 'query': $query-string, 'accept': 'application/sparql-results+xml' })" as="xs:anyURI"/>
517528
<xsl:variable name="constructors" select="if (exists($types)) then document($request-uri) else ()" as="document-node()?"/>
518529

519-
<xsl:message>
520-
.add-constructor $constructors: <xsl:value-of select="serialize($constructors)"/>
521-
</xsl:message>
522-
523530
<xsl:variable name="query-string" select="$constraint-query || ' VALUES $Type { ' || string-join(for $type in $types return '&lt;' || $type || '&gt;', ' ') || ' }'" as="xs:string"/>
524531
<xsl:variable name="request-uri" select="ac:build-uri(resolve-uri('ns', $ldt:base), map{ 'query': $query-string, 'accept': 'application/sparql-results+xml' })" as="xs:anyURI"/>
525532
<xsl:variable name="constraints" select="if (exists($types)) then document($request-uri) else ()" as="document-node()?"/>

0 commit comments

Comments
 (0)