public class PrefixingIdentifierTranslator extends IdentifierConverter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource>
IdentifierConverter
which translates JCR paths into Fedora subjects with
a configurable resource namespace (e.g., a baseURL). When a REST API context is available for
constructing URIs, org.fcrepo.http.commons.api.rdf.HttpResourceConverter should be used instead.Modifier and Type | Field and Description |
---|---|
protected com.google.common.base.Converter<String,String> |
forward |
protected com.google.common.base.Converter<String,String> |
reverse |
Constructor and Description |
---|
PrefixingIdentifierTranslator(javax.jcr.Session session,
String resourceNamespace)
Construct the graph with the provided resource namespace, which will translate JCR paths into
URIs prefixed with that namespace.
|
Modifier and Type | Method and Description |
---|---|
String |
asString(com.hp.hpl.jena.rdf.model.Resource subject)
Convert the given resource into a plain string representation of the conversion to the resource
|
protected com.hp.hpl.jena.rdf.model.Resource |
doBackward(FedoraResource resource) |
protected FedoraResource |
doForward(com.hp.hpl.jena.rdf.model.Resource subject) |
boolean |
inDomain(com.hp.hpl.jena.rdf.model.Resource subject)
Check if the given resource is in the domain of this converter
|
com.hp.hpl.jena.rdf.model.Resource |
toDomain(String absPath)
Convert a plain string to a resource appropriate to this converter
|
public PrefixingIdentifierTranslator(javax.jcr.Session session, String resourceNamespace)
session
- Session to lookup nodesresourceNamespace
- Resource namespace (i.e., base URL)protected FedoraResource doForward(com.hp.hpl.jena.rdf.model.Resource subject)
doForward
in class com.google.common.base.Converter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource>
protected com.hp.hpl.jena.rdf.model.Resource doBackward(FedoraResource resource)
doBackward
in class com.google.common.base.Converter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource>
public boolean inDomain(com.hp.hpl.jena.rdf.model.Resource subject)
IdentifierConverter
inDomain
in class IdentifierConverter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource>
subject
- the given resourcepublic com.hp.hpl.jena.rdf.model.Resource toDomain(String absPath)
IdentifierConverter
toDomain
in class IdentifierConverter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource>
absPath
- the plain string resourcepublic String asString(com.hp.hpl.jena.rdf.model.Resource subject)
IdentifierConverter
asString
in class IdentifierConverter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource>
subject
- the given resourceCopyright © 2013–2015 DuraSpace, Inc.. All rights reserved.