wiki:JSONInterface

Methods

the entity with id = 'src_id' through the relation called 'rel_name'. the entity with id = 'tar_id' through the relation called 'rel_name'.
Method name Required parameters Other parameters Return Description
get_ent id include_content (default value false) ent Return the entity with id equal to 'id'
get_ents oc ents Return all entities where their object class equal to 'oc'
get_ents_size oc ents_size
get_def oc def Returns a definition by its object class
get_defs defs Returns all definitions from the DB
get_src_rels id, rel_name, tar_oc src_rels Returns an array which contains the source relations of the entity with id = 'id'
get_tar_rels id, rel_name, src_oc tar_rels Returns an array which contains the target relations of the entity with id = 'id'
get_atts id atts Returns an array which contains the attributes of the entity with id = 'id'
get_tars_4_src_rel src_id, rel_name, tar_id include_content (default value false) ents Returns an array entities that has an object class equals to 'tar_oc' and that are related to
get_srcs_4_tar_rel tar_id, rel_name, src_oc include_content (default value false) ents Returns a array entities that has an object class equals to 'src_oc' and that are related to
exist_rel src_id, tar_id, rel_name exist_rel Returns true, if there is a relation between the entities with ids like: src_id and tar_id.
get_rels rel_name src_oc, tar_oc, include_ents rels Returns an array of relations, which can be filtered by source and target name, wenn they are not empty. The content of the source and the target of a relation can also be included wenn include_ent is true.
search query rs Returns a json-array (called rs), where each entry is a serie of entities that complies with the pattern (or path parameter).

Description of Data Structures

Basically, the database is composed of three kind of elements: entities, attributes and relation. These elements together form a directed graph. The entity is the central component and represent objects that are characterized by attributes and are connected to others entities by their relations. From the perspective of a entity, there are two kind of relation: source relation and target relations. A relation connects a source and a target. For example, let be Z = {X is_created_by Y} a relation and X and Y two entities. For the entity X, Z is a source relation, because the source of Z is X. In the other hand, For the entity Y, Z is a target relation, because the target of Z is Y.

Now, it will be explained, how the mentioned structures are represented by the json-response:

ent

is a json object that represents the most basic element of the database. An entity will be always returned accompanied by the following sub-json-objects:

  • id: the identifier of the entity in the DB.
  • node_type: there are two kind of entities: definitions (node_type='TBox') and concrete entities (node_type='ABox').

These concepts derived from the ontology and means that a entity can be assigned either to an assertion set (Abox) or to a terminological set. A definition describe which kind of attributes and relation can have a concrete entity, in other words a concrete entity is a instance of a definition (like class and object in object-oriented languages).

  • oc (object class): for a concrete entity, this attribute describes from which definition it derives. Typical object classes of ISMI-DB are: TEXT, WITNESS, PERSON, etc.
  • ov (own value): the label of the entity.
  • nov (normalized own value): the normalized version of the own value.
  • lw (light weight): an entity can or not include its attributes and (sources and target) relations.

If the entity does not contain the mentioned elements, the variable lw is false, in the other case it is true.

If the variable lw, the ent would have also the following objects:

  • atts: is a json array, where every element is a att.
  • src_rels: is a json array, where every element is a rel.
  • tar_rels: is a json array, where every element is a rel.

att

is a json object which is composed of the following elements:

  • id: the identifier of the attribute in the DB
  • ov: is value of the attribute.
  • nov: is a normalized version of the own value.
  • name: is name of the attribute.
  • node_type: ABox/TBox
  • content_type: a description of the own value (like text, date, etc).
  • src_id: the identifier of the parent that can be a entity or a relation.

rel

is a json object which is composed of the following elements:

  • id: the identifier of the relation in the DB.
  • name: name of the relation.
  • atts: json array of attributes.
  • src_oc: the object class of the source.
  • tar_oc: the object class of the target
  • src_id: the identifier of the source.
  • tar_id: the identifier of the target.

Examples

get_ent

get_ents

get_def

get_defs

get_src_rels

get_tar_rels

get_srcs_4_tar_rel

get_tars_4_src_rel

is_exemplar_of

search

Last modified 11 years ago Last modified on Feb 5, 2013, 9:52:24 AM