Skip to content

Commit

Permalink
Adding Link header referencing LDP#DirectContainer (fixes https://www…
Browse files Browse the repository at this point in the history
  • Loading branch information
escowles committed Apr 14, 2014
1 parent 95a825e commit 2e8098e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Expand Up @@ -219,6 +219,7 @@ public RdfStream describe(@PathParam("path") final List<PathSegment> pathList,
}
servletResponse.addHeader("Accept-Patch", contentTypeSPARQLUpdate);
servletResponse.addHeader("Link", LDP_NAMESPACE + "Resource;rel=\"type\"");
servletResponse.addHeader("Link", LDP_NAMESPACE + "DirectContainer;rel=\"type\"");

This comment has been minimized.

Copy link
@cbeer

cbeer Apr 14, 2014

Contributor

Are all resources a ldp#directContainer? I guess worst case, we say they are, and explain any CND restrictions in https://www.pivotaltracker.com/story/show/69470740.

This comment has been minimized.

Copy link
@escowles

escowles Apr 14, 2014

Author Contributor

AFAICT, the difference between BasicContainer and DirectContainer is the latter can use custom predicates to link to children, and requires a bunch of triples to be present describing how that works. So I think DirectContainer makes sense for the typical case.

IndirectContainers seem interesting -- using some property or other transform to generate the URIs of child/member resources. I can imagine this being a useful extension somebody might want to add later, but not the default.


addResponseInformationToStream(resource, rdfStream, uriInfo,
subjects);
Expand Down
Expand Up @@ -461,7 +461,8 @@ public String apply(final Header h) {
return h.getValue();
}
});
assertTrue("Didn't find LDP link header!", links.contains(LDP_NAMESPACE + "Resource;rel=\"type\""));
assertTrue("Didn't find LDP resource link header!", links.contains(LDP_NAMESPACE + "Resource;rel=\"type\""));
assertTrue("Didn't find LDP container link header!", links.contains(LDP_NAMESPACE + "DirectContainer;rel=\"type\""));
}

@Test
Expand Down

0 comments on commit 2e8098e

Please sign in to comment.