|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Resource
A resource stands for either a Blank Node or a URI Reference. This is a convienence interface designed to make it easier to create triples programmatically.
Method Summary | |
---|---|
void |
addValue(PredicateNode predicate,
ObjectNode object)
Add a new triple with this as the subject, the given predicate and object. |
ClosableIterator<ObjectNode> |
getObjects(PredicateNode predicate)
With this as the subject and using the given predicate return all the objects. |
ClosableIterator<SubjectNode> |
getSubjects(PredicateNode predicate)
With this as the object and using the given predicate return all the subjects. |
Node |
getUnderlyingNode()
Returns the node that the resource represents - either a BlankNode or a URIReference. |
boolean |
isURIReference()
Returns true if this is a URIReference, otherwise it's a BlankNode. |
void |
removeSubject(SubjectNode subject,
PredicateNode predicate)
Remove the triple with this as the object, the given subject and predicate. |
void |
removeValue(PredicateNode predicate,
ObjectNode object)
Remove the triple with this as the subject, the given predicate and object. |
void |
removeValues(PredicateNode predicate)
Remove all the triples with this as the subject and the given predicate. |
void |
setValue(PredicateNode predicate,
ObjectNode object)
Remove any other triples with this as the subject, the given predicate and any object and add a new triple with this as the subject and the given predicate and object. |
Methods inherited from interface org.jrdf.graph.URIReference |
---|
equals, getURI, hashCode |
Methods inherited from interface org.jrdf.graph.TypedNodeVisitable |
---|
accept |
Methods inherited from interface org.jrdf.graph.TypedNodeVisitable |
---|
accept |
Methods inherited from interface org.jrdf.graph.TypedNodeVisitable |
---|
accept |
Methods inherited from interface org.jrdf.graph.BlankNode |
---|
equals, hashCode |
Methods inherited from interface org.jrdf.graph.TypedNodeVisitable |
---|
accept |
Methods inherited from interface org.jrdf.graph.TypedNodeVisitable |
---|
accept |
Method Detail |
---|
boolean isURIReference()
void addValue(PredicateNode predicate, ObjectNode object) throws GraphException
predicate
- the existing predicate in the graph to create the triple with.object
- the existing object in the graph to create the triple with.
GraphException
- if the predicate or object do not exist in the graph.void setValue(PredicateNode predicate, ObjectNode object) throws GraphException
predicate
- the existing predicate in the graph to set.object
- the existing object in the graph to set.
GraphException
- if the predicate or object do not exist in the graph.void removeValue(PredicateNode predicate, ObjectNode object) throws GraphException
predicate
- the existing predicate in the graph to remove.object
- the existing object in the graph to remove.
GraphException
- if the predicate or object does not exist in the graph.void removeValues(PredicateNode predicate) throws GraphException
predicate
- the existing predicate in the graph.
GraphException
- if the predicate does not exist in the graph.void removeSubject(SubjectNode subject, PredicateNode predicate) throws GraphException
subject
- the existing subject in the graph to remove.predicate
- the existing predicate in the graph to remove.
GraphException
- if the subject or predicate do not exist in the graph.ClosableIterator<ObjectNode> getObjects(PredicateNode predicate) throws GraphException
predicate
- the existing predicate in the graph to use to find the objects.
GraphException
- if the subject or predicate do not exist in the graph.ClosableIterator<SubjectNode> getSubjects(PredicateNode predicate) throws GraphException
predicate
- the existing predicate in the graph to use to find the subjects.
GraphException
- if the subject or predicate do not exist in the graph.Node getUnderlyingNode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |