public abstract class JcrRdfTools extends Object
| Modifier and Type | Field and Description |
|---|---|
static com.google.common.collect.BiMap<String,String> |
jcrNamespacesToRDFNamespaces
A map of JCR namespaces to Fedora's RDF namespaces
|
static com.google.common.collect.BiMap<String,String> |
rdfNamespacesToJcrNamespaces
A map of Fedora's RDF namespaces to the JCR equivalent
|
| Constructor and Description |
|---|
JcrRdfTools() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addPropertyToModel(com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.rdf.model.Model model,
javax.jcr.Property property)
Add a JCR property to the given RDF Model (with the given subject)
|
static void |
addPropertyToModel(com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.rdf.model.Model model,
javax.jcr.Property property,
javax.jcr.Value v)
Add a JCR property to the given RDF Model (with the given subject)
|
static javax.jcr.Value |
createValue(javax.jcr.Node node,
com.hp.hpl.jena.rdf.model.RDFNode data,
int type)
Create a JCR value from an RDFNode, either by using the given JCR
PropertyType or by looking at the RDFNode Datatype
|
static com.hp.hpl.jena.rdf.model.Model |
getFixityResultsModel(GraphSubjects factory,
javax.jcr.Node node,
Iterable<FixityResult> blobs)
Serialize the JCR fixity information in a Jena Model
|
static com.hp.hpl.jena.rdf.model.Resource |
getGraphSubject(GraphSubjects factory,
javax.jcr.Node node)
Translate a JCR node into an RDF Resource
|
static String |
getJcrNamespaceForRDFNamespace(String rdfNamespaceUri)
Convert a Fedora RDF Namespace into its JCR equivalent
|
static com.hp.hpl.jena.rdf.model.Model |
getJcrNamespaceModel(javax.jcr.Session session)
Get an RDF model of the registered JCR namespaces
|
static com.hp.hpl.jena.rdf.model.Model |
getJcrNodeIteratorModel(GraphSubjects factory,
Iterator<javax.jcr.Node> nodeIterator,
com.hp.hpl.jena.rdf.model.Resource iteratorSubject)
Get an RDF model for the given JCR NodeIterator
|
static com.hp.hpl.jena.rdf.model.Model |
getJcrPropertiesModel(GraphSubjects factory,
javax.jcr.Node node)
Get an RDF Model for a node that includes all its own JCR properties,
as well as the properties of its
immediate children.
|
static com.hp.hpl.jena.rdf.model.Model |
getJcrTreeModel(GraphSubjects factory,
javax.jcr.Node node,
long offset,
int limit)
Add the properties of a Node's parent and immediate children
(as well as the jcr:content of children) to the given
RDF model
|
static com.hp.hpl.jena.rdf.model.Model |
getJcrVersionsModel(GraphSubjects factory,
javax.jcr.Node node)
Get a Jena RDF model for the JCR version history information for a node
|
static javax.jcr.Node |
getNodeFromGraphSubject(GraphSubjects factory,
javax.jcr.Session session,
com.hp.hpl.jena.rdf.model.Resource subject)
Translate an RDF resource into a JCR node
|
static String |
getPropertyNameFromPredicate(javax.jcr.Node node,
com.hp.hpl.jena.rdf.model.Property predicate)
Given an RDF predicate value (namespace URI + local name), figure out
what JCR property to use
|
static String |
getRDFNamespaceForJcrNamespace(String jcrNamespaceUri)
Convert a JCR namespace into an RDF namespace fit for downstream
consumption.
|
static boolean |
isFedoraGraphSubject(GraphSubjects factory,
com.hp.hpl.jena.rdf.model.Resource subject)
Predicate for determining whether this
Node is a Fedora object. |
static void |
setGetClusterConfiguration(GetClusterConfiguration getClusterConfiguration)
Set the function used to get the cluster configuration for Infinispan
|
static void |
setLlstore(LowLevelStorageService lowLevelStorageService)
Set the Low-level storage server implementation
|
public static com.google.common.collect.BiMap<String,String> jcrNamespacesToRDFNamespaces
public static String getJcrNamespaceForRDFNamespace(String rdfNamespaceUri)
rdfNamespaceUri - a namespace from an RDF documentpublic static String getRDFNamespaceForJcrNamespace(String jcrNamespaceUri)
jcrNamespaceUri - a namespace from the JCR NamespaceRegistrypublic static com.hp.hpl.jena.rdf.model.Resource getGraphSubject(GraphSubjects factory, javax.jcr.Node node) throws javax.jcr.RepositoryException
node - javax.jcr.RepositoryExceptionpublic static javax.jcr.Node getNodeFromGraphSubject(GraphSubjects factory, javax.jcr.Session session, com.hp.hpl.jena.rdf.model.Resource subject) throws javax.jcr.RepositoryException
session - subject - an RDF URI resourcejavax.jcr.RepositoryExceptionpublic static boolean isFedoraGraphSubject(GraphSubjects factory, com.hp.hpl.jena.rdf.model.Resource subject)
Node is a Fedora object.public static com.hp.hpl.jena.rdf.model.Model getJcrNamespaceModel(javax.jcr.Session session)
throws javax.jcr.RepositoryException
session - javax.jcr.RepositoryExceptionpublic static com.hp.hpl.jena.rdf.model.Model getJcrNodeIteratorModel(GraphSubjects factory, Iterator<javax.jcr.Node> nodeIterator, com.hp.hpl.jena.rdf.model.Resource iteratorSubject) throws javax.jcr.RepositoryException
factory - nodeIterator - iteratorSubject - javax.jcr.RepositoryExceptionpublic static com.hp.hpl.jena.rdf.model.Model getJcrPropertiesModel(GraphSubjects factory, javax.jcr.Node node) throws javax.jcr.RepositoryException
node - javax.jcr.RepositoryExceptionpublic static com.hp.hpl.jena.rdf.model.Model getJcrTreeModel(GraphSubjects factory, javax.jcr.Node node, long offset, int limit) throws javax.jcr.RepositoryException
node - offset - limit - @throws RepositoryExceptionjavax.jcr.RepositoryExceptionpublic static javax.jcr.Value createValue(javax.jcr.Node node,
com.hp.hpl.jena.rdf.model.RDFNode data,
int type)
throws javax.jcr.RepositoryException
data - an RDF Node (possibly with a DataType)type - a JCR PropertyType valuejavax.jcr.RepositoryExceptionpublic static void addPropertyToModel(com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.rdf.model.Model model,
javax.jcr.Property property)
throws javax.jcr.RepositoryException
subject - the RDF subject to use in the assertionsmodel - the RDF graph to insert the triple intoproperty - the JCR property (multivalued or not) to convert to
triplesjavax.jcr.RepositoryExceptionpublic static void addPropertyToModel(com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.rdf.model.Model model,
javax.jcr.Property property,
javax.jcr.Value v)
throws javax.jcr.RepositoryException
subject - the RDF subject to use in the assertionsmodel - the RDF graph to insert the triple intoproperty - the JCR property (multivalued or not) to convert to
triplesv - the actual JCR Value to insert into the graphjavax.jcr.RepositoryExceptionpublic static String getPropertyNameFromPredicate(javax.jcr.Node node, com.hp.hpl.jena.rdf.model.Property predicate) throws javax.jcr.RepositoryException
node - the JCR node we want a property forpredicate - the predicate to map to a property namejavax.jcr.RepositoryExceptionpublic static com.hp.hpl.jena.rdf.model.Model getJcrVersionsModel(GraphSubjects factory, javax.jcr.Node node) throws javax.jcr.RepositoryException
factory - node - javax.jcr.RepositoryExceptionpublic static com.hp.hpl.jena.rdf.model.Model getFixityResultsModel(GraphSubjects factory, javax.jcr.Node node, Iterable<FixityResult> blobs) throws javax.jcr.RepositoryException
factory - node - blobs - javax.jcr.RepositoryExceptionpublic static void setGetClusterConfiguration(GetClusterConfiguration getClusterConfiguration)
public static void setLlstore(LowLevelStorageService lowLevelStorageService)
Copyright © 2013 DuraSpace, Inc.. All Rights Reserved.