fr.gouv.culture.sdx.thesaurus
Interface SDXThesaurus

All Superinterfaces:
org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, Describable, DocumentBase, Encodable, Identifiable, Localizable, org.apache.avalon.framework.logger.LogEnabled, Saveable, SdxObject, Searchable, org.apache.avalon.framework.service.Serviceable, Thesaurus, org.apache.excalibur.xml.sax.XMLizable
All Known Implementing Classes:
AbstractThesaurus, LuceneThesaurus

public interface SDXThesaurus
extends Thesaurus, DocumentBase


Nested Class Summary
static interface SDXThesaurus.ConfigurationNode
           
 
Field Summary
static java.lang.String CLASS_NAME_SUFFIX
          String representation of the thesaurus class name suffix.
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_PREFIX, 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.utils.Encodable
DEFAULT_ENCODING
 
Fields inherited from interface fr.gouv.culture.sdx.utils.save.Saveable
ALL_SAVE_ATTRIB, PATH_ATTRIB, SAVE_DIRECTORY_PARAM
 
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
 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.
 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, getRelationTypeAbbreviation, getRelationTypeInt
 
Methods inherited from interface fr.gouv.culture.sdx.documentbase.DocumentBase
checkIntegrity, createOAIRepository, creationDate, delete, delete, getDefaultHitsPerPage, getDefaultMaxSort, getDefaultRepository, getDocument, getDocument, getDocument, getDocument, getIndexationPipeline, getMimeType, getOAIHarvester, getOAIRepositoriesSize, getOAIRepository, getOAIRepository, getRepository, getSourceValidity, index, index, isDefault, lastModificationDate, optimize
 
Methods inherited from interface fr.gouv.culture.sdx.utils.SdxObject
getLog
 
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled
enableLogging
 
Methods inherited from interface org.apache.avalon.framework.context.Contextualizable
contextualize
 
Methods inherited from interface org.apache.avalon.framework.service.Serviceable
service
 
Methods inherited from interface org.apache.avalon.framework.configuration.Configurable
configure
 
Methods inherited from interface fr.gouv.culture.sdx.utils.Identifiable
getId, setId
 
Methods inherited from interface fr.gouv.culture.sdx.utils.Describable
getDescription, setDescription
 
Methods inherited from interface fr.gouv.culture.sdx.utils.Encodable
getEncoding, setEncoding
 
Methods inherited from interface fr.gouv.culture.sdx.utils.Localizable
getLocale, getXmlLang, setLocale, setXmlLang
 
Methods inherited from interface org.apache.excalibur.xml.sax.XMLizable
toSAX
 
Methods inherited from interface fr.gouv.culture.sdx.search.Searchable
getId, getIndex
 
Methods inherited from interface fr.gouv.culture.sdx.utils.save.Saveable
backup, restore
 

Field Detail

PACKAGE_QUALNAME

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

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

See Also:
Constant Field Values
Method Detail

init

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 super.getLog() has been set and the configuration done.

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

build

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

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

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


save

void save()
Saves the contents.


load

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


unload

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


addConcept

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

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

addConcepts

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

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

deleteConcept

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

Parameters:
concept - The document.
Throws:
SDXException

deleteConcepts

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

Parameters:
concepts - The documents.
Throws:
SDXException

search

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

Parameters:
term - The concept term.
Throws:
SDXException

getConceptByName

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

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

getConceptById

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

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

expandQuery

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

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

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

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

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

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

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

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

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

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

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

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

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

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

getRelations

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

getRelations

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

getRelations

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

getRelations

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

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

getRelations

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

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

getDefaultDepth

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


getDefaultRelations

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


filterByLangs

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-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.