public class ViewHelpers extends Object
| Modifier | Constructor and Description | 
|---|---|
| protected  | ViewHelpers() | 
| Modifier and Type | Method and Description | 
|---|---|
| int | addOne(int i)Yes, we really did create a method to increment
 a given int. | 
| com.hp.hpl.jena.graph.Node | asLiteralStringNode(String r)Convert a URI string to an RDF node | 
| com.hp.hpl.jena.graph.Node | asNode(com.hp.hpl.jena.rdf.model.Resource r)Convert an RDF resource to an RDF node | 
| com.hp.hpl.jena.graph.Node | getContentNode(com.hp.hpl.jena.graph.Node subject)Get the content-bearing node for the given subject | 
| static ViewHelpers | getInstance()ViewHelpers are singletons. | 
| String | getNamespacePrefix(com.hp.hpl.jena.shared.PrefixMapping mapping,
                                    String namespace,
                                    boolean compact)Get the namespace prefix (or the namespace URI itself, if no prefix is
 available) from a prefix mapping | 
| Map<String,String> | getNodeBreadcrumbs(javax.ws.rs.core.UriInfo uriInfo,
                                    com.hp.hpl.jena.graph.Node subject)Generate url to local name breadcrumbs for a given node's tree | 
| Iterator<com.hp.hpl.jena.graph.Triple> | getObjects(com.hp.hpl.jena.graph.Graph graph,
                    com.hp.hpl.jena.graph.Node subject,
                    com.hp.hpl.jena.rdf.model.Resource predicate)Return an iterator of Triples that match the given subject and predicate | 
| String | getObjectsAsString(com.hp.hpl.jena.graph.Graph graph,
                                    com.hp.hpl.jena.graph.Node subject,
                                    com.hp.hpl.jena.rdf.model.Resource predicate,
                                    boolean uriAsLink)Get the string version of the object that matches the given subject and
 predicate | 
| String | getObjectTitle(com.hp.hpl.jena.graph.Graph graph,
                            com.hp.hpl.jena.graph.Node subject)Get the canonical title of a subject from the graph | 
| Iterator<com.hp.hpl.jena.graph.Node> | getOrderedVersions(com.hp.hpl.jena.graph.Graph graph,
                                    com.hp.hpl.jena.graph.Node subject,
                                    com.hp.hpl.jena.rdf.model.Resource predicate)Return an iterator of Triples for versions in order that
 they were created. | 
| String | getPrefixPreamble(com.hp.hpl.jena.shared.PrefixMapping mapping)Get a prefix preamble appropriate for a SPARQL-UPDATE query from a prefix
 mapping object | 
| String | getSerializationTitle(com.hp.hpl.jena.graph.Graph graph,
                                          com.hp.hpl.jena.graph.Node subject)Take a HAS_SERIALIZATION node and find the RDFS_LABEL for the format it is associated with | 
| List<com.hp.hpl.jena.graph.Triple> | getSortedTriples(com.hp.hpl.jena.rdf.model.Model model,
                                Iterator<com.hp.hpl.jena.graph.Triple> it)Sort a Iterator of Triples alphabetically by its subject, predicate, and
 object | 
| String | getVersionDate(com.hp.hpl.jena.graph.Graph graph,
                            com.hp.hpl.jena.graph.Node subject)Gets a modification date of a subject from the graph | 
| String | getVersionLabel(com.hp.hpl.jena.graph.Graph graph,
                              com.hp.hpl.jena.graph.Node subject,
                              String defaultValue)Gets a version label of a subject from the graph | 
| Iterator<com.hp.hpl.jena.graph.Node> | getVersions(com.hp.hpl.jena.graph.Graph graph,
                      com.hp.hpl.jena.graph.Node subject)Return an iterator of Triples for versions. | 
| String | getVersionSubjectUrl(javax.ws.rs.core.UriInfo uriInfo,
                                        com.hp.hpl.jena.graph.Node subject)Gets the URL of the node whose version is represented by the
 current node. | 
| boolean | isFrozenNode(com.hp.hpl.jena.graph.Graph graph,
                        com.hp.hpl.jena.graph.Node subject)Determines whether the subject is of type nt:frozenNode. | 
| boolean | isRdfResource(com.hp.hpl.jena.graph.Graph graph,
                          com.hp.hpl.jena.graph.Node subject,
                          String namespace,
                          String resource)Determines whether the subject is kind of RDF resource | 
| boolean | isWritable(com.hp.hpl.jena.graph.Graph graph,
                    com.hp.hpl.jena.graph.Node subject)Determines whether the subject is writable
 true if node is writable | 
| String | parameterize(String source)Transform a source string to something appropriate for HTML ids | 
| com.hp.hpl.jena.rdf.model.Resource | rdfsClass()Proxying access to the RDFS class static property | 
| com.hp.hpl.jena.rdf.model.Property | rdfsDomain()Proxying access to the RDFS domain static property | 
| com.hp.hpl.jena.rdf.model.Property | rdfType()Proxying access to the RDF type static property | 
protected ViewHelpers()
public static ViewHelpers getInstance()
public Iterator<com.hp.hpl.jena.graph.Triple> getObjects(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject, com.hp.hpl.jena.rdf.model.Resource predicate)
graph - the graphsubject - the subjectpredicate - the predicatepublic Iterator<com.hp.hpl.jena.graph.Node> getVersions(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject)
graph - the graphsubject - the subjectpublic Iterator<com.hp.hpl.jena.graph.Node> getOrderedVersions(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject, com.hp.hpl.jena.rdf.model.Resource predicate)
graph - the graphsubject - the subjectpredicate - the predicatepublic String getVersionSubjectUrl(javax.ws.rs.core.UriInfo uriInfo, com.hp.hpl.jena.graph.Node subject)
uriInfo - the uri infosubject - the subjectpublic String getVersionLabel(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject, String defaultValue)
graph - the graphsubject - the subjectdefaultValue - a value to be returned if no label is present in the
                     graphpublic String getVersionDate(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject)
graph - the graphsubject - the subjectpublic String getObjectTitle(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject)
graph - the graphsubject - the subjectpublic String getSerializationTitle(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject)
graph - the graphsubject - the subjectpublic boolean isWritable(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject)
graph - the graphsubject - the subjectpublic boolean isFrozenNode(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject)
graph - the graphsubject - the subjectpublic String getObjectsAsString(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject, com.hp.hpl.jena.rdf.model.Resource predicate, boolean uriAsLink)
graph - the graphsubject - the subjectpredicate - the predicateuriAsLink - the boolean value of uri as linkpublic Map<String,String> getNodeBreadcrumbs(javax.ws.rs.core.UriInfo uriInfo, com.hp.hpl.jena.graph.Node subject)
uriInfo - the uri infosubject - the subjectpublic List<com.hp.hpl.jena.graph.Triple> getSortedTriples(com.hp.hpl.jena.rdf.model.Model model, Iterator<com.hp.hpl.jena.graph.Triple> it)
model - the modelit - the iterator of triplespublic String getNamespacePrefix(com.hp.hpl.jena.shared.PrefixMapping mapping, String namespace, boolean compact)
mapping - the prefix mappingnamespace - the namespacecompact - the boolean value of compactpublic String getPrefixPreamble(com.hp.hpl.jena.shared.PrefixMapping mapping)
mapping - the prefix mappingpublic boolean isRdfResource(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject, String namespace, String resource)
graph - the graphsubject - the subjectnamespace - the namespaceresource - the resourcepublic com.hp.hpl.jena.graph.Node asNode(com.hp.hpl.jena.rdf.model.Resource r)
r - the resourcepublic com.hp.hpl.jena.graph.Node asLiteralStringNode(String r)
r - the uri stringpublic int addOne(int i)
i - the given integerpublic com.hp.hpl.jena.rdf.model.Property rdfType()
public com.hp.hpl.jena.rdf.model.Property rdfsDomain()
public com.hp.hpl.jena.rdf.model.Resource rdfsClass()
public com.hp.hpl.jena.graph.Node getContentNode(com.hp.hpl.jena.graph.Node subject)
subject - the subjectpublic String parameterize(String source)
source - the source stringCopyright © 2013–2015 DuraSpace, Inc.. All rights reserved.