Skip to content

Commit

Permalink
awoods code review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Woods committed May 4, 2014
1 parent 9caddef commit fe3628d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
32 changes: 16 additions & 16 deletions fcrepo-kernel/src/main/java/org/fcrepo/kernel/rdf/JcrRdfTools.java
Expand Up @@ -152,7 +152,7 @@ public static JcrRdfTools withContext(final IdentifierTranslator graphSubjects)
/**
* Factory method to create a new JcrRdfTools instance
*
* @param graphSubjects
* @param idTranslator
* @param session
* @return
*/
Expand Down Expand Up @@ -506,9 +506,9 @@ public String getPropertyNameFromPredicate(final Node node, final com.hp.hpl.jen
getNamespaceRegistry.apply(node);

return getJcrNameForRdfNode(namespaceRegistry,
predicate.getNameSpace(),
predicate.getLocalName(),
namespaceMapping);
predicate.getNameSpace(),
predicate.getLocalName(),
namespaceMapping);
}

/**
Expand All @@ -525,9 +525,9 @@ public String getPropertyNameFromPredicate(final com.hp.hpl.jena.rdf.model.Prope

final Map<String, String> namespaceMapping = emptyMap();
return getJcrNameForRdfNode(namespaceRegistry,
predicate.getNameSpace(),
predicate.getLocalName(),
namespaceMapping);
predicate.getNameSpace(),
predicate.getLocalName(),
namespaceMapping);
}

/**
Expand All @@ -543,25 +543,25 @@ public String getPropertyNameFromPredicate(final Node node,
final Map<String,String> namespaces) throws RepositoryException {
final NamespaceRegistry namespaceRegistry = getNamespaceRegistry.apply(node);
return getJcrNameForRdfNode(namespaceRegistry,
resource.getNameSpace(),
resource.getLocalName(),
namespaces);
resource.getNameSpace(),
resource.getLocalName(),
namespaces);
}

/**
* Get the JCR property name for an RDF predicate
*
* @param namespaceRegistry
* @param namespace
* @param localname
* @param rdfNamespace
* @param rdfLocalname
* @param namespaceMapping
* @return
* @throws RepositoryException
*/
public String getJcrNameForRdfNode(final NamespaceRegistry namespaceRegistry,
final String rdfNamespace,
final String rdfLocalname,
final Map<String, String> namespaceMapping)
private String getJcrNameForRdfNode(final NamespaceRegistry namespaceRegistry,
final String rdfNamespace,
final String rdfLocalname,
final Map<String, String> namespaceMapping)
throws RepositoryException {

final String prefix;
Expand Down
Expand Up @@ -74,15 +74,13 @@ protected void operateOnMixin(final Resource mixinResource,
}

if (subjectNode.canAddMixin(mixinName)) {
LOGGER.debug("Adding mixin: {} to node: {}.", mixinName,
subjectNode.getPath());
LOGGER.debug("Adding mixin: {} to node: {}.", mixinName, subjectNode.getPath());
subjectNode.addMixin(mixinName);
} else {
throw new MalformedRdfException(
"Could not persist triple containing type assertion:"
+ mixinResource.toString()
+ " because no such mixin/type can be added to this node: "
+ subjectNode.getPath() + "!");
throw new MalformedRdfException("Could not persist triple containing type assertion: "
+ mixinResource.toString()
+ " because no such mixin/type can be added to this node: "
+ subjectNode.getPath() + "!");
}
}

Expand Down

0 comments on commit fe3628d

Please sign in to comment.