libcsem  0.2
csem_rdfa_tree.h File Reference
#include "csem_tree.h"
#include "csem_url.h"

Go to the source code of this file.

Defines

#define CSEM_NS_C_BEGIN
#define CSEM_NS_C_END

Typedefs

typedef typedefCSEM_NS_C_BEGIN
struct CSEM_Item 
CSEM_Item
 Item object.
typedef struct CSEM_Property CSEM_Property
 Property object defined with @itemprop of microdata, or defined with @property of RDFa Lite.

Enumerations

enum  CSEM_VALUE_TYPE { CSEM_VALUE_TYPE_STR = 0, CSEM_VALUE_TYPE_URL, CSEM_VALUE_TYPE_ITEM, CSEM_VALUE_TYPE_PROPERTY }
 Types of property value. More...

Functions

CSEM_Error CSEM_Item_Create (CSEM_Item **item)
 Create an item object.
void CSEM_Item_Dispose (CSEM_Item *item)
 Dispose an item object.
CSEM_UrlCSEM_Item_GetId (CSEM_Item *item)
 Get the unique identification of the item.
CSEM_Error CSEM_Item_SetId (CSEM_Item *item, const CSEM_Url *id, CSEM_Bool free)
 Set a unique identification of the item.
CSEM_ListCSEM_Item_GetTypes (const CSEM_Item *item)
 Get the type values of the item.
CSEM_Error CSEM_Item_SetTypes (CSEM_Item *item, const CSEM_List *types, CSEM_Bool free)
 Set type values of the item.
CSEM_ListCSEM_Item_GetProperties (const CSEM_Item *item)
 Get properties of the item.
CSEM_Error CSEM_Item_GetNamedPropertes (const CSEM_Item *item, const char *name, CSEM_List **properties)
 Get properties whose name is equal to the specified name.
CSEM_Error CSEM_Item_AddProperty (CSEM_Item *item, CSEM_Property *property, CSEM_Bool changeParent)
 Add a property to the item.
CSEM_Error CSEM_Property_Create (CSEM_Property **property, CSEM_List *names)
 Create a property object which has the specified property names.
void CSEM_Property_Dispose (CSEM_Property *property)
 Dispose a property object.
CSEM_ListCSEM_Property_GetNames (CSEM_Property *property)
 Get names of the property.
CSEM_Error CSEM_Property_GetValues (CSEM_Property *property, CSEM_List **values, CSEM_List **valueTypes)
 Get values and the types of the values of the specified property.
CSEM_Error CSEM_Property_AddValues (CSEM_Property *property, void *value, CSEM_VALUE_TYPE type)
 Add a value to the property.
CSEM_Error CSEM_Properties_GetValues (CSEM_List *properties, CSEM_List **values, CSEM_List **valueTypes)
 Get values and the types of the values of the specified properties.
CSEM_Error CSEM_Document_GetItems (CSEM_Document *doc, CSEM_List *types, CSEM_List **items)
 Get top-level items which have all of the specified types.

Define Documentation

#define CSEM_NS_C_BEGIN
#define CSEM_NS_C_END

Typedef Documentation

typedef typedefCSEM_NS_C_BEGIN struct CSEM_Item CSEM_Item

Item object.

typedef struct CSEM_Property CSEM_Property

Property object defined with @itemprop of microdata, or defined with @property of RDFa Lite.


Enumeration Type Documentation

Types of property value.

Enumerator:
CSEM_VALUE_TYPE_STR 

String.

CSEM_VALUE_TYPE_URL 

URL.

CSEM_VALUE_TYPE_ITEM 

Item.

CSEM_VALUE_TYPE_PROPERTY 

Property.


Function Documentation

CSEM_Error CSEM_Document_GetItems ( CSEM_Document doc,
CSEM_List types,
CSEM_List **  items 
)

Get top-level items which have all of the specified types.

@itemtype of microdata or @typeof of RDFa Lite.

Parameters:
doc[in]document object
types[in]type values
items[out]matched items (application need to free with CSEM_List_Dispose(items, CSEM_FALSE))
Returns:
error code
Examples:
sample_micro_search.c, and sample_rdfa_search.c.
CSEM_Error CSEM_Item_AddProperty ( CSEM_Item item,
CSEM_Property property,
CSEM_Bool  changeParent 
)

Add a property to the item.

Parameters:
item[in]item
property[in]property to be added
changeParent[in]flag whether the property keeps current relationship with parent
Returns:
error code

Create an item object.

Parameters:
item[out]item object to be created
Returns:
error code
void CSEM_Item_Dispose ( CSEM_Item item)

Dispose an item object.

Parameters:
item[in]item object to be freed

Get the unique identification of the item.

@itemid of microdata or @resource of RDFa Lite

Parameters:
item[in]item
Examples:
sample_micro_search.c, sample_micro_tree.c, sample_rdfa_search.c, and sample_rdfa_tree.c.
CSEM_Error CSEM_Item_GetNamedPropertes ( const CSEM_Item item,
const char *  name,
CSEM_List **  properties 
)

Get properties whose name is equal to the specified name.

Parameters:
item[in]item
name[in]name to be tested
properties[out]matched properties (applications need to free with CSEM_List_Dispose(properties, CSEM_FALSE))
Returns:
error code
Examples:
sample_micro_search.c, and sample_rdfa_search.c.

Get properties of the item.

Parameters:
item[in]item
Examples:
sample_micro_search.c, sample_micro_tree.c, sample_rdfa_search.c, and sample_rdfa_tree.c.

Get the type values of the item.

@itemtype of microdata or @typeof of RDFa Lite.

Parameters:
item[in]item
Examples:
sample_micro_search.c, sample_micro_tree.c, sample_rdfa_search.c, and sample_rdfa_tree.c.
CSEM_Error CSEM_Item_SetId ( CSEM_Item item,
const CSEM_Url id,
CSEM_Bool  free 
)

Set a unique identification of the item.

@itemid of microdata or @resource of RDFa Lite.

Parameters:
item[in]item
id[in]id
free[in]if CSEM_TRUE is set, the old value is freed.
Returns:
error code
CSEM_Error CSEM_Item_SetTypes ( CSEM_Item item,
const CSEM_List types,
CSEM_Bool  free 
)

Set type values of the item.

@itemtype of microdata or @typeof of RDFa Lite.

Parameters:
item[in]item
types[in]type values (not copied internally)
free[in]if CSEM_TRUE is set, the old values are freed.
CSEM_Error CSEM_Properties_GetValues ( CSEM_List properties,
CSEM_List **  values,
CSEM_List **  valueTypes 
)

Get values and the types of the values of the specified properties.

The type of values[n] is valueTypes[n].

Parameters:
properties[in]properties
values[out]values (applications need to free with CSEM_List_Dispose(values, CSEM_FALSE))
valueTypes[out]types of the values (applications need to free with CSEM_List_Dispose(valueTypes, CSEM_FALSE))
Returns:
error code
Examples:
sample_micro_search.c, and sample_rdfa_search.c.
CSEM_Error CSEM_Property_AddValues ( CSEM_Property property,
void *  value,
CSEM_VALUE_TYPE  type 
)

Add a value to the property.

Parameters:
property[in]property
value[in]value
type[in]type of the value
Returns:
error code
CSEM_Error CSEM_Property_Create ( CSEM_Property **  property,
CSEM_List names 
)

Create a property object which has the specified property names.

@itemprop of microdata or @property of RDFa Lite.

Parameters:
property[out]property object to be created
names[in]property names (not copied internally)
Returns:
error code
void CSEM_Property_Dispose ( CSEM_Property property)

Dispose a property object.

Parameters:
property[in]property object to be freed

Get names of the property.

Parameters:
property[in]property object
Examples:
sample_micro_search.c, sample_micro_tree.c, sample_rdfa_search.c, and sample_rdfa_tree.c.
CSEM_Error CSEM_Property_GetValues ( CSEM_Property property,
CSEM_List **  values,
CSEM_List **  valueTypes 
)

Get values and the types of the values of the specified property.

The type of values[n] is valueTypes[n].

Parameters:
property[in]property
values[out]values
valueTypes[out]types of the values
Returns:
error code
Examples:
sample_micro_search.c, sample_micro_tree.c, sample_rdfa_search.c, and sample_rdfa_tree.c.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines