public class JcrRdfTools extends Object
| Modifier and Type | Field and Description |
|---|---|
static com.google.common.base.Function<javax.jcr.Property,com.hp.hpl.jena.rdf.model.Property> |
getPredicateForProperty
Map a JCR property to an RDF property with the right namespace URI and
local name
|
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(org.fcrepo.kernel.rdf.IdentifierTranslator graphSubjects)
Factory method to create a new JcrRdfTools utility with a graph subjects
converter
|
JcrRdfTools(org.fcrepo.kernel.rdf.IdentifierTranslator graphSubjects,
javax.jcr.Session session)
Factory method to create a new JcrRdfTools utility with a graph subjects
converter
|
JcrRdfTools(org.fcrepo.kernel.rdf.IdentifierTranslator graphSubjects,
javax.jcr.Session session,
LowLevelStorageService lls)
Contructor with even more context.
|
| Modifier and Type | Method and Description |
|---|---|
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
|
javax.jcr.Value |
createValue(com.hp.hpl.jena.rdf.model.RDFNode data)
Create a JCR value (with an undefined type) from a RDFNode
|
javax.jcr.Value |
createValue(com.hp.hpl.jena.rdf.model.RDFNode data,
int type)
Create a JCR value from an RDFNode with the given JCR type
|
javax.jcr.Value |
createValue(javax.jcr.ValueFactory valueFactory,
com.hp.hpl.jena.rdf.model.RDFNode data,
int type)
Create a JCR value from an RDF node with the given JCR type
|
static String |
getJcrNamespaceForRDFNamespace(String rdfNamespaceUri)
Convert a Fedora RDF Namespace into its JCR equivalent
|
org.fcrepo.kernel.utils.iterators.RdfStream |
getJcrPropertiesModel(Iterator<javax.jcr.Node> nodeIterator,
com.hp.hpl.jena.rdf.model.Resource iteratorSubject)
Get an
RdfStream for the given JCR NodeIterator |
org.fcrepo.kernel.utils.iterators.RdfStream |
getJcrTriples(javax.jcr.Node node)
Get an
RdfStream for a node that includes all its own JCR properties,
as well as the properties of its immediate children. |
org.fcrepo.kernel.utils.iterators.RdfStream |
getJcrTriples(javax.jcr.Node node,
Iterable<org.fcrepo.kernel.utils.FixityResult> blobs)
Serialize the JCR fixity information in an
RdfStream |
org.fcrepo.kernel.utils.iterators.RdfStream |
getNamespaceTriples()
Get an
RdfStream of the registered JCR namespaces |
static com.hp.hpl.jena.rdf.model.Model |
getProblemsModel()
Get a model in which to collect statements of RDF extraction problems
|
String |
getPropertyNameFromPredicate(org.modeshape.jcr.api.NamespaceRegistry namespaceRegistry,
com.hp.hpl.jena.rdf.model.Property predicate,
Map<String,String> namespaceMapping)
Get the JCR property name for an RDF predicate
|
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
|
String |
getPropertyNameFromPredicate(javax.jcr.Node node,
com.hp.hpl.jena.rdf.model.Property predicate,
Map<String,String> namespaceMapping)
Given an RDF predicate value (namespace URI + local name), figure out
what JCR property to use
|
String |
getPropertyNameFromPredicate(com.hp.hpl.jena.rdf.model.Property predicate)
Get a property name for an RDF predicate
|
String |
getPropertyNameFromPredicate(com.hp.hpl.jena.rdf.model.Property predicate,
Map<String,String> namespaceMapping)
Get the property name for an RDF predicate
|
int |
getPropertyType(javax.jcr.nodetype.NodeType nodeType,
String propertyName)
Given a node type and a property name, figure out an appropraite jcr value type
|
int |
getPropertyType(String nodeType,
String propertyName)
Given a node type and a property name, figure out an appropriate jcr value type
|
static String |
getRDFNamespaceForJcrNamespace(String jcrNamespaceUri)
Convert a JCR namespace into an RDF namespace fit for downstream
consumption.
|
org.fcrepo.kernel.utils.iterators.RdfStream |
getTreeTriples(javax.jcr.Node node)
Add the properties of a Node's parent and immediate children using the default
serialization options
|
org.fcrepo.kernel.utils.iterators.RdfStream |
getTreeTriples(javax.jcr.Node node,
org.fcrepo.kernel.rdf.HierarchyRdfContextOptions options)
Add the properties of a Node's parent and immediate children (as well as
the jcr:content of children) to the given
RdfStream |
org.fcrepo.kernel.utils.iterators.RdfStream |
getVersionTriples(javax.jcr.Node node)
Get an
RdfStream for the JCR version history information for a node |
org.fcrepo.kernel.utils.iterators.RdfStream |
getWorkspaceTriples(org.fcrepo.kernel.rdf.IdentifierTranslator subjects)
Get an
RdfStream of the registered JCR workspaces |
static boolean |
isContainer(javax.jcr.Node node)
Decides whether the RDF representation of this
Node will receive LDP Container status. |
boolean |
isInternalProperty(javax.jcr.Node subjectNode,
com.hp.hpl.jena.rdf.model.Resource predicate)
Determine if a predicate is an internal property of a node (and should
not be modified from external sources)
|
void |
setLlstore(LowLevelStorageService lowLevelStorageService)
Set the Low-level storage server implementation
|
static JcrRdfTools |
withContext(org.fcrepo.kernel.rdf.IdentifierTranslator graphSubjects)
Factory method to create a new JcrRdfTools instance
|
static JcrRdfTools |
withContext(org.fcrepo.kernel.rdf.IdentifierTranslator idTranslator,
javax.jcr.Session session)
Factory method to create a new JcrRdfTools instance
|
static JcrRdfTools |
withContext(org.fcrepo.kernel.rdf.IdentifierTranslator graphSubjects,
javax.jcr.Session session,
LowLevelStorageService lls)
Factory method to create a new JcrRdfTools instance with full context.
|
JcrRdfTools |
withSession(javax.jcr.Session session)
Using the same graph subjects, create a new JcrRdfTools with the given
session
|
public static com.google.common.collect.BiMap<String,String> jcrNamespacesToRDFNamespaces
public static com.google.common.collect.BiMap<String,String> rdfNamespacesToJcrNamespaces
public static com.google.common.base.Function<javax.jcr.Property,com.hp.hpl.jena.rdf.model.Property> getPredicateForProperty
public JcrRdfTools(org.fcrepo.kernel.rdf.IdentifierTranslator graphSubjects)
graphSubjects - public JcrRdfTools(org.fcrepo.kernel.rdf.IdentifierTranslator graphSubjects,
javax.jcr.Session session)
graphSubjects - session - public JcrRdfTools(org.fcrepo.kernel.rdf.IdentifierTranslator graphSubjects,
javax.jcr.Session session,
LowLevelStorageService lls)
graphSubjects - session - lls - public static JcrRdfTools withContext(org.fcrepo.kernel.rdf.IdentifierTranslator graphSubjects)
graphSubjects - public static JcrRdfTools withContext(org.fcrepo.kernel.rdf.IdentifierTranslator idTranslator, javax.jcr.Session session)
graphSubjects - session - public static JcrRdfTools withContext(org.fcrepo.kernel.rdf.IdentifierTranslator graphSubjects, javax.jcr.Session session, LowLevelStorageService lls)
graphSubjects - session - lls - 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.Model getProblemsModel()
public JcrRdfTools withSession(javax.jcr.Session session)
session - public org.fcrepo.kernel.utils.iterators.RdfStream getJcrPropertiesModel(Iterator<javax.jcr.Node> nodeIterator, com.hp.hpl.jena.rdf.model.Resource iteratorSubject) throws javax.jcr.RepositoryException
RdfStream for the given JCR NodeIteratornodeIterator - iteratorSubject - javax.jcr.RepositoryExceptionpublic org.fcrepo.kernel.utils.iterators.RdfStream getJcrTriples(javax.jcr.Node node)
throws javax.jcr.RepositoryException
RdfStream for a node that includes all its own JCR properties,
as well as the properties of its immediate children. TODO add triples for
root node, ala addRepositoryMetricsToModel()node - javax.jcr.RepositoryExceptionpublic org.fcrepo.kernel.utils.iterators.RdfStream getVersionTriples(javax.jcr.Node node)
throws javax.jcr.RepositoryException
RdfStream for the JCR version history information for a nodenode - javax.jcr.RepositoryExceptionpublic org.fcrepo.kernel.utils.iterators.RdfStream getJcrTriples(javax.jcr.Node node,
Iterable<org.fcrepo.kernel.utils.FixityResult> blobs)
throws javax.jcr.RepositoryException
RdfStreamnode - blobs - javax.jcr.RepositoryExceptionpublic org.fcrepo.kernel.utils.iterators.RdfStream getNamespaceTriples()
throws javax.jcr.RepositoryException
RdfStream of the registered JCR namespacesjavax.jcr.RepositoryExceptionpublic org.fcrepo.kernel.utils.iterators.RdfStream getWorkspaceTriples(org.fcrepo.kernel.rdf.IdentifierTranslator subjects)
throws javax.jcr.RepositoryException
RdfStream of the registered JCR workspacesjavax.jcr.RepositoryExceptionpublic org.fcrepo.kernel.utils.iterators.RdfStream getTreeTriples(javax.jcr.Node node,
org.fcrepo.kernel.rdf.HierarchyRdfContextOptions options)
throws javax.jcr.RepositoryException
RdfStreamnode - javax.jcr.RepositoryExceptionpublic org.fcrepo.kernel.utils.iterators.RdfStream getTreeTriples(javax.jcr.Node node)
throws javax.jcr.RepositoryException
node - javax.jcr.RepositoryExceptionpublic static boolean isContainer(javax.jcr.Node node)
throws javax.jcr.RepositoryException
Node will receive LDP Container status.node - javax.jcr.RepositoryExceptionpublic boolean isInternalProperty(javax.jcr.Node subjectNode,
com.hp.hpl.jena.rdf.model.Resource predicate)
subjectNode - predicate - public 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 javax.jcr.Value createValue(com.hp.hpl.jena.rdf.model.RDFNode data)
throws javax.jcr.RepositoryException
data - javax.jcr.RepositoryExceptionpublic javax.jcr.Value createValue(com.hp.hpl.jena.rdf.model.RDFNode data,
int type)
throws javax.jcr.RepositoryException
data - type - javax.jcr.RepositoryExceptionpublic javax.jcr.Value createValue(javax.jcr.ValueFactory valueFactory,
com.hp.hpl.jena.rdf.model.RDFNode data,
int type)
throws javax.jcr.RepositoryException
valueFactory - data - type - javax.jcr.RepositoryExceptionpublic 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 String getPropertyNameFromPredicate(javax.jcr.Node node, com.hp.hpl.jena.rdf.model.Property predicate, Map<String,String> namespaceMapping) throws javax.jcr.RepositoryException
node - the JCR node we want a property forpredicate - the predicate to map to a property namenamespaceMapping - prefix => uri namespace mappingjavax.jcr.RepositoryExceptionpublic String getPropertyNameFromPredicate(com.hp.hpl.jena.rdf.model.Property predicate, Map<String,String> namespaceMapping) throws javax.jcr.RepositoryException
predicate - namespaceMapping - javax.jcr.RepositoryExceptionpublic String getPropertyNameFromPredicate(com.hp.hpl.jena.rdf.model.Property predicate) throws javax.jcr.RepositoryException
predicate - javax.jcr.RepositoryExceptionpublic String getPropertyNameFromPredicate(org.modeshape.jcr.api.NamespaceRegistry namespaceRegistry, com.hp.hpl.jena.rdf.model.Property predicate, Map<String,String> namespaceMapping) throws javax.jcr.RepositoryException
namespaceRegistry - predicate - namespaceMapping - javax.jcr.RepositoryExceptionpublic void setLlstore(LowLevelStorageService lowLevelStorageService)
public int getPropertyType(String nodeType, String propertyName) throws javax.jcr.RepositoryException
nodeType - propertyName - javax.jcr.RepositoryExceptionpublic int getPropertyType(javax.jcr.nodetype.NodeType nodeType,
String propertyName)
nodeType - propertyName - Copyright © 2013–2014 DuraSpace, Inc.. All rights reserved.