fr.gouv.culture.sdx.thesaurus
Interface SDXThesaurus

All Superinterfaces:
org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, DocumentBase, org.apache.avalon.framework.logger.LogEnabled, Searchable, Thesaurus, org.apache.cocoon.xml.XMLizable
All Known Implementing Classes:
LuceneThesaurus

public interface SDXThesaurus
extends Thesaurus, DocumentBase

Created by IntelliJ IDEA. User: rpandey Date: Feb 14, 2003 Time: 5:15:20 PM To change this template use Options | File Templates.


Field Summary
static java.lang.String ATTRIBUTE_ID
          String representation of the "thesaurus" attribute name "id".
static java.lang.String ATTRIBUTE_SRC
          String representation of the "thesaurus" attribute name "src".
static java.lang.String ATTRIBUTE_TYPE
          String representation of the "thesaurus" attribute name "type".
static java.lang.String CLASS_NAME_SUFFIX
          String representation of the thesaurus class name suffix.
static java.lang.String ELEMENT_NAME_THESAURI
          String representation of a name used in xml configurations
static java.lang.String ELEMENT_NAME_THESAURUS
          String representation of a name used in xml configurations
static java.lang.String PACKAGE_QUALNAME
          String representation of the thesarus package name (including trailing separator ".").
 
Fields inherited from interface fr.gouv.culture.sdx.thesaurus.Thesaurus
NAMESPACE_URI, RELATION_BROADER_TERM, RELATION_BROADER_TERMS, RELATION_EQUIVALENT_TERM, RELATION_NARROWER_TERM, RELATION_PARTIAL_EQIUVALENCE, RELATION_RELATED_TERM, RELATION_SCOPE_NOTE, RELATION_USE, RELATION_USED_FOR
 
Fields inherited from interface fr.gouv.culture.sdx.documentbase.DocumentBase
ELEMENT_NAME_DOCUMENT_BASE, ELEMENT_NAME_DOCUMENT_BASES
 
Method Summary
 void addConcept(Concept concept)
          Adds a document.
 void addConcepts(Concept[] concepts)
          Adds a group of documents.
 void build(org.xml.sax.InputSource source)
          Builds a thesaurus from a SAX input source.
 void build(java.lang.String url)
          Builds a thesaurus from a File.
 void deleteConcept(Concept concept)
          Remove a document.
 void deleteConcepts(Concept[] concepts)
          Remove a group of documents.
 Results expandQuery(Query query)
          Expands a query returning the results of the expanded query
 Results expandQuery(Query query, java.lang.String fieldName)
          Expands a query returning the results of the expanded query
 Results expandQuery(Query query, java.lang.String fieldName, int[] relations, int depth)
          Expands a query returning the results of the expanded query
 Results expandQuery(Query query, java.lang.String fieldName, int[] relations, int depth, java.lang.String[] langs)
          Expands a query returning the results of the expanded query
 Results expandQuery(Query query, java.lang.String fieldName, int relation, int depth)
          Expands a query returning the results of the expanded query
 Concept[] filterByLangs(Concept[] concepts, java.lang.String[] langs)
          Filters concepts by a list of languages
 Concept getConceptById(java.lang.String id)
          Returns a document using its id.
 Concept getConceptByName(java.lang.String name)
          Returns a document using its name.
 int getDefaultDepth()
          Return's the default depth for searching relations
 int[] getDefaultRelations()
          Return's the default set of relation int's for searching relations
 java.lang.String getId()
          Returns the id for this thesaurus
 Concept[] getRelations(Concept concept)
          Return's related concepts
 Concept[] getRelations(Concept[] concepts)
          Returns related concepts
 Concept[] getRelations(Concept[] concepts, int[] relations, int depth)
          Finds concepts for matching relations at a given depth
 Concept[] getRelations(Concept[] concepts, int[] relations, int depth, java.lang.String[] langs)
           
 Concept[] getRelations(Concept[] concepts, int relation, int depth)
          Finds concepts for matching relations at a given depth
 Concept[] getRelations(Concept[] concepts, int relation, int depth, java.lang.String[] langs)
           
 Concept[] getRelations(Concept concept, int[] relations, int depth)
          Finds concepts for matching relations at a given depth
 Concept[] getRelations(Concept concept, int[] relations, int depth, java.lang.String[] langs)
           
 Concept[] getRelations(Concept concept, int relation, int depth)
          Finds concepts for matching relations at a given depth
 Concept[] getRelations(Concept concept, int relation, int depth, java.lang.String[] langs)
           
 Concept[] getRelations(java.lang.String searchTerm, Concept[] concepts, int[] relations, int depth)
          Finds concepts for matching relations at a given depth
 Concept[] getRelations(java.lang.String searchTerm, Concept[] concepts, int relation, int depth)
          Finds concepts for matching relations at a given depth
 Concept[] getRelations(java.lang.String searchTerm, Concept concept, int[] relations, int depth)
          Finds concepts for matching relations at a given depth
 Concept[] getRelations(java.lang.String searchTerm, Concept concept, int relation, int depth)
          Finds concepts for matching relations at a given depth
 void init()
          Initializes the document base.
 void load()
          Loads a thesaurus in memory (later).
 void save()
          Saves the contents.
 Concept[] search(java.lang.String term)
          Searches for concepts.
 void setProperties(java.util.Hashtable props)
          Sets the properties object for the implementing class.
 long size()
          Returns the number of terms in the thesaurus.
 void unload()
          Unloads the memory representation of the thesaurus (later).
 
Methods inherited from interface fr.gouv.culture.sdx.thesaurus.Thesaurus
compile
 
Methods inherited from interface org.apache.cocoon.xml.XMLizable
toSAX
 
Methods inherited from interface org.apache.avalon.framework.configuration.Configurable
configure
 
Methods inherited from interface fr.gouv.culture.sdx.documentbase.DocumentBase
creationDate, delete, delete, getDefaultRepository, getDocument, getDocument, getDocument, getDocument, getIndexationPipeline, getMimeType, getOAIHarvester, getOAIRepository, getRepository, index, index, isDefault, lastModificationDate, setId
 
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled
enableLogging
 
Methods inherited from interface org.apache.avalon.framework.component.Composable
compose
 
Methods inherited from interface org.apache.avalon.framework.context.Contextualizable
contextualize
 
Methods inherited from interface fr.gouv.culture.sdx.search.Searchable
getIndex
 

Field Detail

ELEMENT_NAME_THESAURI

public static final java.lang.String ELEMENT_NAME_THESAURI
String representation of a name used in xml configurations

See Also:
Constant Field Values

ELEMENT_NAME_THESAURUS

public static final java.lang.String ELEMENT_NAME_THESAURUS
String representation of a name used in xml configurations

See Also:
Constant Field Values

ATTRIBUTE_SRC

public static final java.lang.String ATTRIBUTE_SRC
String representation of the "thesaurus" attribute name "src".

See Also:
Constant Field Values

PACKAGE_QUALNAME

public static final java.lang.String PACKAGE_QUALNAME
String representation of the thesarus package name (including trailing separator ".").

See Also:
Constant Field Values

CLASS_NAME_SUFFIX

public static final java.lang.String CLASS_NAME_SUFFIX
String representation of the thesaurus class name suffix.

See Also:
Constant Field Values

ATTRIBUTE_ID

public static final java.lang.String ATTRIBUTE_ID
String representation of the "thesaurus" attribute name "id".

See Also:
Constant Field Values

ATTRIBUTE_TYPE

public static final java.lang.String ATTRIBUTE_TYPE
String representation of the "thesaurus" attribute name "type".

See Also:
Constant Field Values
Method Detail

getId

public java.lang.String getId()
Returns the id for this thesaurus

Specified by:
getId in interface DocumentBase

init

public void init()
          throws SDXException,
                 org.apache.avalon.framework.configuration.ConfigurationException
Description copied from interface: DocumentBase
Initializes the document base.

This method must be called after the logger has been set and the configuration done.

Specified by:
init in interface DocumentBase
Throws:
SDXException
org.apache.avalon.framework.configuration.ConfigurationException

setProperties

public void setProperties(java.util.Hashtable props)
Description copied from interface: DocumentBase
Sets the properties object for the implementing class.

Specified by:
setProperties in interface DocumentBase
Parameters:
props - The desired properties object

build

public void build(java.lang.String url)
           throws SDXException,
                  org.apache.avalon.framework.configuration.ConfigurationException
Builds a thesaurus from a File.

Parameters:
url - The url to the file containing the thesaurus.
Throws:
SDXException
org.apache.avalon.framework.configuration.ConfigurationException

build

public void build(org.xml.sax.InputSource source)
           throws SDXException
Builds a thesaurus from a SAX input source.

Parameters:
source - The SAX input source where the thesaurus is.
Throws:
SDXException

size

public long size()
Returns the number of terms in the thesaurus.


save

public void save()
Saves the contents.


load

public void load()
Loads a thesaurus in memory (later).


unload

public void unload()
Unloads the memory representation of the thesaurus (later).


addConcept

public void addConcept(Concept concept)
                throws SDXException
Adds a document.

Parameters:
concept - The document to add.
Throws:
SDXException

addConcepts

public void addConcepts(Concept[] concepts)
                 throws SDXException
Adds a group of documents.

Parameters:
concepts - The documents to add.
Throws:
SDXException

deleteConcept

public void deleteConcept(Concept concept)
                   throws SDXException
Remove a document.

Parameters:
concept - The document.
Throws:
SDXException

deleteConcepts

public void deleteConcepts(Concept[] concepts)
                    throws SDXException
Remove a group of documents.

Parameters:
concepts - The documents.
Throws:
SDXException

search

public Concept[] search(java.lang.String term)
                 throws SDXException
Searches for concepts.

Parameters:
term - The concept term.
Throws:
SDXException

getConceptByName

public Concept getConceptByName(java.lang.String name)
                         throws SDXException
Returns a document using its name.

Parameters:
name - The document's name.
Throws:
SDXException

getConceptById

public Concept getConceptById(java.lang.String id)
                       throws SDXException
Returns a document using its id.

Parameters:
id - The document's id.
Throws:
SDXException

expandQuery

public Results expandQuery(Query query)
                    throws SDXException
Expands a query returning the results of the expanded query

Parameters:
query - The query object which should be expanded using this thesaurus
Returns:
A results object of the executed expanded query
Throws:
SDXException

expandQuery

public Results expandQuery(Query query,
                           java.lang.String fieldName)
                    throws SDXException
Expands a query returning the results of the expanded query

Parameters:
query - The query object which should be expanded using this thesaurus
fieldName - The name of field on which expansion should take place
Returns:
A results object of the executed expanded query
Throws:
SDXException

expandQuery

public Results expandQuery(Query query,
                           java.lang.String fieldName,
                           int relation,
                           int depth)
                    throws SDXException
Expands a query returning the results of the expanded query

Parameters:
query - The query object which should be expanded using this thesaurus
fieldName - The name of field on which expansion should take place
relation - The relation type, for finding terms which should be used to expand the query
depth - The depth to which a relation should be followed, 0 finds the relation withing the matching concept 1, finds the relation within concept for the matching relation found by the "0 case", etc.
Returns:
A results object of the executed expanded query
Throws:
SDXException

expandQuery

public Results expandQuery(Query query,
                           java.lang.String fieldName,
                           int[] relations,
                           int depth)
                    throws SDXException
Expands a query returning the results of the expanded query

Parameters:
query - The query object which should be expanded using this thesaurus
fieldName - The name of field on which expansion should take place
relations - The relation types, for finding terms which should be used to expand the query
depth - The depth to which a relation should be followed, 0 finds the relation withing the matching concept 1, finds the relation within concept for the matching relation found by the "0 case", etc. * @return A results object of the executed expanded query
Throws:
SDXException

expandQuery

public Results expandQuery(Query query,
                           java.lang.String fieldName,
                           int[] relations,
                           int depth,
                           java.lang.String[] langs)
                    throws SDXException
Expands a query returning the results of the expanded query

Parameters:
query - The query object which should be expanded using this thesaurus
fieldName - The name of field on which expansion should take place
relations - The relation types, for finding terms which should be used to expand the query
depth - The depth to which a relation should be followed, 0 finds the relation withing the matching concept 1, finds the relation within concept for the matching relation found by the "0 case", etc. * @return A results object of the executed expanded query
Throws:
SDXException

getRelations

public Concept[] getRelations(Concept concept,
                              int relation,
                              int depth)
                       throws SDXException
Finds concepts for matching relations at a given depth

Parameters:
concept - The concept from which relations should be used
relation - The relation type to search for with a concept
depth - The depth to which a relation should be evaluated, 0 finds the relation withing the matching concept 1, finds the relation within concept for the matching relation found by the "0 case", etc.
Returns:
Throws:
SDXException

getRelations

public Concept[] getRelations(Concept[] concepts,
                              int[] relations,
                              int depth)
                       throws SDXException
Finds concepts for matching relations at a given depth

Parameters:
concepts - The concepts from which relations should be used
relations - The relation types to search for with a concept
depth - The depth to which a relation should be evaluated, 0 finds the relation withing the matching concept 1, finds the relation within concept for the matching relation found by the "0 case", etc.
Returns:
Throws:
SDXException

getRelations

public Concept[] getRelations(Concept concept,
                              int[] relations,
                              int depth)
                       throws SDXException
Finds concepts for matching relations at a given depth

Parameters:
concept - The concept from which relations should be used
relations - The relation types to search for with a concept
depth - The depth to which a relation should be evaluated, 0 finds the relation withing the matching concept 1, finds the relation within concept for the matching relation found by the "0 case", etc.
Returns:
Throws:
SDXException

getRelations

public Concept[] getRelations(Concept[] concepts,
                              int relation,
                              int depth)
                       throws SDXException
Finds concepts for matching relations at a given depth

Parameters:
concepts - The concepts from which relations should be used
relation - The relation type to search for with a concept
depth - The depth to which a relation should be evaluated, 0 finds the relation withing the matching concept 1, finds the relation within concept for the matching relation found by the "0 case", etc.
Returns:
Throws:
SDXException

getRelations

public Concept[] getRelations(java.lang.String searchTerm,
                              Concept[] concepts,
                              int relation,
                              int depth)
                       throws SDXException
Finds concepts for matching relations at a given depth

Parameters:
searchTerm - The search term which was used to find the provided concepts
concepts - The concepts from which relations should be used
relation - The relation type to search for with a concept
depth - The depth to which a relation should be evaluated, 0 finds the relation withing the matching concept 1, finds the relation within concept for the matching relation found by the "0 case", etc.
Returns:
Throws:
SDXException

getRelations

public Concept[] getRelations(java.lang.String searchTerm,
                              Concept[] concepts,
                              int[] relations,
                              int depth)
                       throws SDXException
Finds concepts for matching relations at a given depth

Parameters:
searchTerm - The search term which was used to find the provided concepts
concepts - The concepts from which relations should be used
relations - The relation types to search for with a concept
depth - The depth to which a relation should be evaluated, 0 finds the relation withing the matching concept 1, finds the relation within concept for the matching relation found by the "0 case", etc.
Returns:
Throws:
SDXException

getRelations

public Concept[] getRelations(java.lang.String searchTerm,
                              Concept concept,
                              int relation,
                              int depth)
                       throws SDXException
Finds concepts for matching relations at a given depth

Parameters:
searchTerm - The search term which was used to find the provided concept
concept - The concept from which relations should be used
relation - The relation type to search for with a concept
depth - The depth to which a relation should be evaluated, 0 finds the relation withing the matching concept 1, finds the relation within concept for the matching relation found by the "0 case", etc.
Returns:
Throws:
SDXException

getRelations

public Concept[] getRelations(java.lang.String searchTerm,
                              Concept concept,
                              int[] relations,
                              int depth)
                       throws SDXException
Finds concepts for matching relations at a given depth

Parameters:
searchTerm - The search term which was used to find the provided concepts
concept - The concepts from which relations should be used
relations - The relation types to search for with a concept
depth - The depth to which a relation should be evaluated, 0 finds the relation withing the matching concept 1, finds the relation within concept for the matching relation found by the "0 case", etc.
Returns:
Throws:
SDXException

getRelations

public Concept[] getRelations(Concept concept,
                              int[] relations,
                              int depth,
                              java.lang.String[] langs)
                       throws SDXException
Throws:
SDXException

getRelations

public Concept[] getRelations(Concept[] concepts,
                              int[] relations,
                              int depth,
                              java.lang.String[] langs)
                       throws SDXException
Throws:
SDXException

getRelations

public Concept[] getRelations(Concept concept,
                              int relation,
                              int depth,
                              java.lang.String[] langs)
                       throws SDXException
Throws:
SDXException

getRelations

public Concept[] getRelations(Concept[] concepts,
                              int relation,
                              int depth,
                              java.lang.String[] langs)
                       throws SDXException
Throws:
SDXException

getRelations

public Concept[] getRelations(Concept[] concepts)
                       throws SDXException
Returns related concepts

Parameters:
concepts - The concepts for which relations are desired
Returns:
Throws:
SDXException

getRelations

public Concept[] getRelations(Concept concept)
                       throws SDXException
Return's related concepts

Parameters:
concept - The concept for which relations are desired
Returns:
Throws:
SDXException

getDefaultDepth

public int getDefaultDepth()
Return's the default depth for searching relations


getDefaultRelations

public int[] getDefaultRelations()
Return's the default set of relation int's for searching relations


filterByLangs

public Concept[] filterByLangs(Concept[] concepts,
                               java.lang.String[] langs)
Filters concepts by a list of languages

Parameters:
concepts - List of concepts for filtering
langs - List of langauages (in xml:lang format) which are desired
Returns:


Copyright © 2000-2004 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.