public class PropertyToTriple extends Object implements com.google.common.base.Function<javax.jcr.Property,Iterator<com.hp.hpl.jena.graph.Triple>>
|Constructor and Description|
|Modifier and Type||Method and Description|
This nightmare of Java signature verbosity is a curried transformation.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public PropertyToTriple(javax.jcr.Session session, com.google.common.base.Converter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource> graphSubjects)
Converterin order to construct the externally-meaningful RDF subjects of our triples.
graphSubjects- the graph subjects
session- the session
Propertyto an iterator of RDF
Triples. An annoyance: some properties may produce several triples (multi-valued properties). So we cannot find a simple Property to Triple mapping. Instead, we wax clever and offer a function from any specific property to a new function, one that takes multiple values (such as occur in our multi-valued properties) to multiple triples. In other words, this is a function the outputs of which are functions specific to a given JCR property. Each output knows how to take any specific value of its specific property to a triple representing the fact that its specific property obtains that specific value on the node to which that property belongs. All of this is useful because with these operations represented as functions instead of ordinary methods, which may have side-effects, we can use efficient machinery to manipulate iterators of the objects in which we are interested, and that's exactly what we want to do in this class. See
PropertiesRdfContext.triplesFromProperties(org.fcrepo.kernel.models.FedoraResource)for an example of the use of this class with ZippingIterator.
Copyright © 2013–2015 DuraSpace, Inc.. All rights reserved.