it.unimi.dico.islab.idbs2.kc
Class Document

java.lang.Object
  extended by it.unimi.dico.islab.idbs2.kc.Document

public class Document
extends Object

Representation of the source of a KnowledgeChunk extraction. The following image shows the relations between the fields of this object and the fields of the wrapped database table (fields with the same color represents a mapping between relational schema and the corresponding object).


Author:
Vegeziel
See Also:
DocumentExtraction

Constructor Summary
protected Document()
          Constructor needed for Hibernate compatibility.
  Document(String url)
          Main constructor of the Document class.
 
Method Summary
 Set<DocumentExtraction> getBelongingExtractions()
          Getter for the KnowledgeChunk instances belonging to this document.
 Set<KnowledgeChunk> getBelongingKnowledgeChunks()
          This is just an overloading method for getBelongingKnowledgeChunks(String ...)
 Set<KnowledgeChunk> getBelongingKnowledgeChunks(String... types)
          This method is used to bypass the DocumentExtracion wrapper in order to obtain directly a Set of KnowledgeChunks.
 String getUri()
          Getter for the URI field.
 String getUrl()
          Getter for the URL field.
 boolean isLocal()
          Getter for isLocal field.
 void setLocal(boolean local)
          Setter for isLocal field.
 void setUri(String uri)
          Setter for the URI field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Document

protected Document()

Constructor needed for Hibernate compatibility. Direct use is discouraged, use the KnowledgeChunk.addDocument instead.

See Also:
KnowledgeChunk.addDocument(Document)

Document

public Document(String url)

Main constructor of the Document class.

Parameters:
url - Identifier of this document. Usually represented by the URL of the archive used for the kcs extraction or a string representing the used query.
Method Detail

getBelongingKnowledgeChunks

public Set<KnowledgeChunk> getBelongingKnowledgeChunks(String... types)
This method is used to bypass the DocumentExtracion wrapper in order to obtain directly a Set of KnowledgeChunks.

Parameters:
types - the list of all the required kc types.
Returns:
the set of all KCs belonging to this document having a type included in the types param.

getBelongingKnowledgeChunks

public Set<KnowledgeChunk> getBelongingKnowledgeChunks()
This is just an overloading method for getBelongingKnowledgeChunks(String ...).

Returns:
the set of all KCs belonging to this document.
See Also:
getBelongingKnowledgeChunks(String...)

getUrl

public String getUrl()

Getter for the URL field.

Returns:
The identifier of this document.

getUri

public String getUri()

Getter for the URI field.

Returns:
the Uniform Resource Identifier for this document (URL could be a generic id).

setUri

public void setUri(String uri)

Setter for the URI field.

Parameters:
uri - the Uniform Resource Identifier for this document.

getBelongingExtractions

public Set<DocumentExtraction> getBelongingExtractions()
Getter for the KnowledgeChunk instances belonging to this document.

Returns:
a Set of all knowledge chunks connected to this document.

isLocal

public boolean isLocal()

Getter for isLocal field.


setLocal

public void setLocal(boolean local)

Setter for isLocal field.