Skip to content

Commit

Permalink
Renamed ldh:Content to ldh:View
Browse files Browse the repository at this point in the history
Render content loading error in `.main`
  • Loading branch information
namedgraph committed Dec 6, 2023
1 parent 4ed682c commit 6b9fef6
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 18 deletions.
22 changes: 11 additions & 11 deletions src/main/resources/com/atomgraph/linkeddatahub/ldh.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
owl:imports dh:, ac:, <http://spinrdf.org/spin>, foaf:, sd:, nfo:, owl: ;
rdfs:label "LinkedDataHub ontology" ;
rdfs:comment "Should be imported and reused by all extending applications" ;
owl:versionInfo "1.1.5" .
owl:versionInfo "1.1.6" .

# PROPERTIES

Expand Down Expand Up @@ -231,15 +231,15 @@
rdfs:label "Model chart constructor" ;
rdfs:isDefinedBy : .

# container
# view

:Container a rdfs:Class, owl:Class ;
rdfs:label "Container" ;
spin:constructor :ContainerConstructor ;
:View a rdfs:Class, owl:Class ;
rdfs:label "View" ;
spin:constructor :ViewConstructor ;
spin:constraint :MissingQuery ;
rdfs:isDefinedBy : .

:ContainerConstructor a :Constructor ;
:ViewConstructor a :Constructor ;
sp:text """
PREFIX spin: <http://spinrdf.org/spin#>
PREFIX sp: <http://spinrdf.org/sp#>
Expand All @@ -248,7 +248,7 @@
$this spin:query [ a sp:Select ] .
}
WHERE {}""" ;
rdfs:label "Container constructor" ;
rdfs:label "View constructor" ;
rdfs:isDefinedBy : .

# content
Expand Down Expand Up @@ -408,7 +408,7 @@ WHERE

# CONTENTS

:ChildrenContainer a :Container ;
:ChildrenView a :View ;
rdfs:label "Children container" ;
spin:query :SelectChildren ;
rdfs:isDefinedBy : .
Expand Down Expand Up @@ -531,15 +531,15 @@ dh:Item spin:constructor :TitleConstructor, :DescriptionConstructor, :PrimaryTop
WHERE {}""" ;
rdfs:isDefinedBy : .

:ContainerContentConstructor a :Constructor ;
:ViewContentConstructor a :Constructor ;
rdfs:label "Container content constructor" ;
sp:text """
PREFIX ldh: <https://w3id.org/atomgraph/linkeddatahub#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
CONSTRUCT {
$this rdf:_1 [ a ldh:Content ;
rdf:value ldh:ChildrenContainer
rdf:value ldh:ChildrenView
] .
}
WHERE {}""" ;
Expand All @@ -551,7 +551,7 @@ dh:Item spin:constructor :TitleConstructor, :DescriptionConstructor, :PrimaryTop
sp:arg1 sioc:has_container ;
rdfs:isDefinedBy : .

dh:Container spin:constructor :TitleConstructor, :DescriptionConstructor, :PrimaryTopicConstructor, :ContainerContentConstructor .
dh:Container spin:constructor :TitleConstructor, :DescriptionConstructor, :PrimaryTopicConstructor, :ViewContentConstructor .
# spin:constraint :MissingParent .

:MissingParent a :MissingPropertyValue ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ exclude-result-prefixes="#all"

<!-- CONTAINER -->

<xsl:template match="*[@rdf:about][rdf:type/@rdf:resource = '&ldh;Container'][spin:query/@rdf:resource]" mode="ldh:RenderContent" priority="1">
<xsl:template match="*[@rdf:about][rdf:type/@rdf:resource = '&ldh;View'][spin:query/@rdf:resource]" mode="ldh:RenderContent" priority="1">
<xsl:param name="this" as="xs:anyURI"/>
<xsl:param name="container" as="element()"/>
<xsl:param name="graph" as="xs:anyURI?"/>
Expand Down Expand Up @@ -261,13 +261,17 @@ exclude-result-prefixes="#all"
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$container">
<xsl:for-each select="$container//div[contains-token(@class, 'main')]">
<xsl:result-document href="?." method="ixsl:replace-content">
<div class="alert alert-block">
<strong>Could not load service resource: <a href="{$service-uri}"><xsl:value-of select="$service-uri"/></a></strong>
</div>
</xsl:result-document>
</xsl:for-each>

<xsl:call-template name="ldh:ContentLoaded">
<xsl:with-param name="container" select="$container"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Expand Down Expand Up @@ -350,13 +354,17 @@ exclude-result-prefixes="#all"
</ixsl:schedule-action>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$container">
<xsl:for-each select="$container//div[contains-token(@class, 'main')]">
<xsl:result-document href="?." method="ixsl:replace-content">
<div class="alert alert-block">
<strong>Could not load service resource: <a href="{$service-uri}"><xsl:value-of select="$service-uri"/></a></strong>
</div>
</xsl:result-document>
</xsl:for-each>
<xsl:call-template name="ldh:ContentLoaded">
<xsl:with-param name="container" select="$container"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>-->
Expand Down Expand Up @@ -828,13 +836,17 @@ exclude-result-prefixes="#all"
<ixsl:set-style name="border-color" select="'#ff0039'" object="$textarea/following-sibling::div[contains-token(@class, 'CodeMirror')]"/> <!-- YASQE container -->
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$container">
<xsl:for-each select="$container//div[contains-token(@class, 'main')]">
<xsl:result-document href="?." method="ixsl:replace-content">
<div class="alert alert-block">
<strong>Could not save content resource: <a href="{$query-uri}"><xsl:value-of select="$query-uri"/></a></strong>
</div>
</xsl:result-document>
</xsl:for-each>

<xsl:call-template name="ldh:ContentLoaded">
<xsl:with-param name="container" select="$container"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Expand Down Expand Up @@ -1369,7 +1381,7 @@ LIMIT 100]]></sp:text>
</xsl:if>
</rdf:Description>
<rdf:Description rdf:about="{$container-uri}">
<rdf:type rdf:resource="&ldh;Container"/>
<rdf:type rdf:resource="&ldh;View"/>
<spin:query rdf:resource="{$query-uri}"/>
</rdf:Description>
</rdf:RDF>
Expand Down Expand Up @@ -1621,13 +1633,17 @@ LIMIT 100]]></sp:text>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$container">
<xsl:for-each select="$container//div[contains-token(@class, 'main')]">
<xsl:result-document href="?." method="ixsl:replace-content">
<div class="alert alert-block">
<strong>Could not load content resource: <a href="{$content-value}"><xsl:value-of select="$content-value"/></a></strong>
</div>
</xsl:result-document>
</xsl:for-each>

<xsl:call-template name="ldh:ContentLoaded">
<xsl:with-param name="container" select="$container"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Expand Down Expand Up @@ -1664,13 +1680,17 @@ LIMIT 100]]></sp:text>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$container">
<xsl:for-each select="$container//div[contains-token(@class, 'main')]">
<xsl:result-document href="?." method="ixsl:replace-content">
<div class="alert alert-block">
<strong>Could not load content resource: <a href="{$query-uri}"><xsl:value-of select="$query-uri"/></a></strong>
</div>
</xsl:result-document>
</xsl:for-each>

<xsl:call-template name="ldh:ContentLoaded">
<xsl:with-param name="container" select="$container"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Expand Down

0 comments on commit 6b9fef6

Please sign in to comment.