public interface RDFNode extends FrontsNode
Modifier and Type | Method and Description |
---|---|
<T extends RDFNode> |
as(Class<T> view)
RDFNodes can be converted to different implementation types.
|
Literal |
asLiteral()
If this node is a Literal, answer that literal; otherwise throw an
exception.
|
Resource |
asResource()
If this node is a Resource, answer that resource; otherwise throw an
exception.
|
<T extends RDFNode> |
canAs(Class<T> view)
Answer true iff this RDFNode can be viewed as an instance of
view : that is, if it has already been viewed in this
way, or if it has an attached model in which it has properties that
permit it to be viewed in this way. |
Model |
getModel()
Return the model associated with this resource.
|
RDFNode |
inModel(Model m)
Answer a .equals() version of this node, except that it's in the model
m . |
boolean |
isAnon()
Answer true iff this RDFNode is an anonymous resource.
|
boolean |
isLiteral()
Answer true iff this RDFNode is a literal resource.
|
boolean |
isResource()
Answer true iff this RDFNode is a URI resource or an anonymous
resource (ie is not a literal).
|
boolean |
isURIResource()
Answer true iff this RDFNode is an named resource.
|
String |
toString()
Answer a String representation of the node.
|
Object |
visitWith(RDFVisitor rv)
Apply the appropriate method of the visitor to this node's content and
return the result.
|
asNode
String toString()
boolean isAnon()
boolean isLiteral()
boolean isURIResource()
boolean isResource()
<T extends RDFNode> T as(Class<T> view)
view
interface. The
resulting RDFNode should be an instance of view
and should
have any internal invariants as specified.
If the RDFNode has no Model attached, it can only be .as()ed to a type it (this particular RDFNOde) already has.
If the RDFNode cannot be converted, an UnsupportedPolymorphism exception is thrown..
<T extends RDFNode> boolean canAs(Class<T> view)
view
: that is, if it has already been viewed in this
way, or if it has an attached model in which it has properties that
permit it to be viewed in this way. If canAs
returns
true
, as
on the same view should
deliver an instance of that class.Model getModel()
RDFNode inModel(Model m)
m
.m
- a model to move the node toObject visitWith(RDFVisitor rv)
rv
- an RDFVisitor with a method for URI/blank/literal nodesResource asResource()
Literal asLiteral()
Licenced under the Apache License, Version 2.0