From 38351479645a244d3d10b684650a8acd8431581d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Jusevi=C4=8Dius?= Date: Wed, 21 Oct 2026 11:53:17 +0200 Subject: [PATCH] A container's children view in a layout mode is titled ldh create container --mode makes the first block a new ldh:View of ldh:SelectChildren in that mode. It had no title, so the client headed the block with the ID the server mints for the blank node (idb4879f40-4403-...). It is now titled "Children view", the label of ldh:ChildrenView, which the default container shows. Co-Authored-By: Claude Opus 5.5 --- .../java/com/atomgraph/linkeddatahub/rdf/Documents.java | 6 ++++++ .../com/atomgraph/linkeddatahub/rdf/ModelBuildersTest.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rdf/src/main/java/com/atomgraph/linkeddatahub/rdf/Documents.java b/rdf/src/main/java/com/atomgraph/linkeddatahub/rdf/Documents.java index 5912db4f8..38decbeea 100644 --- a/rdf/src/main/java/com/atomgraph/linkeddatahub/rdf/Documents.java +++ b/rdf/src/main/java/com/atomgraph/linkeddatahub/rdf/Documents.java @@ -36,6 +36,9 @@ public final class Documents { + /** The title of a children view made in a layout mode: the label of ldh:ChildrenView. */ + public static final String CHILDREN_VIEW_TITLE = "Children view"; + private Documents() { } /** @@ -59,10 +62,13 @@ public static Model container(URI doc, String title, String description, URI blo addProperty(DCTerms.title, title); if (block != null) container.addProperty(RDF.li(1), model.createResource(block.toString())); + // the children view in another layout: titled as ldh:ChildrenView is labelled, which a client shows + // as the block's heading - untitled, it fell back to the ID the server mints for the blank node else if (mode != null) container.addProperty(RDF.li(1), model.createResource(). addProperty(RDF.type, LDH.Object). addProperty(RDF.value, model.createResource(). addProperty(RDF.type, LDH.View). + addProperty(DCTerms.title, CHILDREN_VIEW_TITLE). addProperty(SPIN.query, LDH.SelectChildren). addProperty(AC.mode, model.createResource(mode.toString())))); else container.addProperty(RDF.li(1), model.createResource(). diff --git a/rdf/src/test/java/com/atomgraph/linkeddatahub/rdf/ModelBuildersTest.java b/rdf/src/test/java/com/atomgraph/linkeddatahub/rdf/ModelBuildersTest.java index 9ff9eeb0d..592cdd56f 100644 --- a/rdf/src/test/java/com/atomgraph/linkeddatahub/rdf/ModelBuildersTest.java +++ b/rdf/src/test/java/com/atomgraph/linkeddatahub/rdf/ModelBuildersTest.java @@ -126,7 +126,7 @@ public void createContainerWithMode() assertIsomorphic(parse(""" <> a dh:Container ; dct:title "Some" ; - rdf:_1 [ a ldh:Object ; rdf:value [ a ldh:View ; spin:query ldh:SelectChildren ; ac:mode ] ] . + rdf:_1 [ a ldh:Object ; rdf:value [ a ldh:View ; dct:title "Children view" ; spin:query ldh:SelectChildren ; ac:mode ] ] . """), Documents.container(TARGET, "Some", null, null, URI.create("https://w3id.org/atomgraph/client#GridMode"), null)); }