API - SmartSlog KP Library
|
Contains functions for work with classes. More...
#include <ckpi/ckpi.h>
#include <string.h>
#include "classes.h"
#include "structures.h"
#include "ss_func.h"
#include "utils/check_func.h"
#include "utils/util_func.h"
#include "utils/list.h"
Macros | |
#define | _CLASSES_C |
Functions | |
SSLOG_EXTERN individual_t * | sslog_new_individual (const class_t *ont_class) |
Create new individual. | |
SSLOG_EXTERN list_t * | sslog_get_superclass_all (const class_t *ont_class) |
Returns a list of superclasses. | |
SSLOG_EXTERN int | sslog_is_subclass_of (const class_t *subclass, const class_t *superclass) |
Checks if class has superclass. | |
SSLOG_EXTERN int | sslog_is_classtype_of (const individual_t *individual, const class_t *ont_class) |
Checks type of individual. | |
SSLOG_EXTERN prop_val_t * | sslog_new_value_struct (property_t *prop, const void *data) |
Create new property value structure. | |
SSLOG_EXTERN int | sslog_rep_count_individual_references (individual_t *individual) |
Count references to given individual. | |
SSLOG_EXTERN int | sslog_set_individual_uuid (individual_t *ind, const char *uuid) |
Set UUID. | |
SSLOG_EXTERN int | sslog_repo_add_entity (void *entity) |
Add entity to repository. | |
SSLOG_EXTERN int | sslog_repo_add_class (class_t *ont_class) |
Add class to class repository. | |
SSLOG_EXTERN int | sslog_repo_add_property (property_t *property) |
Add property to property repository. | |
SSLOG_EXTERN const property_t * | sslog_repo_get_property_by_name (const char *name) |
Get property from repository by given name. | |
SSLOG_EXTERN const class_t * | sslog_repo_get_class_by_classtype (const char *classtype) |
Get class from repository by given classtype. | |
SSLOG_EXTERN const list_t * | sslog_repo_get_individual_by_classtype_all (const char *classtype) |
Get individuals from repository by given classtype. | |
SSLOG_EXTERN const individual_t * | sslog_repo_get_individual_by_uuid (const char *uuid) |
Get individuals from repository by given uuid. | |
SSLOG_EXTERN void | sslog_repo_remove_entity (void *entity) |
Remove entity from repository. | |
SSLOG_EXTERN list_t * | get_individual_inheritance_classes (individual_t *individual) |
Gets all inheritance classes. | |
void | sslog_repo_clean_all () |
Contains functions for work with classes.
Alexandr A. Lomov lomov @cs. karel ia.r u
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
Contains functions for work with classes. This file is part of SmartSlog KP Library.
Copyright (C) 2009 - Alexandr A. Lomov. All rights reserved.
#define _CLASSES_C |
SSLOG_EXTERN list_t* get_individual_inheritance_classes | ( | individual_t * | individual | ) |
Gets all inheritance classes.
individual | individual for get parents. |
SSLOG_EXTERN list_t* sslog_get_superclass_all | ( | const class_t * | ont_class | ) |
Returns a list of superclasses.
class | class. |
SSLOG_EXTERN int sslog_is_classtype_of | ( | const individual_t * | individual, |
const class_t * | ont_class | ||
) |
Checks type of individual.
individual | object of some class for check. |
ont_class | allaged class of individual. |
SSLOG_EXTERN int sslog_is_subclass_of | ( | const class_t * | subclass, |
const class_t * | superclass | ||
) |
Checks if class has superclass.
class | class for check. |
superclass | alleged superclass of class. |
SSLOG_EXTERN individual_t* sslog_new_individual | ( | const class_t * | ont_class | ) |
Create new individual.
Create new individual without UUID.
classtype | type of class. |
SSLOG_EXTERN prop_val_t* sslog_new_value_struct | ( | property_t * | prop, |
const void * | data | ||
) |
Create new property value structure.
This function copy only value for data-property (i.e. char*), if property is object then value is pointer to given value (i.e. individual).
prop | property for value. |
data | data for value of property. |
SSLOG_EXTERN int sslog_rep_count_individual_references | ( | individual_t * | individual | ) |
Count references to given individual.
It gets other individuals and search references to individual from their properties.
individual | individual for count. |
SSLOG_EXTERN int sslog_repo_add_class | ( | class_t * | ont_class | ) |
Add class to class repository.
It set error and return it on failure.
ont_class | class for insert. |
SSLOG_EXTERN int sslog_repo_add_entity | ( | void * | entity | ) |
Add entity to repository.
It set error and return it on failure. You need to add individual, if you create it manually. Function
entity | individual, property or class. |
SSLOG_EXTERN int sslog_repo_add_property | ( | property_t * | property | ) |
Add property to property repository.
It set error and return it on failure.
property | for insert. |
void sslog_repo_clean_all | ( | ) |
SSLOG_EXTERN const class_t* sslog_repo_get_class_by_classtype | ( | const char * | classtype | ) |
Get class from repository by given classtype.
classtype | name of classtype. |
SSLOG_EXTERN const list_t* sslog_repo_get_individual_by_classtype_all | ( | const char * | classtype | ) |
Get individuals from repository by given classtype.
classtype | name of classtype. |
SSLOG_EXTERN const individual_t* sslog_repo_get_individual_by_uuid | ( | const char * | uuid | ) |
Get individuals from repository by given uuid.
uuid | individual's uuid. |
SSLOG_EXTERN const property_t* sslog_repo_get_property_by_name | ( | const char * | name | ) |
Get property from repository by given name.
name | property name. |
SSLOG_EXTERN void sslog_repo_remove_entity | ( | void * | entity | ) |
Remove entity from repository.
entity | individual, class or property. |
SSLOG_EXTERN int sslog_set_individual_uuid | ( | individual_t * | ind, |
const char * | uuid | ||
) |
Set UUID.
Set new UUID for individuals. You need reinitialize individual to work with SS.
ind | individual. |
uuid | UUID. |