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)); }