|
||||||||||
| 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, with the given predicate and object. |
void |
addValue(URI predicate,
Object object)
Add a new triple with this as the subject, with the given predicate and object. |
void |
addValue(URI predicate,
Resource object)
Add a new triple with this as the subject, with the given predicate and object. |
void |
addValue(URI predicate,
String lexicalValue)
Add a new triple with this as the subject, with the given predicate and object. |
void |
addValue(URI predicate,
String lexicalValue,
String language)
Add a new triple with this as the subject, with the given predicate and object. |
void |
addValue(URI predicate,
String lexicalValue,
URI dataType)
Add a new triple with this as the subject, with the given predicate and object. |
void |
addValue(URI predicate,
URI object)
Add a new triple with this as the subject, with the given predicate and object. |
Triple |
asTriple(PredicateNode predicate,
ObjectNode object)
|
Triple |
asTriple(URI predicate,
Object object)
|
Triple |
asTriple(URI predicate,
Resource object)
|
Triple |
asTriple(URI predicate,
String lexicalValue)
|
Triple |
asTriple(URI predicate,
String lexicalValue,
String language)
|
Triple |
asTriple(URI predicate,
String lexicalValue,
URI dataType)
|
Triple |
asTriple(URI predicate,
URI object)
|
boolean |
containsTriple(PredicateNode predicate,
ObjectNode object)
|
ClosableIterator<ObjectNode> |
getObjects(PredicateNode predicate)
With this as the subject and using the given predicate return all the objects. |
ClosableIterator<ObjectNode> |
getObjects(URI predicate)
|
ClosableIterator<SubjectNode> |
getSubjects(PredicateNode predicate)
With this as the object and using the given predicate return all the subjects. |
ClosableIterator<SubjectNode> |
getSubjects(URI predicate)
|
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 |
removeSubject(URI subject,
URI predicate)
|
void |
removeValue(PredicateNode predicate,
ObjectNode object)
Remove the triple with this as the subject, the given predicate and object. |
void |
removeValue(URI predicate,
Object object)
|
void |
removeValue(URI predicate,
Resource object)
|
void |
removeValue(URI predicate,
String lexicalValue)
|
void |
removeValue(URI predicate,
String lexicalValue,
String language)
|
void |
removeValue(URI predicate,
String lexicalValue,
URI dataType)
|
void |
removeValue(URI predicate,
URI object)
|
void |
removeValues(PredicateNode predicate)
Remove all the triples with this as the subject and the given predicate. |
void |
removeValues(URI 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. |
void |
setValue(URI predicate,
Object object)
Removes 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. |
void |
setValue(URI predicate,
Resource object)
Removes 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. |
void |
setValue(URI predicate,
String lexicalValue)
Removes 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. |
void |
setValue(URI predicate,
String lexicalValue,
String language)
Removes 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. |
void |
setValue(URI predicate,
String lexicalValue,
URI dataType)
Removes 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. |
void |
setValue(URI predicate,
URI object)
Removes 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.BlankNode |
|---|
equals, hashCode |
| 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 use to create the triple.object - the existing object in the graph to use to create the triple.
GraphException - if the predicate or object do not exist in the graph.
void addValue(URI predicate,
URI object)
throws GraphException
predicate - a new or existing predicate to use to create the triple.object - a new or existing object to use to create the triple.
GraphException - if there was an error adding the triple (for example localising the nodes).
void addValue(URI predicate,
String lexicalValue)
throws GraphException
GraphValueFactory.createLiteral(String)
predicate - a new or existing predicate to use to create the triple.lexicalValue - a new or existing literal value to use to create the triple.
GraphException - if there was an error adding the triple (for example localising the nodes).
void addValue(URI predicate,
Resource object)
throws GraphException
predicate - a new or existing predicate to use to create the triple.object - an existing resource from the graph used to create the triple.
GraphException - if there was an error adding the triple (for example localising the nodes) or the
Resource was not from this Graph.
void addValue(URI predicate,
Object object)
throws GraphException
GraphValueFactory.createLiteral(Object)
predicate - a new or existing predicate to use to create the triple.object - a new or existing object to use to create the triple.
GraphException - if there was an error adding the triple (for example localising the nodes).
void addValue(URI predicate,
String lexicalValue,
String language)
throws GraphException
GraphValueFactory.createLiteral(String, String)
predicate - a new or existing predicate to use to create the triple.lexicalValue - a new or existing literal value to use to create the triple.language - the language used to create the literal.
GraphException - if there was an error adding the triple (for example localising the nodes).
void addValue(URI predicate,
String lexicalValue,
URI dataType)
throws GraphException
GraphValueFactory.createLiteral(String, URI)
predicate - a new or existing predicate to use to create the triple.lexicalValue - a new or existing literal value to use to create the triple.dataType - the datatype URI used to create the literal.
GraphException - if there was an error adding the triple (for example localising the nodes).
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 setValue(URI predicate,
URI object)
throws GraphException
predicate - the existing predicate in the graph to set.object - a new or existing object to use to create the triple.
GraphException - if the predicate or object do not exist in the graph.
void setValue(URI predicate,
String lexicalValue)
throws GraphException
predicate - a new or existing predicate to set.lexicalValue - a new or existing literal value to use to create the triple.
GraphException - if there was an error adding the triple (for example localising the nodes).
void setValue(URI predicate,
Resource object)
throws GraphException
predicate - a new or existing predicate to set.object - an existing resource from the graph to set.
GraphException - if there was an error adding the triple (for example localising the nodes) or the
Resource was not from this Graph.
void setValue(URI predicate,
Object object)
throws GraphException
predicate - a new or existing predicate to set.object - a new or existing object to set.
GraphException - if there was an error adding the triple (for example localising the nodes).
void setValue(URI predicate,
String lexicalValue,
String language)
throws GraphException
predicate - a new or existing predicate to set.lexicalValue - a new or existing literal value to use to create the triple.language - the language used to create the literal.
GraphException - if there was an error adding the triple (for example localising the nodes).
void setValue(URI predicate,
String lexicalValue,
URI dataType)
throws GraphException
predicate - a new or existing predicate to set.lexicalValue - a new or existing literal value to use to create the triple.dataType - the datatype URI used to create the literal.
GraphException - if there was an error adding the triple (for example localising the nodes).
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 removeValue(URI predicate,
URI object)
throws GraphException
GraphException
void removeValue(URI predicate,
String lexicalValue)
throws GraphException
GraphException
void removeValue(URI predicate,
Resource object)
throws GraphException
GraphException
void removeValue(URI predicate,
Object object)
throws GraphException
GraphException
void removeValue(URI predicate,
String lexicalValue,
String language)
throws GraphException
GraphException
void removeValue(URI predicate,
String lexicalValue,
URI dataType)
throws GraphException
GraphException
Triple asTriple(PredicateNode predicate,
ObjectNode object)
throws GraphException
GraphException
Triple asTriple(URI predicate,
URI object)
throws GraphException
GraphException
Triple asTriple(URI predicate,
String lexicalValue)
throws GraphException
GraphException
Triple asTriple(URI predicate,
Resource object)
throws GraphException
GraphException
Triple asTriple(URI predicate,
Object object)
throws GraphException
GraphException
Triple asTriple(URI predicate,
String lexicalValue,
String language)
throws GraphException
GraphException
Triple asTriple(URI predicate,
String lexicalValue,
URI dataType)
throws GraphException
GraphException
void removeValues(PredicateNode predicate)
throws GraphException
predicate - the existing predicate in the graph.
GraphException - if the predicate does not exist in the graph.
void removeValues(URI predicate)
throws GraphException
GraphException
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.
void removeSubject(URI subject,
URI predicate)
throws GraphException
GraphException
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<ObjectNode> getObjects(URI predicate)
throws GraphException
GraphException
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.
ClosableIterator<SubjectNode> getSubjects(URI predicate)
throws GraphException
GraphExceptionNode getUnderlyingNode()
boolean containsTriple(PredicateNode predicate,
ObjectNode object)
throws GraphException
GraphException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||