|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.nwalsh.xslt.TwigJena | +--com.nwalsh.xslt.xalan.RDFTwig
Xalan extensions to access portions of an RDF graph.
Copyright (C) 2002, 2003 Norman Walsh.
This class provides a Xalan extension to access nodes in an RDF graph.
The underlying RDF model is accessed with Jena.
Change Log:
Initial release.
TwigJena
Field Summary |
Fields inherited from class com.nwalsh.xslt.TwigJena |
defaultModel, loadedModel, quiet |
Constructor Summary | |
RDFTwig()
|
Method Summary | |
static org.w3c.dom.Element |
branch(com.hp.hpl.mesa.rdf.jena.model.Model model,
com.hp.hpl.mesa.rdf.jena.model.Resource rsrc,
int depth)
Returns a tree representation of a resource from the model. |
static org.w3c.dom.Element |
branch(com.hp.hpl.mesa.rdf.jena.model.Resource rsrc,
int depth)
Convenience method using the default model. |
static org.w3c.dom.Element |
dftwig(com.hp.hpl.mesa.rdf.jena.model.Model model,
com.hp.hpl.mesa.rdf.jena.model.Resource rsrc,
int depth)
Returns a tree representation of a resource from the model. |
static org.w3c.dom.Element |
leaf(com.hp.hpl.mesa.rdf.jena.model.Model model,
org.w3c.dom.traversal.NodeIterator ns)
Convenience method for building twigs of depth zero from a node set. |
static org.w3c.dom.Element |
leaf(com.hp.hpl.mesa.rdf.jena.model.Model model,
com.hp.hpl.mesa.rdf.jena.model.Resource resource)
Convenience method for building twigs of depth zero. |
static org.w3c.dom.Element |
leaf(com.hp.hpl.mesa.rdf.jena.model.Model model,
java.lang.String resource)
Convenience method for building twigs of depth zero. |
static org.w3c.dom.Element |
leaf(org.w3c.dom.traversal.NodeIterator ns)
Convenience method for building twigs of depth zero from a node set with the default model. |
static org.w3c.dom.Element |
leaf(com.hp.hpl.mesa.rdf.jena.model.Resource resource)
Convenience method for building twigs of depth zero with the default model. |
static org.w3c.dom.Element |
leaf(java.lang.String resource)
Convenience method for building twigs of depth zero with the default model. |
static com.hp.hpl.mesa.rdf.jena.model.Resource |
resource(com.hp.hpl.mesa.rdf.jena.model.Model model,
org.w3c.dom.traversal.NodeIterator xalanNI)
Returns the RDF resource associated with a node. |
static com.hp.hpl.mesa.rdf.jena.model.Resource |
resource(org.w3c.dom.traversal.NodeIterator ns)
Convenience method using the default model. |
static com.hp.hpl.mesa.rdf.jena.model.Resource |
resources(com.hp.hpl.mesa.rdf.jena.model.Model model,
org.w3c.dom.traversal.NodeIterator xalanNI)
Returns the RDF resources associated with a set of nodes. |
static com.hp.hpl.mesa.rdf.jena.model.Resource |
resources(org.w3c.dom.traversal.NodeIterator ns)
Convenience method using the default model. |
static org.w3c.dom.Element |
twig(com.hp.hpl.mesa.rdf.jena.model.Model model,
org.w3c.dom.traversal.NodeIterator ns)
Convenience method for building twigs of infinite depth from a node set. |
static org.w3c.dom.Element |
twig(com.hp.hpl.mesa.rdf.jena.model.Model model,
org.w3c.dom.traversal.NodeIterator xalanNI,
int depth)
Convenience method for building twigs from a node set. |
static org.w3c.dom.Element |
twig(com.hp.hpl.mesa.rdf.jena.model.Model model,
com.hp.hpl.mesa.rdf.jena.model.Resource resource)
Convenience method for building twigs of infinite depth. |
static org.w3c.dom.Element |
twig(com.hp.hpl.mesa.rdf.jena.model.Model model,
com.hp.hpl.mesa.rdf.jena.model.Resource rsrc,
int depth)
Returns a tree representation of a resource from the model. |
static org.w3c.dom.Element |
twig(com.hp.hpl.mesa.rdf.jena.model.Model model,
java.lang.String resource)
Convenience method for building twigs of infinite depth. |
static org.w3c.dom.Element |
twig(com.hp.hpl.mesa.rdf.jena.model.Model model,
java.lang.String resource,
int depth)
Convenience method for building twigs. |
static org.w3c.dom.Element |
twig(org.w3c.dom.traversal.NodeIterator ns)
Convenience method for building twigs of infinite depth from a node set with the default model. |
static org.w3c.dom.Element |
twig(org.w3c.dom.traversal.NodeIterator ns,
int depth)
Convenience method for building twigs from a node set with the default model. |
static org.w3c.dom.Element |
twig(com.hp.hpl.mesa.rdf.jena.model.Resource resource)
Convenience method for building twigs of infinite depth with the default model. |
static org.w3c.dom.Element |
twig(com.hp.hpl.mesa.rdf.jena.model.Resource resource,
int depth)
Convenience method for building twigs with the default model. |
static org.w3c.dom.Element |
twig(java.lang.String resource)
Convenience method for building twigs of infinite depth with the default model. |
static org.w3c.dom.Element |
twig(java.lang.String resource,
int depth)
Convenience method for building twigs with the default model. |
Methods inherited from class com.nwalsh.xslt.TwigJena |
defaultModelWarning, difference, difference, exceptionWarning, filter, filter, filter, filter, filterNot, filterNot, filterNot, filterNot, find, find, find, find, get, get, intersection, intersection, load, property, quiet, resource, resource, union, union |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RDFTwig()
Method Detail |
public static com.hp.hpl.mesa.rdf.jena.model.Resource resource(com.hp.hpl.mesa.rdf.jena.model.Model model, org.w3c.dom.traversal.NodeIterator xalanNI)
Returns one of the following, in this order:
model
- The external object containing the RDF model to use.
resources(Model,NodeIterator)
public static com.hp.hpl.mesa.rdf.jena.model.Resource resource(org.w3c.dom.traversal.NodeIterator ns)
resource(Model,NodeIterator)
public static com.hp.hpl.mesa.rdf.jena.model.Resource resources(com.hp.hpl.mesa.rdf.jena.model.Model model, org.w3c.dom.traversal.NodeIterator xalanNI)
Returns a set of resources (a FindResult) containing all of the resources identified by the nodes in the node set. For each node in the node set, one of the following is added to the result set:
model
- The external object containing the RDF model to use.
resource(Model,NodeIterator)
public static com.hp.hpl.mesa.rdf.jena.model.Resource resources(org.w3c.dom.traversal.NodeIterator ns)
resources(Model,NodeIterator)
public static org.w3c.dom.Element twig(com.hp.hpl.mesa.rdf.jena.model.Model model, com.hp.hpl.mesa.rdf.jena.model.Resource rsrc, int depth)
This method builds a tree describing part of an RDF graph. The tree is constructed by performing a breadth-first search of the model, finding all of the resources and literals that can be reached by following properties from the starting resource.
The graph is turned into a tree by removing cycles. Cycles are removed by following the property of each resource only the first time it is encountered. If the same resource is encountered again, it is added to the tree as an empty node with an rdf:resource attribute.
If the depth is zero, no properties are followed, they will all be empty nodes with rdf:resource attributes. If the depth is greater than zero, the tree will be at most that deep. If the depth is less than zero, the depth is unbounded during construction.
model
- The model.rsrc
- The starting resource.depth
- The maximum depth of the tree.
public static org.w3c.dom.Element branch(com.hp.hpl.mesa.rdf.jena.model.Model model, com.hp.hpl.mesa.rdf.jena.model.Resource rsrc, int depth)
This method builds a tree describing part of an RDF graph. The tree is constructed by performing a breadth-first search of the model, finding all of the resources and literals that can be reached by following properties from the starting resource.
The graph is turned into a tree by removing cycles. Unlike twig(), branch() will expand resources more than once. It only stops expanding when it encounters a cycle in a given branch. (In other words, it will avoid cyclic expansion but not duplicate expansion.) This can lead to much larger graphs.
If the depth is zero, no properties are followed, they will all be empty nodes with rdf:resource attributes. If the depth is greater than zero, the tree will be at most that deep. If the depth is less than zero, the depth is unbounded during construction.
model
- The model.rsrc
- The starting resource.depth
- The maximum depth of the tree.
public static org.w3c.dom.Element branch(com.hp.hpl.mesa.rdf.jena.model.Resource rsrc, int depth)
branch(Model,Resource,int)
public static org.w3c.dom.Element dftwig(com.hp.hpl.mesa.rdf.jena.model.Model model, com.hp.hpl.mesa.rdf.jena.model.Resource rsrc, int depth)
This method builds a tree describing part of an RDF graph. The tree is constructed by performing a depth-first search of the model, finding all of the resources and literals that can be reached by following properties from the starting resource.
The graph is turned into a tree by removing cycles. Cycles are removed by following the properties of each resource only the first time it is encountered. If the same resource is encountered again, it is added to the tree as an empty node with an rdf:resource attribute.
If the depth is zero, no properties are followed, they will all be empty nodes with rdf:resource attributes. If the depth is greater than zero, the tree will be at most that deep. If the depth is less than zero, the depth is unbounded during construction.
Note: there is no dfbranch() method as it would be the same as branch().
model
- The model.rsrc
- The starting resource.depth
- The maximum depth of the tree.
public static org.w3c.dom.Element twig(com.hp.hpl.mesa.rdf.jena.model.Model model, java.lang.String resource, int depth)
twig(Model,Resource,int)
public static org.w3c.dom.Element twig(com.hp.hpl.mesa.rdf.jena.model.Resource resource, int depth)
twig(Model,Resource,int)
public static org.w3c.dom.Element twig(java.lang.String resource, int depth)
twig(Model,Resource,int)
public static org.w3c.dom.Element twig(com.hp.hpl.mesa.rdf.jena.model.Model model, com.hp.hpl.mesa.rdf.jena.model.Resource resource)
twig(Model,Resource,int)
public static org.w3c.dom.Element twig(com.hp.hpl.mesa.rdf.jena.model.Model model, java.lang.String resource)
twig(Model,Resource,int)
public static org.w3c.dom.Element leaf(com.hp.hpl.mesa.rdf.jena.model.Model model, com.hp.hpl.mesa.rdf.jena.model.Resource resource)
twig(Model,Resource,int)
public static org.w3c.dom.Element leaf(com.hp.hpl.mesa.rdf.jena.model.Model model, java.lang.String resource)
twig(Model,Resource,int)
public static org.w3c.dom.Element leaf(com.hp.hpl.mesa.rdf.jena.model.Resource resource)
twig(Model,Resource,int)
public static org.w3c.dom.Element leaf(java.lang.String resource)
twig(Model,Resource,int)
public static org.w3c.dom.Element leaf(org.w3c.dom.traversal.NodeIterator ns)
twig(Model,Resource,int)
public static org.w3c.dom.Element leaf(com.hp.hpl.mesa.rdf.jena.model.Model model, org.w3c.dom.traversal.NodeIterator ns)
twig(Model,Resource,int)
public static org.w3c.dom.Element twig(org.w3c.dom.traversal.NodeIterator ns)
twig(Model,Resource,int)
public static org.w3c.dom.Element twig(com.hp.hpl.mesa.rdf.jena.model.Resource resource)
twig(Model,Resource,int)
public static org.w3c.dom.Element twig(java.lang.String resource)
twig(Model,Resource,int)
public static org.w3c.dom.Element twig(org.w3c.dom.traversal.NodeIterator ns, int depth)
twig(Model,Resource,int)
public static org.w3c.dom.Element twig(com.hp.hpl.mesa.rdf.jena.model.Model model, org.w3c.dom.traversal.NodeIterator ns)
twig(Model,Resource,int)
public static org.w3c.dom.Element twig(com.hp.hpl.mesa.rdf.jena.model.Model model, org.w3c.dom.traversal.NodeIterator xalanNI, int depth)
twig(Model,Resource,int)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |