de.jwg.dbis.rdf.rdfs3.storage.insert
Class RDFInsert

java.lang.Object
  |
  +--de.jwg.dbis.rdf.rdfs3.storage.insert.RDFInsert
Direct Known Subclasses:
StreamBasedInsert

public class RDFInsert
extends java.lang.Object

Description: The class for coordinating basic functions for inserting rdf into the database.

Version:
1.7
Author:
KarstenTolle

Constructor Summary
RDFInsert()
           
 
Method Summary
 void enter_namespace_cache(java.lang.String uri, int id)
           
 void enter_resource_cache(java.lang.String uri, int id)
           
 int get_max_ns_id()
           
 int get_max_res_id()
           
 int get_max_source_id()
           
 int getDBID(java.lang.String uri)
          Returns the resource id for the given uri.
 int getDBID(java.lang.String uri, java.lang.String id_name, java.lang.String table, java.lang.String col)
          Returns the id for the resource with the given uri from the given table.
 int getMax_namespace_cache_size()
           
 int getMax_resource_cache_size()
           
 int getNS_id(java.lang.String url)
          Returns the namespace id for the given url.
 boolean getSimple_sql()
           
 boolean initTest()
           
 boolean insert(java.lang.String url)
           
 boolean insert(java.lang.String url, boolean init, java.lang.String content)
          This methode will start the insertion process.
 void insertP(int s_id, int o_id, java.lang.String table)
          A shortcut method to insert into a property table.
 void setMax_namespace_cache_size(int i)
           
 void setMax_resource_cache_size(int i)
           
 void setSource(java.lang.String url)
           
 int storeNamespace(java.lang.String url)
          Includes the namespace url into the namespaces table.
 void storeSource_usage(int res_id)
          Stores that the given resource was used inside the given source.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RDFInsert

public RDFInsert()
Method Detail

getSimple_sql

public boolean getSimple_sql()

get_max_ns_id

public int get_max_ns_id()

get_max_source_id

public int get_max_source_id()

get_max_res_id

public int get_max_res_id()

storeSource_usage

public void storeSource_usage(int res_id)
Stores that the given resource was used inside the given source.

Parameters:
res_id - The id of the resource that is used in the given source.

getDBID

public int getDBID(java.lang.String uri)
Returns the resource id for the given uri.

Parameters:
uri - The uri of the resource.
Returns:
Returns the id for the given uri (resource).

getNS_id

public int getNS_id(java.lang.String url)
Returns the namespace id for the given url.

Parameters:
url - The url of the namespace.
Returns:
Returns the id for the given namespace url.

getDBID

public int getDBID(java.lang.String uri,
                   java.lang.String id_name,
                   java.lang.String table,
                   java.lang.String col)
Returns the id for the resource with the given uri from the given table.

Parameters:
uri - The uri or url for the resource or namespace/source.
table - The table we request.
col - The column we want to compare with.
id_name - The name for the id column (id for resources, ns_id for namespaces and source_id for sources).
Returns:
Returns the id.

enter_resource_cache

public void enter_resource_cache(java.lang.String uri,
                                 int id)

enter_namespace_cache

public void enter_namespace_cache(java.lang.String uri,
                                  int id)

setSource

public void setSource(java.lang.String url)

storeNamespace

public int storeNamespace(java.lang.String url)
Includes the namespace url into the namespaces table.

Parameters:
url - The url of the namespace.

insertP

public void insertP(int s_id,
                    int o_id,
                    java.lang.String table)
A shortcut method to insert into a property table.

Parameters:
s_id - The subject id.
o_id - The object id.
table - The table that will be entered.
Returns:
Returns true if statement was executed successful.

initTest

public boolean initTest()

insert

public boolean insert(java.lang.String url)

insert

public boolean insert(java.lang.String url,
                      boolean init,
                      java.lang.String content)
This methode will start the insertion process.

Parameters:
url - The URL of the file to be inserted. (Might contain wildcards!)
init - For the initialization the RDF and RDFS namespaces are entered as an string representation contained in the content variable. Therefore this boolean needs to be set to true.
content - The RDF/XML string representation in case the variable init is set to true.

setMax_namespace_cache_size

public void setMax_namespace_cache_size(int i)
Parameters:
i -

setMax_resource_cache_size

public void setMax_resource_cache_size(int i)
Parameters:
i -

getMax_namespace_cache_size

public int getMax_namespace_cache_size()
Returns:

getMax_resource_cache_size

public int getMax_resource_cache_size()
Returns: