@@ -52,7 +52,11 @@ extends ThumbnailInference[Rdf, DATASET] {
5252 uri, lang, graph,
5353 hrefPrefix = hrefPrefix,
5454 label = label,
55- sortAnd1rowPerElement = sortAnd1rowPerElement )
55+ sortAnd1rowPerElement = sortAnd1rowPerElement ) ++
56+ separatorSpan ++
57+ makeHyperlinkForURIBriefly(
58+ getClassOrNullURI(uri)(allNamedGraph),
59+ lang)
5660// ++
5761// <div style="font-size:10px; opacity:.8;">{ val uriString = fromUri(uri)
5862// URLEncoder.encode( s"DROP GRAPH <$uriString>", "utf-8") }</div>
@@ -65,14 +69,16 @@ extends ThumbnailInference[Rdf, DATASET] {
6569 sortAnd1rowPerElement = sortAnd1rowPerElement ),
6670 lit => <div >{ lit.toString() }</div >
6771 )
68- }</div > , < span >    </ span > )
72+ }</div > , separatorSpan )
6973 }
7074 }
7175 columnsFormResults
7276 }</div ><!-- end of wrapping div displayResults -->
7377 }
7478
75- /** make HTML hyperlink For given URI;
79+ val separatorSpan = <span >     </span >
80+
81+ /** make HTML hyperlink For given URI, with bells and whistles;
7682 * this links to semantic_forms page for displaying this URI;
7783 * NOTE: this reuses code in Form2HTMLDisplay.createHTMLResourceReadonlyField()
7884 *
@@ -92,6 +98,22 @@ extends ThumbnailInference[Rdf, DATASET] {
9298 property = nullURI, type_ = `type` )
9399 }
94100
101+ def makeHyperlinkForURIBriefly (
102+ node : Rdf # Node ,
103+ lang : String ,
104+ label : String = " " ,
105+ graph : Rdf # Graph = allNamedGraph
106+ ) : NodeSeq = {
107+ val displayLabel =
108+ if ( label != " " )
109+ label
110+ else
111+ makeInstanceLabel(node, graph, lang)
112+ val `type` = getClassOrNullURI(node)(graph)
113+ displayNodeBriefly(uriNodeToURI(node), displayLabel,
114+ property = nullURI, type_ = `type` )
115+ }
116+
95117 /** make HTML hyperlink For given URI;
96118 * this links to semantic_forms page for displaying this URI;
97119 * NOTE: this reuses code in Form2HTMLDisplay.createHTMLResourceReadonlyField()
@@ -112,38 +134,55 @@ extends ThumbnailInference[Rdf, DATASET] {
112134
113135 /** display given URI with bells and whistles,
114136 * implementation: call createHTMLResourceReadonlyField() in trait Form2HTMLDisplay */
115- private def displayNode (uri : Rdf # URI , hrefPrefix : String = config.hrefDisplayPrefix,
116- label : String ,
137+ private def displayNode (uri : Rdf # URI ,
138+ hrefPrefix : String = config.hrefDisplayPrefix,
139+ label : String ,
117140 property : Rdf # URI ,
118141 type_ : Rdf # Node
119142 ): NodeSeq = {
120143 if ( uri != nullURI ) {
144+ val resourceEntry = makeResourceEntry(uri, label, property, type_)
145+
146+ def hyperlink =
147+ if ( hrefPrefix != " " &&
148+ hrefPrefix != config.hrefDisplayPrefix )
149+ < a href= {
150+ createHyperlinkString(hrefPrefix, fromUri(uri), false )
151+ } class = " " title= {s " hyperlink to Triples in Graph at URI < $uri> " }>
152+ { label } </a >
153+ else NodeSeq .Empty
154+
155+ hyperlink ++
156+ createHTMLResourceReadonlyField( resourceEntry, hrefPrefix)
157+ } else
158+ <span >null URI </span >
159+ }
160+
161+ private def displayNodeBriefly (uri : Rdf # URI ,
162+ label : String ,
163+ property : Rdf # URI ,
164+ type_ : Rdf # Node
165+ ): NodeSeq = {
166+ createHTMLResourceReadonlyFieldBriefly(
167+ makeResourceEntry(uri, label, property, type_ ) )
168+ }
169+
170+ private def makeResourceEntry (uri : Rdf # URI ,
171+ label : String ,
172+ property : Rdf # URI ,
173+ type_ : Rdf # Node
174+ ) = {
121175 val fmod = new FormModule [Rdf # Node , Rdf # URI ]{
122- val nullURI = ops.URI (" " )
123- }
124- val types = getClasses(uri)(allNamedGraph)
125- // println(s"==== displayNode: types: $types")
126- val resourceEntry =
127- new fmod.ResourceEntry (
176+ val nullURI = ops.URI (" " )
177+ }
178+ val types = getClasses(uri)(allNamedGraph)
179+ // println(s"==== displayNode: types: $types")
180+ new fmod.ResourceEntry (
128181 valueLabel= label,
129182 property= property,
130183 value= uri,
131184 thumbnail = getURIimage(uri),
132185 type_ = types)
133-
134- def hyperlink =
135- if ( hrefPrefix != " " &&
136- hrefPrefix != config.hrefDisplayPrefix )
137- < a href= {
138- createHyperlinkString(hrefPrefix, fromUri(uri), false )
139- } class = " " title= {s " hyperlink to Triples in Graph at URI < $uri> " }>
140- { label } </a >
141- else NodeSeq .Empty
142-
143- hyperlink ++
144- createHTMLResourceReadonlyField( resourceEntry, hrefPrefix)
145- } else
146- <span >null URI </span >
147186 }
148-
187+
149188}
0 commit comments