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
- subject
- predicate
- public Iterator<com.hp.hpl.jena.graph.Node> getVersions(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject)
graph
- subject
- public 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
- subject
- public String getVersionSubjectUrl(javax.ws.rs.core.UriInfo uriInfo, com.hp.hpl.jena.graph.Node subject)
public String getVersionLabel(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject, String defaultValue)
graph
- subject
- defaultValue
- 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
- subject
- public String getObjectTitle(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject)
graph
- subject
- public String getSerializationTitle(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject)
graph
- subject
- public boolean isWritable(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject)
public boolean isFrozenNode(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject)
public 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
- subject
- predicate
- public Map<String,String> getNodeBreadcrumbs(javax.ws.rs.core.UriInfo uriInfo, com.hp.hpl.jena.graph.Node subject)
uriInfo
- subject
- public 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
- it
- public String getNamespacePrefix(com.hp.hpl.jena.shared.PrefixMapping mapping, String namespace, boolean compact)
mapping
- namespace
- public String getPrefixPreamble(com.hp.hpl.jena.shared.PrefixMapping mapping)
mapping
- public boolean isRdfResource(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node subject, String namespace, String resource)
public com.hp.hpl.jena.graph.Node asNode(com.hp.hpl.jena.rdf.model.Resource r)
r
- public com.hp.hpl.jena.graph.Node asLiteralStringNode(String r)
r
- public int addOne(int i)
i
- public 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
- public String parameterize(String source)
source
- Copyright © 2013-2015 DuraSpace, Inc.. All Rights Reserved.