info.aduna.infosource.crawl
Class RepositoryAccessData

java.lang.Object
  extended by info.aduna.infosource.crawl.RepositoryAccessData
All Implemented Interfaces:
org.semanticdesktop.aperture.accessor.AccessData

public class RepositoryAccessData
extends Object
implements org.semanticdesktop.aperture.accessor.AccessData

RepositoryAccessData provides an AccessData implementation storing its information to and retrieving it from a Repository.

This implementation assumes that IDs used to store data are valid URIs and that keys contain only characters that can be used in URIs.

The AccessData.DATE_KEY, AccessData.BYTE_SITE_KEY and AccessData.REDIRECTS_TO_KEY keys are mapped to NIE predicates. In that case the value must be a long encoded as a String or, in the last case, a URL encoded as a String.


Field Summary
static String URI_PREFIX
          Used as a prefix to derive URIs from AccessData key names.
 
Fields inherited from interface org.semanticdesktop.aperture.accessor.AccessData
BYTE_SIZE_KEY, DATE_KEY, REDIRECTS_TO_KEY
 
Constructor Summary
RepositoryAccessData(org.openrdf.repository.RepositoryConnection connection, org.openrdf.model.Resource context)
          Creates a new RepositoryAccessData instance.
 
Method Summary
 void clear()
           
 String get(String id, String key)
           
 Set<String> getReferredIDs(String id)
           
 int getSize()
          Warning: expensive operation, as this implementation queries for all unique subjects used in this RepositoryAccessData's context.
 Set<String> getStoredIDs()
           
 void initialize()
           
 boolean isKnownId(String id)
           
 void put(String id, String key, String value)
           
 void putReferredID(String id, String referredID)
           
 void remove(String id)
           
 void remove(String id, String key)
           
 void removeReferredID(String id, String referredID)
           
 void removeReferredIDs(String id)
           
 void store()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URI_PREFIX

public static final String URI_PREFIX
Used as a prefix to derive URIs from AccessData key names.

See Also:
Constant Field Values
Constructor Detail

RepositoryAccessData

public RepositoryAccessData(org.openrdf.repository.RepositoryConnection connection,
                            org.openrdf.model.Resource context)
                     throws org.openrdf.repository.RepositoryException
Creates a new RepositoryAccessData instance.

Parameters:
connection - The RepositoryConnection used to store all access data in and retrieve all data from. This cannot be null.
context - The context used to mark all statements handled by this RepositoryAccessData. This is allowed to be null.
Throws:
org.openrdf.repository.RepositoryException
Method Detail

clear

public void clear()
           throws IOException
Specified by:
clear in interface org.semanticdesktop.aperture.accessor.AccessData
Throws:
IOException

get

public String get(String id,
                  String key)
Specified by:
get in interface org.semanticdesktop.aperture.accessor.AccessData

getReferredIDs

public Set<String> getReferredIDs(String id)
Specified by:
getReferredIDs in interface org.semanticdesktop.aperture.accessor.AccessData

getSize

public int getSize()
Warning: expensive operation, as this implementation queries for all unique subjects used in this RepositoryAccessData's context.

Specified by:
getSize in interface org.semanticdesktop.aperture.accessor.AccessData

getStoredIDs

public Set<String> getStoredIDs()
Specified by:
getStoredIDs in interface org.semanticdesktop.aperture.accessor.AccessData

initialize

public void initialize()
                throws IOException
Specified by:
initialize in interface org.semanticdesktop.aperture.accessor.AccessData
Throws:
IOException

isKnownId

public boolean isKnownId(String id)
Specified by:
isKnownId in interface org.semanticdesktop.aperture.accessor.AccessData

put

public void put(String id,
                String key,
                String value)
Specified by:
put in interface org.semanticdesktop.aperture.accessor.AccessData

putReferredID

public void putReferredID(String id,
                          String referredID)
Specified by:
putReferredID in interface org.semanticdesktop.aperture.accessor.AccessData

remove

public void remove(String id,
                   String key)
Specified by:
remove in interface org.semanticdesktop.aperture.accessor.AccessData

remove

public void remove(String id)
Specified by:
remove in interface org.semanticdesktop.aperture.accessor.AccessData

removeReferredID

public void removeReferredID(String id,
                             String referredID)
Specified by:
removeReferredID in interface org.semanticdesktop.aperture.accessor.AccessData

removeReferredIDs

public void removeReferredIDs(String id)
Specified by:
removeReferredIDs in interface org.semanticdesktop.aperture.accessor.AccessData

store

public void store()
           throws IOException
Specified by:
store in interface org.semanticdesktop.aperture.accessor.AccessData
Throws:
IOException


Copyright © 1997-2008 Aduna. All Rights Reserved.