Skip to content

Commit

Permalink
Allowing updates to fcr:metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
escowles committed Nov 2, 2015
1 parent 9d28989 commit ecbb943
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -1326,7 +1326,9 @@ public void testRoundTripReplaceGraphForDatastreamDescription() throws IOExcepti
final HttpPut replaceMethod = new HttpPut(subjectURI + "/" + FCR_METADATA);
try (final StringWriter w = new StringWriter()) {
model.write(w, "N-TRIPLE");
replaceMethod.setEntity(new StringEntity(w.toString()));
final String updatedMetadata = w.toString() +
"<" + subjectURI + "> <http://www.w3.org/2000/01/rdf-schema#label> 'foo' .";
replaceMethod.setEntity(new StringEntity(updatedMetadata));
logger.trace("Transmitting object graph for testRoundTripReplaceGraphForDatastream():\n {}", w);
}
replaceMethod.addHeader("Content-Type", "application/n-triples");
Expand Down
Expand Up @@ -19,6 +19,7 @@
import static com.hp.hpl.jena.vocabulary.RDF.type;
import static java.lang.String.join;
import static org.fcrepo.kernel.modeshape.rdf.ManagedRdf.isManagedMixin;
import static org.fcrepo.kernel.api.FedoraJcrTypes.FCR_METADATA;
import static org.slf4j.LoggerFactory.getLogger;

import org.fcrepo.kernel.api.models.FedoraResource;
Expand Down Expand Up @@ -96,6 +97,9 @@ public PersistingRdfStreamConsumer(final IdentifierConverter<Resource, FedoraRes
|| topic.equals(subject)) {
LOGGER.debug("Discovered a Fedora-relevant subject in triple: {}.", t);
return true;
} else if (topic.getURI().equals(subject.getURI() + "/" + FCR_METADATA)) {

This comment has been minimized.

Copy link
@lsitu

lsitu Nov 2, 2015

Contributor

@escowles Thank you very much for working on it. What does NonRDFSource mean in this context? Should fcr:metadata be restricted to fedora:binary type or not?

This comment has been minimized.

Copy link
@escowles

escowles Nov 3, 2015

Author Contributor

That's a good point -- I've updated #937 with a check to make sure the parent is actually a binary.

LOGGER.debug("Discovered a NonRDFSource subject in triple: {}.", t);
return true;
}
// the subject was inappropriate in one of two ways
if (translator().inDomain(m.asRDFNode(subject).asResource())) {
Expand Down

0 comments on commit ecbb943

Please sign in to comment.