Antidot PHP API  version 0.16.0
##PHP API to simplify integration of Antidot components
 All Classes Files Functions Variables Groups Pages
Public Member Functions | List of all members
AfsConceptItem Class Reference

Concept item. More...

Public Member Functions

 __construct ($item, $concepts)
 Constructs new concept item.
 get_text ()
 Retrieves text of the item.
 has_concept ()
 Check whether current item has a concept.
 get_data ()
 Retrieves concept data associated to current item.

Detailed Description

Concept item.

Concept results are made of one or more concept items. Concept items can have no data, one data or even multiple data attached to them.

Constructor & Destructor Documentation

__construct (   $item,
  $concepts 
)

Constructs new concept item.

Parameters
$item[in] new values to initialize the instance with.
$concepts[in] buffer of concept data (read only).
Exceptions
Exceptionwhen invalid/unrecognized data has been provided.

Member Function Documentation

get_data ( )

Retrieves concept data associated to current item.

Data are store as key/value pairs. Keys correspond to the URI of the concept. Values correspond to XML data of the concept.

Remarks
to avoid getting empty data, check whether concept is available for current item by calling has_concept.
Returns
key/value map of URI/concept or null when no concept matches the item text.
get_text ( )

Retrieves text of the item.

Returns
text of the item.
has_concept ( )

Check whether current item has a concept.

For multi-words queries, no, one or more words can match one or more concepts. So, this method allow to check whether current item has binded concept(s) or not.

Returns
True when current item has at least one binded concept, false otherwise.