|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface G
Interface of a multi directed Graph defined as a set of vertices and a set of
oriented edges. Vertices are identified by URI
, edge by a triplet
subject predicate object (s,p,o) of URIs. The model doesn't support multiple
edges s,p,o of the same predicate (p), see E
interface.
The main aim is to provide an easy to use graph model to manipulate semantic
graphs composed of classes (concept) and instances identified by URIs. The
classes and instances can established semantic relationships through
triplets. All the vertices of the graph are uniquely identified by URIs, we
therefore sometimes refer to an URIs corresponding to a vertex through the
term vertex.
This graph is not RDF compliant as it doesn't support values such as Literals
or blank nodes.
In the documentation of this class we refer to a triplet or URIs through the
term edge. An edge is therefore a statement in which the subject, the
predicate and the object are URIs. The subject of the edge is called the
source, the predicate is sometimes called the type of the edge, and the
object is called the target.
URI
,
E
,
Direction
,
WalkConstraint
Method Summary | |
---|---|
void |
addE(E e)
Add the given edge to the graph |
void |
addE(org.openrdf.model.URI src,
org.openrdf.model.URI type,
org.openrdf.model.URI target)
Add an edge of the given type (URI) between the specified source and target. |
void |
addEdges(Set<E> e)
Add the given set of edges of the graph |
void |
addV(Set<org.openrdf.model.URI> v)
Add the given set of vertices to the graph. |
void |
addV(org.openrdf.model.URI v)
Add the given vertex to the graph. |
boolean |
containsVertex(org.openrdf.model.URI v)
Check if the graph contains a Vertex associated to the given Value. |
Set<E> |
getE()
Access to a view of the set of edges contained in the graph. |
Set<E> |
getE(Set<org.openrdf.model.URI> types)
Retrieve a view of all edges characterized by one of specified predicate URIs. |
Set<E> |
getE(Set<org.openrdf.model.URI> predicates,
org.openrdf.model.URI source,
Direction dir)
Retrieve a view of all edges of the graph characterized by the constraint. |
Set<E> |
getE(org.openrdf.model.URI predicate)
Retrieve a view of all edges characterized by the specified URI predicate. |
Set<E> |
getE(org.openrdf.model.URI v,
Direction dir)
Access to a view of all edges involving a specific vertex considering a particular direction. |
Set<E> |
getE(org.openrdf.model.URI predicate,
org.openrdf.model.URI v,
Direction dir)
Retrieve a view of all edges of the graph characterized by the specified constraint. |
Set<E> |
getE(org.openrdf.model.URI v,
WalkConstraint wc)
Retrieve a view of all edges of the graph which can be reached from a given vertex respecting the given constraint. |
int |
getNumberEdges()
|
int |
getNumberVertices()
Return the number of vertices |
org.openrdf.model.URI |
getURI()
|
Set<org.openrdf.model.URI> |
getV()
|
Set<org.openrdf.model.URI> |
getV(org.openrdf.model.URI v,
org.openrdf.model.URI predicate,
Direction dir)
Return all neighbors vertices of a given vertex considering a particular direction and URI predicate. |
Set<org.openrdf.model.URI> |
getV(org.openrdf.model.URI v,
WalkConstraint wc)
Retrieve view of all vertices of the graph which can be reached from a given vertex respecting the given constraint. |
void |
removeE(E e)
Used to remove an Edge of the graph |
void |
removeE(Set<E> e)
Used to remove a set of edges of the graph |
void |
removeE(org.openrdf.model.URI t)
Used to remove all edges of a specific type (predicate). |
void |
removeV(Set<org.openrdf.model.URI> setV)
Remove all specified vertices. |
void |
removeV(org.openrdf.model.URI v)
Remove the given vertex to the graph. |
Method Detail |
---|
Set<E> getE()
Set<E> getE(org.openrdf.model.URI v, Direction dir)
v
- the vertex of interestdir
- the direction to consider i.e. IN, OUT or BOTH, see
Direction
Set<E> getE(org.openrdf.model.URI predicate)
predicate
- the predicate URI of interest
Set<E> getE(Set<org.openrdf.model.URI> types)
types
- the set of predicate URIs of interest
Set<E> getE(org.openrdf.model.URI predicate, org.openrdf.model.URI v, Direction dir)
predicate
- the predicate URI of the edges of interestv
- the vertex of interestdir
- the direction to consider
Set<E> getE(Set<org.openrdf.model.URI> predicates, org.openrdf.model.URI source, Direction dir)
predicates
- the set of predicate URIs to consider.source
- the vertex of interestdir
- the direction to consider
Set<E> getE(org.openrdf.model.URI v, WalkConstraint wc)
v
- the vertex of interestwc
- the object defining the constraint
Set<org.openrdf.model.URI> getV(org.openrdf.model.URI v, WalkConstraint wc)
v
- the vertex of interestwc
- the object defining the constraint
void addE(org.openrdf.model.URI src, org.openrdf.model.URI type, org.openrdf.model.URI target)
src
- the source of the edge (not null)type
- the predicate URI of the edge to create (not null)target
- the target of the edge (not null)void addE(E e)
e
- an edgevoid addEdges(Set<E> e)
e
- a set of edgesvoid removeE(E e)
e
- the edge to removevoid removeE(org.openrdf.model.URI t)
t
- the type (predicate) of the edges to removevoid removeE(Set<E> e)
e
- a set of edgesvoid addV(org.openrdf.model.URI v)
v
- the vertex to addvoid addV(Set<org.openrdf.model.URI> v)
v
- the set of verticesvoid removeV(org.openrdf.model.URI v)
v
- The vertex to removevoid removeV(Set<org.openrdf.model.URI> setV)
setV
- The set of vertices to removeboolean containsVertex(org.openrdf.model.URI v)
v
- the value to test
V#equals(Object)
Set<org.openrdf.model.URI> getV()
int getNumberVertices()
int getNumberEdges()
Set<org.openrdf.model.URI> getV(org.openrdf.model.URI v, org.openrdf.model.URI predicate, Direction dir)
v
- the focusing vertexpredicate
- the URI of the edges to considerdir
- the direction to consider
org.openrdf.model.URI getURI()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |