Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow updates to fcr:metadata
  • Loading branch information
escowles authored and Andrew Woods committed Nov 4, 2015
1 parent 55efb20 commit 84c12da
Show file tree
Hide file tree
Showing 2 changed files with 10 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 @@ -16,9 +16,12 @@
package org.fcrepo.kernel.modeshape.utils.iterators;

import static com.hp.hpl.jena.rdf.model.ModelFactory.createDefaultModel;
import static com.hp.hpl.jena.rdf.model.ResourceFactory.createResource;
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.modeshape.utils.FedoraTypesUtils.isFedoraBinary;
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 +99,10 @@ 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)
&& isFedoraBinary.test(translator().convert(createResource(subject.getURI())).getNode())) {
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 84c12da

Please sign in to comment.