|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Graph
An RDF graph.
| Field Summary | |
|---|---|
static Uri |
X
A wildcard for use when matching triples. |
| Method Summary | |
|---|---|
boolean |
doesResourceExist(Node r)
Tests if a resource exists anywhere in the graph. |
void |
exportN3(OutputStream out)
Writes the contents of the graph to an output stream as N3. |
void |
exportN3(OutputStream out,
URI base)
Writes the contents of the graph to an output stream as N3. |
void |
exportXML(OutputStream out)
Writes the contents of the graph to an output stream as RDF/XML. |
void |
exportXML(OutputStream out,
URI base)
Writes the contents of the graph to an output stream as RDF/XML. |
Collection<ObjectNode> |
getObjects()
Gets all the objects in the graph. |
Collection<PredicateNode> |
getPredicates()
Gets all the predicates in the graph. |
List<PropertyValue> |
getProperties(SubjectNode s)
Gets all the properties for a given subject. |
List<ObjectNode> |
getRdfList(SubjectNode s,
PredicateNode p)
Gets an rdf:List property from an object. |
Collection<SubjectNode> |
getSubjects()
Gets all the subjects in the graph. |
List<SubjectNode> |
getSubjects(PredicateNode property,
ObjectNode value)
Gets all the subjects that share a given property/value. |
List<Triple> |
getTriples()
Gets the entire graph as a list of triples. |
ObjectNode |
getValue(SubjectNode s,
PredicateNode p)
Gets a single value for a given property on a subject. |
List<ObjectNode> |
getValues(SubjectNode s,
PredicateNode p)
Gets all the values for a given property on a subject. |
boolean |
isAsserted(SubjectNode s,
PredicateNode p,
ObjectNode o)
Tests if a triple has been asserted. |
boolean |
isAsserted(Triple t)
Tests if a triple has been asserted. |
boolean |
isEmpty()
Tests if the graph has any entries. |
Iterator<Triple> |
match(SubjectNode s,
PredicateNode p,
ObjectNode o)
Find all triples that match a given pattern. |
Graph |
matchSubgraph(SubjectNode s,
PredicateNode p,
ObjectNode o)
Returns a subgraph of this graph that only contains the triples that match a given pattern. |
long |
size()
Gets the number of triples in this graph. |
| Field Detail |
|---|
static final Uri X
| Method Detail |
|---|
boolean isAsserted(Triple t)
t - The triple to test for.
true only if the triple exists in the graph.
boolean isAsserted(SubjectNode s,
PredicateNode p,
ObjectNode o)
s - The subject of the triple to search for.p - The predicate of the triple to search for.o - The object of the triple to search for.
true only if the triple exists in the graph.boolean doesResourceExist(Node r)
r - The resource to test.
true only if the resource is used somewhere in the graph.List<PropertyValue> getProperties(SubjectNode s)
s - The subject.
List<ObjectNode> getValues(SubjectNode s,
PredicateNode p)
s - The subject to get the properties for.p - The property of interest.
ObjectNode getValue(SubjectNode s,
PredicateNode p)
s - The subject to get the properties for.p - The property of interest.
List<ObjectNode> getRdfList(SubjectNode s,
PredicateNode p)
s - The subject to get the property for.p - The property of interest.
List<SubjectNode> getSubjects(PredicateNode property,
ObjectNode value)
property - The property being looked for.value - The value being looked for.
Collection<SubjectNode> getSubjects()
Collection<PredicateNode> getPredicates()
Collection<ObjectNode> getObjects()
List<Triple> getTriples()
void exportN3(OutputStream out)
throws IOException
out - The stream to write to.
IOException
void exportN3(OutputStream out,
URI base)
throws IOException
out - The stream to write to.base - The base to write to.
IOException
void exportXML(OutputStream out)
throws IOException
out - The stream to write to.
IOException
void exportXML(OutputStream out,
URI base)
throws IOException
out - The stream to write to.base - The base to write to.
IOExceptionlong size()
boolean isEmpty()
true if there are no entries.
Iterator<Triple> match(SubjectNode s,
PredicateNode p,
ObjectNode o)
ConcurrentModificationException if the graph is modified.
If this is a possibility, then use matchSubgraph(SubjectNode, PredicateNode, ObjectNode) instead.
s - The subject of the triples to match. If null or X then all subjects match.p - The predicate of the triple to add. If null or X then all predicates match.o - The object of the triple to add. If null or X then all objects match.
Graph matchSubgraph(SubjectNode s,
PredicateNode p,
ObjectNode o)
match(SubjectNode, PredicateNode, ObjectNode) instead.
s - The subject of the triples to match. If null or X then all subjects match.p - The predicate of the triple to add. If null or X then all predicates match.o - The object of the triple to add. If null or X then all objects match.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||