|
|||||||||||
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.saxon.RDFTwig
Saxon extensions to access portions of an RDF graph.
Copyright (C) 2002, 2003 Norman Walsh.
This class provides a Saxon 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.icl.saxon.Context context,
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.icl.saxon.Context context,
com.hp.hpl.mesa.rdf.jena.model.Resource rsrc,
int depth)
Convenience method using the default model. |
static org.w3c.dom.Element |
dftwig(com.icl.saxon.Context context,
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.icl.saxon.Context context,
com.hp.hpl.mesa.rdf.jena.model.Model model,
com.icl.saxon.expr.NodeSetValue ns)
Convenience method for building twigs of depth zero from a node set. |
static org.w3c.dom.Element |
leaf(com.icl.saxon.Context context,
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.icl.saxon.Context context,
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(com.icl.saxon.Context context,
com.icl.saxon.expr.NodeSetValue ns)
Convenience method for building twigs of depth zero from a node set with the default model. |
static org.w3c.dom.Element |
leaf(com.icl.saxon.Context context,
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(com.icl.saxon.Context context,
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,
com.icl.saxon.expr.NodeSetValue ns)
Returns the RDF resource associated with a node. |
static com.hp.hpl.mesa.rdf.jena.model.Resource |
resource(com.icl.saxon.expr.NodeSetValue 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,
com.icl.saxon.expr.NodeSetValue ns)
Returns the RDF resources associated with a set of nodes. |
static com.hp.hpl.mesa.rdf.jena.model.Resource |
resources(com.icl.saxon.expr.NodeSetValue ns)
Convenience method using the default model. |
static org.w3c.dom.Element |
twig(com.icl.saxon.Context context,
com.hp.hpl.mesa.rdf.jena.model.Model model,
com.icl.saxon.expr.NodeSetValue ns)
Convenience method for building twigs of infinite depth from a node set. |
static org.w3c.dom.Element |
twig(com.icl.saxon.Context context,
com.hp.hpl.mesa.rdf.jena.model.Model model,
com.icl.saxon.expr.NodeSetValue ns,
int depth)
Convenience method for building twigs from a node set. |
static org.w3c.dom.Element |
twig(com.icl.saxon.Context context,
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.icl.saxon.Context context,
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.icl.saxon.Context context,
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.icl.saxon.Context context,
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(com.icl.saxon.Context context,
com.icl.saxon.expr.NodeSetValue ns)
Convenience method for building twigs of infinite depth from a node set with the default model. |
static org.w3c.dom.Element |
twig(com.icl.saxon.Context context,
com.icl.saxon.expr.NodeSetValue ns,
int depth)
Convenience method for building twigs from a node set with the default model. |
static org.w3c.dom.Element |
twig(com.icl.saxon.Context context,
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.icl.saxon.Context context,
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(com.icl.saxon.Context context,
java.lang.String resource)
Convenience method for building twigs of infinite depth with the default model. |
static org.w3c.dom.Element |
twig(com.icl.saxon.Context context,
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, com.icl.saxon.expr.NodeSetValue ns)
Returns one of the following, in this order:
model
- The external object containing the RDF model to use.ns
- A node set containing a node from some source tree.
resources(Model,NodeSetValue)
public static com.hp.hpl.mesa.rdf.jena.model.Resource resource(com.icl.saxon.expr.NodeSetValue ns)
resource(Model,NodeSetValue)
public static com.hp.hpl.mesa.rdf.jena.model.Resource resources(com.hp.hpl.mesa.rdf.jena.model.Model model, com.icl.saxon.expr.NodeSetValue ns)
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.ns
- A node set containing a set of nodes from some source tree.
resource(Model,NodeSetValue)
public static com.hp.hpl.mesa.rdf.jena.model.Resource resources(com.icl.saxon.expr.NodeSetValue ns)
resources(Model,NodeSetValue)
public static org.w3c.dom.Element twig(com.icl.saxon.Context context, 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.
context
- The Saxon context object.model
- The model.rsrc
- The starting resource.depth
- The maximum depth of the tree.
public static org.w3c.dom.Element branch(com.icl.saxon.Context context, 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.
context
- The Saxon context object.model
- The model.rsrc
- The starting resource.depth
- The maximum depth of the tree.
public static org.w3c.dom.Element branch(com.icl.saxon.Context context, com.hp.hpl.mesa.rdf.jena.model.Resource rsrc, int depth)
branch(Context,Model,Resource,int)
public static org.w3c.dom.Element dftwig(com.icl.saxon.Context context, 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().
context
- The Saxon context object.model
- The model.rsrc
- The starting resource.depth
- The maximum depth of the tree.
public static org.w3c.dom.Element twig(com.icl.saxon.Context context, com.hp.hpl.mesa.rdf.jena.model.Model model, java.lang.String resource, int depth)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element twig(com.icl.saxon.Context context, com.hp.hpl.mesa.rdf.jena.model.Resource resource, int depth)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element twig(com.icl.saxon.Context context, java.lang.String resource, int depth)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element twig(com.icl.saxon.Context context, com.hp.hpl.mesa.rdf.jena.model.Model model, com.hp.hpl.mesa.rdf.jena.model.Resource resource)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element twig(com.icl.saxon.Context context, com.hp.hpl.mesa.rdf.jena.model.Model model, java.lang.String resource)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element leaf(com.icl.saxon.Context context, com.hp.hpl.mesa.rdf.jena.model.Model model, com.hp.hpl.mesa.rdf.jena.model.Resource resource)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element leaf(com.icl.saxon.Context context, com.hp.hpl.mesa.rdf.jena.model.Model model, java.lang.String resource)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element leaf(com.icl.saxon.Context context, com.hp.hpl.mesa.rdf.jena.model.Resource resource)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element leaf(com.icl.saxon.Context context, java.lang.String resource)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element leaf(com.icl.saxon.Context context, com.icl.saxon.expr.NodeSetValue ns)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element leaf(com.icl.saxon.Context context, com.hp.hpl.mesa.rdf.jena.model.Model model, com.icl.saxon.expr.NodeSetValue ns)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element twig(com.icl.saxon.Context context, com.icl.saxon.expr.NodeSetValue ns)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element twig(com.icl.saxon.Context context, com.hp.hpl.mesa.rdf.jena.model.Resource resource)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element twig(com.icl.saxon.Context context, java.lang.String resource)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element twig(com.icl.saxon.Context context, com.icl.saxon.expr.NodeSetValue ns, int depth)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element twig(com.icl.saxon.Context context, com.hp.hpl.mesa.rdf.jena.model.Model model, com.icl.saxon.expr.NodeSetValue ns)
twig(Context,Model,Resource,int)
public static org.w3c.dom.Element twig(com.icl.saxon.Context context, com.hp.hpl.mesa.rdf.jena.model.Model model, com.icl.saxon.expr.NodeSetValue ns, int depth)
twig(Context,Model,Resource,int)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |