Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Commit 3fabd29

Browse files
committed
Removed unneeded ldp:insertedContentRelation checks as almost
never reach this condition. Closes #213
1 parent 4890847 commit 3fabd29

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/main/java/org/w3/ldp/testsuite/test/LdpTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -233,19 +233,19 @@ protected Model getDefaultModel() {
233233
return model;
234234
}
235235

236+
/**
237+
* Given the location (URI), locate the appropriate "primary" resource within
238+
* the model. Often models will have many triples with various subjects, which
239+
* don't always match the request-URI. This attempts to resolve to the appropriate
240+
* resource for the request-URI. This method is used to determine which subject
241+
* URI should be used to assign new triples to for tests such as PUT.
242+
*
243+
* @param model
244+
* @param location
245+
* @return
246+
*/
236247
protected Resource getPrimaryTopic(Model model, String location) {
237248
Resource loc = model.getResource(location);
238-
Property insertedContentRelation = model.getProperty(LDP.insertedContentRelation.stringValue());
239-
NodeIterator relations = model.listObjectsOfProperty(loc, insertedContentRelation);
240-
if (relations.hasNext()) {
241-
String relation = relations.next().toString();
242-
if (LDP.MemberSubject.stringValue().equals(relation)) {
243-
return loc;
244-
} else {
245-
Property primaryTopic = model.getProperty(relation);
246-
return model.listObjectsOfProperty(loc, primaryTopic).next().asResource();
247-
}
248-
}
249249
ResIterator bugs = model.listSubjectsWithProperty(RDF.type, model.createResource(DEFAULT_MODEL_TYPE));
250250
if (bugs.hasNext()) {
251251
return bugs.nextResource();

0 commit comments

Comments
 (0)