Skip to main content

Resource Data Model

Abstract

Resource Data Model

For the resource page the following data model is in place:

Key

Type

Description

projectId

String

The project ID as specified on project creation, appended to the base URL this forms the project URI

repositoryId

String

The internal repository ID belonging to the project

resource

String

The URI of the resource as String.

view

String

The requested view on the resource. (e.g. html)

projectName

String

Internal project name as displayed in the PoolParty backend.

project

ResourceBean

A resource bean holding all project information as VoiD RDF.

prefLabel

String

Preferred label of the resource in projects default language.

data

Map

A nested map structure holding all triples with the resource URI as subject.

labels

Map

A map of type <String, String>,

holding all localized labels for properties. The key is the property URI from the "data" structure.

associatedLabels

Map

A map of type <Resource, List<Literal>>,

holding all preferred labels of associated concepts. The key is the URI of the associated concept.

namespaces

List

A list of org.openrdf.model.Namespace objects that are configured for this PoolParty installation.

The namespaces are loaded from the namespaces.ttl file in the resourceRoot.

frontend

FrontendSetup

A bean of type at.punkt.PoolParty.Configuration.frontend.FrontendSetup

holding the frontend configuration (access level, tabs, etc.) of this installation.

request

HttpServletRequest

The HttpServletRequest object of the current request.

Example

This is the code of the content of the default resource page (resource/html.vm).

                <div class="yui-content">
                    <div id="tab0">
                        <div class="onecol" about="$resource">
                            <h2><a class="hiddenLink" href="$resource"></a></h2>
                            <ul>
                                #foreach ( $entry in $data.default.entrySet() )
                                    <li class="propertyname">
                                    <h4><a class="hiddenLink" href="$entry.key" target="_blank">$labels.getString($entry.key)</a></h4>
                                        <hr/>
                                        <ul>
                                        #foreach ( $value in $entry.value )
                                            <li class="propertyvalue">$tools.rdfa.print($value, $entry.key, $namespaces)</li>
                                        #end
                                        </ul>
                                    </li>
                                #end
                            </ul>
                            <span style="display:none;" about="subj"></span>
                        </div>
                        #foreach ($graph in $data.entrySet() )
                            <br/>
                               #if ( $graph.key != 'default' )
                                <div class="onecol" about="$resource">
                                    <h2>$graph.key</h2>
                                        #foreach ( $entry in $data.get($graph.key).entrySet() )
                                        <li class="propertyname">
                                            <h4><a class="hiddenLink" href="$entry.key" target="_blank">$labels.get($entry.key)</a></h4>
                                            <hr/>
                                            <ul>
                                                #foreach ( $value in $entry.value )
                                                    <li class="propertyvalue">$tools.rdfa.print($value,$entry.key,$namespaces)</li>
                                                    #if ( $entry.key == 'http://dbpedia.org/ontology/thumbnail' )
                                                      <img alt="thumbnail" src="$value"/>
                                                    #end
                                            #end
                                        </ul>
                                        </li>
                                        #end
                                </div>
                             #end
                      #end
                    </div>
                </div>
            </div>