Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -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() { }

/**
Expand All @@ -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().
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://w3id.org/atomgraph/client#GridMode> ] ] .
rdf:_1 [ a ldh:Object ; rdf:value [ a ldh:View ; dct:title "Children view" ; spin:query ldh:SelectChildren ; ac:mode <https://w3id.org/atomgraph/client#GridMode> ] ] .
"""),
Documents.container(TARGET, "Some", null, null, URI.create("https://w3id.org/atomgraph/client#GridMode"), null));
}
Expand Down
Loading