Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 12 additions & 19 deletions src/main/resources/com/atomgraph/linkeddatahub/ldh.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@
rdfs:label "Series variable name" ;
rdfs:isDefinedBy : .

:template a owl:ObjectProperty ;
rdfs:domain rdfs:Class ;
rdfs:label "Class-level content block" ;
rdfs:isDefinedBy : .

# CLASSES

# constructor
Expand Down Expand Up @@ -473,6 +478,11 @@ ORDER BY ?title
""" ;
rdfs:isDefinedBy : .

:ChildrenView a :View ;
rdfs:label "Children view" ;
spin:query :SelectChildren ;
rdfs:isDefinedBy : .

# CLIENT TERMS. TO-DO: move to a separate Web-Client ontology?

ac:Chart a rdfs:Class, owl:Class ;
Expand Down Expand Up @@ -566,31 +576,14 @@ dh:Item spin:constructor :TitleConstructor, :DescriptionConstructor, :PrimaryTop
WHERE {}""" ;
rdfs:isDefinedBy : .

:ChildrenViewContructor 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#>
PREFIX spin: <http://spinrdf.org/spin#>

CONSTRUCT {
$this rdf:_1 [ a ldh:Object ;
rdf:value [
a ldh:View ;
spin:query ldh:SelectChildren
]
] .
}
WHERE {}""" ;
rdfs:isDefinedBy : .

:MissingContainer a :MissingPropertyValue ;
rdfs:label "Missing container" ;
rdfs:comment "Requires items to have a parent container" ;
sp:arg1 sioc:has_container ;
rdfs:isDefinedBy : .

dh:Container spin:constructor :TitleConstructor, :DescriptionConstructor, :PrimaryTopicConstructor, :ChildrenViewContructor .
dh:Container spin:constructor :TitleConstructor, :DescriptionConstructor, :PrimaryTopicConstructor ;
:template :ChildrenView .

:MissingParent a :MissingPropertyValue ;
rdfs:label "Missing parent" ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ LIMIT 100

<!-- check if agent has access to the user endpoint by executing a dummy query ASK {} -->
<xsl:template match="rdf:RDF[doc-available(resolve-uri('sparql?query=ASK%20%7B%7D', $ldt:base))] | srx:sparql[doc-available(resolve-uri('sparql?query=ASK%20%7B%7D', $ldt:base))]" mode="bs2:SearchBar" priority="1">
<form action="" method="get" class="navbar-form pull-left" accept-charset="UTF-8" title="{ac:label(key('resources', 'search-title', document('translations.rdf')))}">
<form action="{ac:absolute-path($ldh:requestUri)}" method="get" class="navbar-form pull-left" accept-charset="UTF-8" title="{ac:label(key('resources', 'search-title', document('translations.rdf')))}">
<div class="input-append">
<select id="search-service" name="service">
<option value="">
Expand Down Expand Up @@ -805,7 +805,7 @@ LIMIT 100
<xsl:param name="typeof" select="key('resources', ac:absolute-path(ldh:base-uri(.)))/rdf:type/@rdf:resource/xs:anyURI(.)" as="xs:anyURI*"/>
<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*"/>
<!-- take care not to load unnecessary documents over HTTP when $doc-types is empty -->
<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 = 'content']/srx:uri/xs:anyURI(.)) else ()) else ()" as="xs:anyURI*"/>
<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*"/>
<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"/>

<div>
Expand All @@ -829,7 +829,7 @@ LIMIT 100
</xsl:apply-templates>

<xsl:choose>
<!-- error responses always rendered in bs2:Block mode, no matter what $ac:mode specifies -->
<!-- error responses always rendered in bs2:Row mode, no matter what $ac:mode specifies -->
<xsl:when test="key('resources-by-type', '&http;Response') and not(key('resources-by-type', '&spin;ConstraintViolation')) and not(key('resources-by-type', '&sh;ValidationResult'))">
<xsl:apply-templates select="." mode="bs2:Row">
<xsl:with-param name="template-query" select="$template-query" tunnel="yes"/>
Expand All @@ -838,13 +838,13 @@ LIMIT 100
</xsl:when>
<!-- check if the current document has content or its class has content -->
<xsl:when test="(empty($ac:mode) and $has-content) or $ac:mode = '&ldh;ContentMode'">
<xsl:apply-templates select="." mode="ldh:ContentList"/>

<xsl:for-each select="$block-values">
<xsl:if test="doc-available(ac:document-uri(.))">
<xsl:apply-templates select="key('resources', ., document(ac:document-uri(.)))" mode="bs2:Row"/>
</xsl:if>
</xsl:for-each>

<xsl:apply-templates select="." mode="ldh:ContentList"/>
</xsl:when>
<xsl:when test="$ac:mode = '&ac;MapMode'">
<xsl:apply-templates select="." mode="bs2:Map">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,6 @@ extension-element-prefixes="ixsl"
</xsl:perform-sort>
</xsl:variable>

<xsl:variable name="this" select="@rdf:about" as="xs:anyURI"/>
<xsl:for-each select="$predicates[@rdf:resource]"> <!-- do not iterate $predicates/@rdf:resource sequence as it will be sorted differently -->
<xsl:apply-templates select="key('resources', @rdf:resource)" mode="bs2:Row"/>
</xsl:for-each>
Expand Down