Internalfunctions - SmartSlog KP Library
Data Structures | Macros | Typedefs | Enumerations | Functions
structures.h File Reference

Describe C structures for OWL entities, KP and SS. More...

#include <stdio.h>
#include <stdlib.h>
#include "utils/kp_bool.h"
#include "utils/list.h"

Go to the source code of this file.

Data Structures

struct  property_s
 Property structure, represents OWL property. More...
struct  prop_val_s
 Property value structure. More...
struct  class_s
 Class structure, represents OWL class. More...
struct  individual_s
 Individual structure. More...

Macros

#define SSLOG_EXTERN

Typedefs

typedef enum action_type_enum action_type
 Statses of triples changing.
typedef struct property_s property_t
 Property structure, represents OWL property.
typedef struct prop_val_s prop_val_t
 Property value structure.
typedef struct class_s class_t
 Class structure, represents OWL class.
typedef struct individual_s individual_t
 Individual structure.

Enumerations

enum  rtti_types {
  RTTI_MIN_VALUE = 0, RTTI_INDIVIDUAL = 1, RTTI_CLASS = 2, RTTI_PROPERTY = 3,
  RTTI_SUBSCRIPTION, RTTI_SUBSCRIPTION_CHANGES, RTTI_SUBSCRIPTION_CALLBACK, RTTI_PATTERN,
  RTTI_PATTERN_CONDITION, RTTI_MAX_VALUE
}
 Run-time type information. More...
enum  property_types { DATATYPEPROPERTY = 1, OBJECTPROPERTY = 2 }
 Types of properties. More...
enum  pattern_conditions_types {
  PATTERN_COND_NO, PATTERN_COND_E, PATTERN_COND_EL, PATTERN_COND_EA,
  PATTERN_COND_L, PATTERN_COND_A, PATTERN_COND_NE, PATTERN_COND_LINK,
  PATTERN_COND_STRSTR
}
 Conditions for pattern. More...
enum  action_type_enum { ACTION_UPDATE, ACTION_REMOVE, ACTION_INSERT, ACTION_UNKNOWN }
 Statses of triples changing. More...
enum  subscribe_status {
  SBCR_STATUS_MIN, SBCR_STATUS_NO, SBCR_STATUS_SUBSCRIBED, SBCR_STATUS_UPDATING,
  SBCR_STATUS_MAX
}
 Types of subscription process. More...

Functions

SSLOG_EXTERN void sslog_free_property (property_t *property)
 Free property structure.
SSLOG_EXTERN void sslog_free_value_struct (prop_val_t *prop_val)
 Free property value struct.
SSLOG_EXTERN void sslog_free_value_struct_with_func (prop_val_t *prop_val, void(*free_data_func)(void *))
 Free property value struct.
SSLOG_EXTERN void sslog_free_data_property_value_struct (prop_val_t *prop_val)
 Free property value struct.
SSLOG_EXTERN void sslog_free_class (class_t *ont_class)
 Free class structure.
SSLOG_EXTERN void sslog_free_individual (individual_t *individual)
 Free individual structure.
SSLOG_EXTERN prop_val_tsslog_new_value_struct (property_t *prop, const void *data)
 Create new property value structure.
SSLOG_EXTERN int sslog_get_rtti_type (const void *entity)
 Gets RTTI.
int get_sbcr_status (individual_t *individual)
 Gets subscription status of individuals.
int set_sbcr_status (individual_t *individual, int status)
 Sets subscription status.

Detailed Description

Describe C structures for OWL entities, KP and SS.

Alexandr A. Lomov lomov.nosp@m.@cs..nosp@m.karel.nosp@m.ia.r.nosp@m.u

Date:
05 December, 2009

LICENSE

PetrSU 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.

PetrSU 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 PetrSU KP Library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

DESCRIPTION

Describe C structures for OWL entities, KP and SS. This file is part of PetrSU KP Library.

Copyright (C) 2009 - Alexander A. Lomov. All rights reserved.


Macro Definition Documentation

#define SSLOG_EXTERN

Typedef Documentation

Statses of triples changing.

typedef struct class_s class_t

Class structure, represents OWL class.

typedef struct individual_s individual_t

Individual structure.

typedef struct prop_val_s prop_val_t

Property value structure.

Use for individuals.

typedef struct property_s property_t

Property structure, represents OWL property.


Enumeration Type Documentation

Statses of triples changing.

Enumerator:
ACTION_UPDATE 

Triple was updated.

ACTION_REMOVE 

Triple was deleted.

ACTION_INSERT 

New triple was inserted.

ACTION_UNKNOWN 

Maybe something wrong.

Conditions for pattern.

Enumerator:
PATTERN_COND_NO 

Condition not set.

PATTERN_COND_E 

Equal condition.

PATTERN_COND_EL 

Equal or less condition.

PATTERN_COND_EA 

Equal or above condition.

PATTERN_COND_L 

Less condition.

PATTERN_COND_A 

Above condition.

PATTERN_COND_NE 

Not equal condition.

PATTERN_COND_LINK 

Link to other pattern (object property).

PATTERN_COND_STRSTR 

Occurrence value of pattern.

Types of properties.

Enumerator:
DATATYPEPROPERTY 

Data-property type.

OBJECTPROPERTY 

Object-property type.

enum rtti_types

Run-time type information.

Enumerator:
RTTI_MIN_VALUE 

Use for checking min value of rtti field.

RTTI_INDIVIDUAL 

Individual type.

RTTI_CLASS 

Class type.

RTTI_PROPERTY 

Property type.

RTTI_SUBSCRIPTION 

Subscription type.

RTTI_SUBSCRIPTION_CHANGES 

Subscription changes type (subscription_changes_data_s).

RTTI_SUBSCRIPTION_CALLBACK 

Subscription's callback type.

RTTI_PATTERN 

Pattern type.

RTTI_PATTERN_CONDITION 

Pattern condition type.

RTTI_MAX_VALUE 

Use for checking max value of rtti field.

Types of subscription process.

Enumerator:
SBCR_STATUS_MIN 
SBCR_STATUS_NO 
SBCR_STATUS_SUBSCRIBED 
SBCR_STATUS_UPDATING 
SBCR_STATUS_MAX 

Function Documentation

int get_sbcr_status ( individual_t individual)

Gets subscription status of individuals.

Parameters:
individualindividuals to check.
Returns:
status (
See also:
subscribe_status) or -1 otherwise.
int set_sbcr_status ( individual_t individual,
int  status 
)

Sets subscription status.

Parameters:
individualindividuals to set.
statussubscription status (
See also:
subscribe_status).
Returns:
0 on success or -1 otherwise.
SSLOG_EXTERN void sslog_free_class ( class_t ont_class)

Free class structure.

Properties, instances and superclasses not freed, only list struct.

Parameters:
ont_classclass structure.
SSLOG_EXTERN void sslog_free_data_property_value_struct ( prop_val_t prop_val)

Free property value struct.

It checks object or data property given and then free only data-property. Property is not freed. This function doesn't free value if property not set, in this case only structure (

See also:
prop_val_t) will be freed.
Parameters:
prop_valproperty value structure.
SSLOG_EXTERN void sslog_free_individual ( individual_t individual)

Free individual structure.

Parent class not free.

Parameters:
classclass structure.
SSLOG_EXTERN void sslog_free_property ( property_t property)

Free property structure.

Free all fields, subproperties are not freed, only the list structure and all nodes, data stay untouched.

Parameters:
propertyproperty for free.
SSLOG_EXTERN void sslog_free_value_struct ( prop_val_t prop_val)

Free property value struct.

It checks object or data property given and then free data or object. Oject (individual) not freed if it has references from other individuals. Property is not freed. This function doesn't free value if property not set, in this case only structure (

See also:
prop_val_t) will be freed.
Parameters:
prop_valproperty value structure.
SSLOG_EXTERN void sslog_free_value_struct_with_func ( prop_val_t prop_val,
void(*)(void *)  free_data_func 
)

Free property value struct.

Property is not freed.

Parameters:
prop_valproperty value structure.
free_data_funcfunction for free property value or NULL.
SSLOG_EXTERN int sslog_get_rtti_type ( const void *  entity)

Gets RTTI.

Parameters:
entitysome entity, for example: individual, class or property.
Returns:
RTTI entity type on success or RTTI_MIN_VALUE (
See also:
rtti_types) otherwise.
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).

Parameters:
propproperty for value.
datadata for value of property.
Returns:
new property value structure or NULL on error.