API -&nbspSmartSlog KP Library
Macros | Functions
ss_classes.h File Reference

Contains describtion of functions for work with classes throw SS. More...

#include <ckpi/ckpi.h>
#include "kpi_interface.h"
#include "ss_properties.h"
#include "ss_func.h"
#include "utils/list.h"

Go to the source code of this file.

Macros

#define SSLOG_EXTERN

Functions

SSLOG_EXTERN int sslog_ss_init_individual (individual_t *ind)
 rdf:type.
SSLOG_EXTERN int sslog_ss_init_individual_with_uuid (individual_t *ind, const char *uuid)
 Initialize individual for SS by given uuid.
SSLOG_EXTERN int sslog_ss_insert_individual (individual_t *individual)
 Inserts given individual to SS.
SSLOG_EXTERN int sslog_ss_insert_individual_by_pattern (individual_t *individual, pattern_t *pattern)
 Inserts given individual to SS by pattern.
SSLOG_EXTERN int sslog_ss_update_individual (individual_t *individual)
 Updates given individual in SS.
SSLOG_EXTERN int sslog_ss_update_individual_by_pattern (individual_t *individual, pattern_t *pattern)
 Updates given individual in SS by pattern.
SSLOG_EXTERN int sslog_ss_remove_individual (individual_t *individual)
 Removes given individual from SS.
SSLOG_EXTERN int sslog_ss_exists_individual (individual_t *individual)
 Checks if given individual exists in SS.
SSLOG_EXTERN int sslog_ss_exists_class (class_t *ont_class)
 Checks if any individual of given class exists in SS.
SSLOG_EXTERN int sslog_ss_exists_individual_by_uuid (individual_t *individual)
 Checks if uuid of given individual exists in SS.
SSLOG_EXTERN int sslog_ss_exists_uuid (char *uuid)
 Checks if individual with given uuid exists in SS.
SSLOG_EXTERN int sslog_ss_exists_individual_by_pattern (pattern_t *pattern)
 Checks if individual matches given pattern exists in SS.
SSLOG_EXTERN list_t * sslog_ss_get_individual_by_class_all (class_t *ont_class)
 Finds all individuals of given class in SS.

Detailed Description

Contains describtion of functions for work with classes throw SS.

Vanag Pavel vanag.nosp@m.@cs..nosp@m.karel.nosp@m.ia.r.nosp@m.u

Date:
05 April, 2010
Version:
0.2alpha

LICENSE

SmartSlog KP Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

SmartSlog KP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with SmartSlog KP Library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

DESCRIPTION

Contains describtion of functions for work with classes throw SS. This file is part of SmartSlog KP library.


Macro Definition Documentation

#define SSLOG_EXTERN

Function Documentation

SSLOG_EXTERN int sslog_ss_exists_class ( class_t ont_class)

Checks if any individual of given class exists in SS.

Tries to find individual of given class. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]class_t*ont_class. Pointer to the class struct.
Returns:
int. Status (1 if individual exists in SS, otherwise 0).
SSLOG_EXTERN int sslog_ss_exists_individual ( individual_t individual)

Checks if given individual exists in SS.

Tries to find individual by given individual data (uuid, properties). Function sets global SmartSlog KP Library's errno.

Parameters:
[in]individual_t* individual. Pointer to the individual struct.
Returns:
int. Status (1 if individual exists in SS, otherwise 0).
SSLOG_EXTERN int sslog_ss_exists_individual_by_pattern ( pattern_t pattern)

Checks if individual matches given pattern exists in SS.

Tries to find individual by pattern. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]void*pattern. Pointer to the individual or class struct.
Returns:
int. Status (1 if individual exists in SS, otherwise 0).

Tries to find individual by pattern. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]pattern_t*pattern. Pointer to the individual or class struct.
Returns:
int. Status (1 if individual exists in SS, otherwise 0).
SSLOG_EXTERN int sslog_ss_exists_individual_by_uuid ( individual_t individual)

Checks if uuid of given individual exists in SS.

Tries to find individual by uuid. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]individual_t* individual. Pointer to the individual struct.
Returns:
int. Status (1 if individual exists in SS, otherwise 0).
SSLOG_EXTERN int sslog_ss_exists_uuid ( char *  uuid)

Checks if individual with given uuid exists in SS.

Tries to find individual by uuid. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]char*uuid. Char array with uuid.
Returns:
int. Status (1 if individual exists in SS, otherwise 0).
SSLOG_EXTERN list_t* sslog_ss_get_individual_by_class_all ( class_t ont_class)

Finds all individuals of given class in SS.

Tries to find individual by class. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]class_tont_class. Pointer to the class struct.
Returns:
list_t. Null if there is no individuals of such class in SS, list of founded individuals otherwise.
SSLOG_EXTERN int sslog_ss_init_individual ( individual_t ind)

rdf:type.

Initialize individual for SS.

This function generate UUID and registry given individuals in SS.

Parameters:
individual_tindividual for initialize.
Returns:
0 on success or not otherwise.

rdf:type.

This function generate UUID and registry given individuals in SS.

Parameters:
individual_tindividual for initialize.
Returns:
0 on success or not otherwise.
SSLOG_EXTERN int sslog_ss_init_individual_with_uuid ( individual_t ind,
const char *  uuid 
)

Initialize individual for SS by given uuid.

This function registry given individuals in SS with given uuid.

Parameters:
individual_tindividual for initialize.
constchar * uuid of individual.
Returns:
0 on success or not otherwise.
SSLOG_EXTERN int sslog_ss_insert_individual ( individual_t individual)

Inserts given individual to SS.

Get ss_info struct.

Checks individual correctness: cardinality, property values limitation, and converts the individual to triplets, which will be placed to SS. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]individual_t* individual. Pointer to the individual struct.
Returns:
int. Status of the operation when completed (0 if successfull, otherwise -1).

ss_info used by KPI Low functions.

Returns:
ss_info on success or NULL otherwise.

Inserts given individual to SS

Checks individual correctness: cardinality, property values limitation, and converts the individual to triplets, which will be placed to SS. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]individual_t* individual. Pointer to the individual struct.
Returns:
int. Status of the operation when completed (0 if successfull, otherwise -1).

Checks individual correctness: cardinality, property values limitation, and converts the individual to triplets, which will be placed to SS. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]individual_t* individual. Pointer to the individual struct.
Returns:
int. Status of the operation when completed (0 if successfull, otherwise -1).
SSLOG_EXTERN int sslog_ss_insert_individual_by_pattern ( individual_t individual,
pattern_t pattern 
)

Inserts given individual to SS by pattern.

Checks individual correctness: cardinality, property values limitation, and converts the individual to triplets by pattern, which will be placed to SS. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]individual_t* individual. Pointer to the individual struct.
[in]void*pattern. Entity contains pattern (individual or class).
Returns:
int. Status of the operation when completed (0 if successfull, otherwise -1).

Checks individual correctness: cardinality, property values limitation, and converts the individual to triplets by pattern, which will be placed to SS. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]individual_t* individual. Pointer to the individual struct.
[in]pattern_t*pattern. Entity contains pattern (individual or class).
Returns:
int. Status of the operation when completed (0 if successfull, otherwise -1).
SSLOG_EXTERN int sslog_ss_remove_individual ( individual_t individual)

Removes given individual from SS.

Tries to find individuals description(triplets) in the SS, then removes all triplets from SS and from individual, UUID removed too. After work you have empty individual struct. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]individual_t* individual. Pointer to the individual struct.
Returns:
int. Status of the operation when completed (0 if successfull, otherwise -1).
SSLOG_EXTERN int sslog_ss_update_individual ( individual_t individual)

Updates given individual in SS.

IMPORTANT: function replace individual (removes and inserts it) Checks individual correctness: cardinality, property values limitation, and converts the individual to triplets, which will be updated in SS, other properties (which has’t individual, but that are in SS) will be removed from SS. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]individual_t* individual. Pointer to the individual struct.
Returns:
int. Status of the operation when completed (0 if successfull, otherwise -1).

Checks individual correctness: cardinality, property values limitation, and converts the individual to triplets, which will be updated in SS, other properties (which has’t individual, but that are in SS) will be removed from SS. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]individual_t* individual. Pointer to the individual struct.
Returns:
int. Status of the operation when completed (0 if successfull, otherwise -1).
SSLOG_EXTERN int sslog_ss_update_individual_by_pattern ( individual_t individual,
pattern_t pattern 
)

Updates given individual in SS by pattern.

IMPORTANT: function replace individual (removes and inserts it by pattern)

Checks individual correctness: cardinality, property values limitation, and converts the individual to triplets by pattern, which will be updated in SS, other properties (which has’t individual, but that are in SS) will be removed from SS. Function sets global SmartSlog KP Library's errno.

Parameters:
[in]individual_t* individual. Pointer to the individual struct.
[in]void* pattern. Pointer to the individual struct that considered as pattern.
Returns:
int. Status of the operation when completed (0 if successfull, otherwise -1).