Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ajs6f committed Oct 29, 2013
1 parent 123aa78 commit d07d83b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions fcrepo-kernel/src/main/java/org/fcrepo/kernel/RdfLexicon.java
Expand Up @@ -39,8 +39,12 @@ public final class RdfLexicon {
public static final String REPOSITORY_NAMESPACE =
"http://fedora.info/definitions/v4/repository#";

/**
* The core JCR namespace.
*/
public static final String JCR_NAMESPACE = "http://www.jcp.org/jcr/1.0";


/**
* REST API namespace "fedora", used for internal API links and node
* paths.
Expand All @@ -49,6 +53,18 @@ public final class RdfLexicon {
public static final String RESTAPI_NAMESPACE =
"http://fedora.info/definitions/v4/rest-api#";

/**
* The namespaces that the repository manages internally.
*/
public static final Set<String> managedNamespaces = of(RESTAPI_NAMESPACE,
REPOSITORY_NAMESPACE, JCR_NAMESPACE);

/**
* Is this namespace one that the repository manages?
*/
public static final Predicate<String> isManagedNamespace =
in(managedNamespaces);

/**
* Relations (RELS-EXT) namespace "fedorarelsext", used for linking
* between Fedora objects.
Expand Down
Expand Up @@ -22,7 +22,7 @@
import static com.google.common.collect.Iterators.filter;
import static com.hp.hpl.jena.rdf.model.ModelFactory.createDefaultModel;
import static com.hp.hpl.jena.vocabulary.RDF.type;
import static org.fcrepo.kernel.RdfLexicon.RESTAPI_NAMESPACE;
import static org.fcrepo.kernel.RdfLexicon.isManagedNamespace;
import static org.fcrepo.kernel.utils.JcrRdfTools.getJcrNamespaceForRDFNamespace;
import static org.fcrepo.kernel.utils.iterators.UnmanagedRdfStream.isManagedTriple;
import static org.slf4j.LoggerFactory.getLogger;
Expand Down Expand Up @@ -129,7 +129,7 @@ protected void operateOnTriple(final Statement t)
// mixins. If it isn't, treat it as a "data" property.
if (t.getPredicate().equals(type) && t.getObject().isResource()) {
final Resource mixinResource = t.getObject().asResource();
if (!mixinResource.getNameSpace().equals(RESTAPI_NAMESPACE)) {
if (!isManagedNamespace.apply(mixinResource.getNameSpace())) {
LOGGER.debug("Operating on node: {} with mixin: {}.",
subjectNode, mixinResource);
operateOnMixin(mixinResource, subjectNode);
Expand Down

0 comments on commit d07d83b

Please sign in to comment.