eRqlEngine API documentation - http://www.wleklinski.de/rdf/

gr.forth.ics.vrp.corevrp.model
Class RDF_DAG

java.lang.Object
  extended bygr.forth.ics.vrp.corevrp.model.RDF_DAG

public class RDF_DAG
extends Object

RDF_DAG.java - DAG stands for Directed Acyclic Graph. This class has been generated to describe the Directed Acyclic Graph for classes and properties in respect to the subClass and subProperty relations. It consists of a HashMap containing the Objects as key and the corresponding sub resources are in a HashSet as the value. The graph might consist of several parts that are not connected. To enable an easy traversal the roots are stored in a seperate ArrayList.

Version:
2.5 (30 Januar 2003)
Author:
Karsten Tolle & Sofia Alexaki

Field Summary
 HashMap dag
          Containing the elements of the adjazenz list.
 
Constructor Summary
RDF_DAG()
          Create a new RDF_DAG.
 
Method Summary
 void enter(Object sub, Object super_res, boolean resource)
           
 void enter(Resource s)
           
 void enter(Resource sub, Resource super_res)
           
 void enter(String s)
           
 void enter(String sub, String super_res)
           
 void enumerate()
          Print the DAG-Graph to Std IO.
 HashSet findRoots()
          Recompute the roots, i.e., the nodes without ancestors based on the information
 void getAllAncestors()
          Computes the distinct ancestors for all nodes contained in the dag and put the number of the descendants in the dag
 void getAllDescendants(Resource res)
          Computes the distinct descendants for all nodes under the node and put the number of the descendants in the dag
 HashMap getdag()
           
 HashSet getLeaves()
          Find the leaves, i.e., the nodes without descendants based on the information
 ArrayList getloop_element()
           
 boolean getno_loop()
           
 ArrayList getorder()
          Accessing the order.
 HashSet getRelatives(Resource res, int i)
          Returns a HashSet containing all the distinct relatives of a node res
 HashSet getroots()
           
 boolean loopcheck()
          Checking the graph for loops and creating the topological order list.
 String output()
          Return a string containing the topological order of the DAG.
 boolean remove(Object sub, Object super_res, boolean resource)
           
 boolean remove(Resource res)
           
 boolean remove(Resource sub, Resource super_res)
          Tries to remove the link from 'sub' to 'superResource' out of the DAG.
 boolean remove(String sub, String super_res)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dag

public HashMap dag
Containing the elements of the adjazenz list.

Constructor Detail

RDF_DAG

public RDF_DAG()
Create a new RDF_DAG. We are creating an adjazenz list here.

Method Detail

getorder

public ArrayList getorder()
Accessing the order.


getroots

public HashSet getroots()
Returns:
The roots of the dag

getloop_element

public ArrayList getloop_element()

getno_loop

public boolean getno_loop()

getdag

public HashMap getdag()

enter

public void enter(String sub,
                  String super_res)

enter

public void enter(Resource sub,
                  Resource super_res)

enter

public void enter(Object sub,
                  Object super_res,
                  boolean resource)

enter

public void enter(String s)

enter

public void enter(Resource s)

remove

public boolean remove(Resource sub,
                      Resource super_res)
Tries to remove the link from 'sub' to 'superResource' out of the DAG.


remove

public boolean remove(String sub,
                      String super_res)

remove

public boolean remove(Resource res)

remove

public boolean remove(Object sub,
                      Object super_res,
                      boolean resource)

enumerate

public void enumerate()
Print the DAG-Graph to Std IO.


loopcheck

public boolean loopcheck()
Checking the graph for loops and creating the topological order list. Returns true if there is no loop, otherwide it will return false


output

public String output()
Return a string containing the topological order of the DAG.


getLeaves

public HashSet getLeaves()
Find the leaves, i.e., the nodes without descendants based on the information


findRoots

public HashSet findRoots()
Recompute the roots, i.e., the nodes without ancestors based on the information


getRelatives

public HashSet getRelatives(Resource res,
                            int i)
Returns a HashSet containing all the distinct relatives of a node res

Parameters:
res - the node reference
i - When it is set to 0 it computes the distinct descendants of the node. When it is set to 1 computes the distinct ancestors

getAllDescendants

public void getAllDescendants(Resource res)
Computes the distinct descendants for all nodes under the node and put the number of the descendants in the dag


getAllAncestors

public void getAllAncestors()
Computes the distinct ancestors for all nodes contained in the dag and put the number of the descendants in the dag


eRqlEngine API documentation - http://www.wleklinski.de/rdf/