|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.util.Triple<Object,Reference,Object>
org.restlet.ext.rdf.Link
public class Link
Link between a source resource and a target resource or literal. This exactly maps with the concepts of statement, triple or relationship defined by RDF, the core specification of the Semantic Web. A link is composed of a source node (or subject in RDF terminology), a type URI reference (or predicate in RDF terminology) and a target node (or object in RDF terminology). We use this class in Restlet to enhance resources and make them part of the Web of data (also know as Linked Data and Hyperdata).
Constructor Summary | |
---|---|
Link(Graph sourceGraph,
Reference typeRef,
Literal targetLit)
Constructor. |
|
Link(Graph sourceGraph,
Reference typeRef,
Object target)
Constructor. |
|
Link(Graph sourceGraph,
Reference typeRef,
Reference targetRef)
Constructor. |
|
Link(Graph sourceGraph,
String typeRef,
Literal targetLit)
Constructor. |
|
Link(Graph sourceGraph,
String typeRef,
Object target)
Constructor. |
|
Link(Graph sourceGraph,
String typeRef,
Reference targetRef)
Constructor. |
|
Link(Link from)
Constructor by copy. |
|
Link(Reference sourceRef,
Reference typeRef,
Literal targetLit)
Constructor. |
|
Link(Reference sourceRef,
Reference typeRef,
Reference targetRef)
Constructor. |
|
Link(Reference sourceRef,
String typeRef,
Literal targetLit)
Constructor. |
|
Link(Reference sourceRef,
String typeRef,
Reference targetRef)
Constructor. |
Method Summary | |
---|---|
static Reference |
createBlankRef(String identifier)
Creates a reference to a blank node. |
Object |
getSource()
Returns the source which can be either a reference or a link or a graph or null. |
Graph |
getSourceAsGraph()
Returns the source graph. |
Link |
getSourceAsLink()
Returns the source link. |
Reference |
getSourceAsReference()
Returns the source resource reference. |
Object |
getTarget()
Returns the target which can be either a literal or a reference or is null. |
Graph |
getTargetAsGraph()
Returns the target graph. |
Link |
getTargetAsLink()
Returns the target link. |
Literal |
getTargetAsLiteral()
Returns the target literal. |
Reference |
getTargetAsReference()
Returns the target resource reference. |
Reference |
getTypeRef()
Returns the type reference. |
boolean |
hasGraphSource()
Indicates if the source is a graph. |
boolean |
hasGraphTarget()
Indicates if the target is a graph. |
boolean |
hasLinkSource()
Indicates if the source is a link. |
boolean |
hasLinkTarget()
Indicates if the target is a link. |
boolean |
hasLiteralTarget()
Indicates if the target is a literal. |
boolean |
hasReferenceSource()
Indicates if the source is a reference. |
boolean |
hasReferenceTarget()
Indicates if the target is a reference. |
static boolean |
isBlankRef(Reference reference)
Indicates if a reference is identifying a blank node. |
void |
setSource(Graph sourceGraph)
Sets the source as a graph. |
void |
setSource(Link sourceLink)
Sets the source as a link. |
void |
setSource(Reference sourceRef)
Sets the source resource reference. |
void |
setTarget(Graph targetGraph)
Sets the target as a graph. |
void |
setTarget(Link targetLink)
Sets the target as a link. |
void |
setTarget(Literal targetLit)
Sets the target literal. |
void |
setTarget(Reference targetRef)
Sets the target as a resource reference. |
void |
setTypeRef(Reference typeRef)
Sets the type reference. |
Methods inherited from class org.restlet.util.Triple |
---|
equals, getFirst, getSecond, getThird, hashCode, setFirst, setSecond, setThird, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Link(Graph sourceGraph, Reference typeRef, Literal targetLit)
sourceGraph
- The source graph or subject in RDF terminology.typeRef
- The type reference or predicate in RDF terminology.targetLit
- The target literal or object in RDF terminology.public Link(Graph sourceGraph, Reference typeRef, Object target)
sourceGraph
- The source graph or subject in RDF terminology.typeRef
- The type reference or predicate in RDF terminology.target
- The target node or object in RDF terminology.public Link(Graph sourceGraph, Reference typeRef, Reference targetRef)
sourceGraph
- The source graph or subject in RDF terminology.typeRef
- The type reference or predicate in RDF terminology.targetRef
- The target reference or object in RDF terminology.public Link(Graph sourceGraph, String typeRef, Literal targetLit)
sourceGraph
- The source graph or subject in RDF terminology.typeRef
- The type reference or predicate in RDF terminology.targetLit
- The target literal or object in RDF terminology.public Link(Graph sourceGraph, String typeRef, Object target)
sourceGraph
- The source graph or subject in RDF terminology.typeRef
- The type reference or predicate in RDF terminology.target
- The target node or object in RDF terminology.public Link(Graph sourceGraph, String typeRef, Reference targetRef)
sourceGraph
- The source graph or subject in RDF terminology.typeRef
- The type reference or predicate in RDF terminology.targetRef
- The target reference or object in RDF terminology.public Link(Link from)
from
- The link to copy from.public Link(Reference sourceRef, Reference typeRef, Literal targetLit)
sourceRef
- The source resource reference or subject in RDF terminology.typeRef
- The type reference or predicate in RDF terminology.targetLit
- The target literal node or object in RDF terminology.public Link(Reference sourceRef, Reference typeRef, Reference targetRef)
sourceRef
- The source resource reference or subject in RDF terminology.typeRef
- The type reference or predicate in RDF terminology.targetRef
- The target resource reference or object in RDF terminology.public Link(Reference sourceRef, String typeRef, Literal targetLit)
sourceRef
- The source resource reference or subject in RDF terminology.typeRef
- The type reference or predicate in RDF terminology.targetLit
- The target literal node or object in RDF terminology.public Link(Reference sourceRef, String typeRef, Reference targetRef)
sourceRef
- The source resource reference or subject in RDF terminology.typeRef
- The type reference or predicate in RDF terminology.targetRef
- The target resource reference or object in RDF terminology.Method Detail |
---|
public static Reference createBlankRef(String identifier)
identifier
- The blank node identifier.
public static boolean isBlankRef(Reference reference)
reference
- The reference to test.
createBlankRef(String)
public Object getSource()
public Graph getSourceAsGraph()
getSource()
public Link getSourceAsLink()
getSource()
public Reference getSourceAsReference()
getSource()
public Object getTarget()
public Graph getTargetAsGraph()
getTarget()
public Link getTargetAsLink()
getTarget()
public Literal getTargetAsLiteral()
getTarget()
public Reference getTargetAsReference()
getTarget()
public Reference getTypeRef()
public boolean hasGraphSource()
public boolean hasGraphTarget()
public boolean hasLinkSource()
public boolean hasLinkTarget()
public boolean hasLiteralTarget()
public boolean hasReferenceSource()
public boolean hasReferenceTarget()
public void setSource(Graph sourceGraph)
sourceGraph
- The source graph.public void setSource(Link sourceLink)
sourceLink
- The source link.public void setSource(Reference sourceRef)
sourceRef
- The source resource reference.public void setTarget(Graph targetGraph)
targetGraph
- The target graph.public void setTarget(Link targetLink)
targetLink
- The target link.public void setTarget(Literal targetLit)
targetLit
- The target literal.public void setTarget(Reference targetRef)
targetRef
- The target resource reference.public void setTypeRef(Reference typeRef)
typeRef
- The type reference.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |