---
# System prepended metadata

title: Modelado de datos de difusión del ash'arismo en el occidente islámico
tags: [TypeDB]

---

---
tags: TypeDB
---
# Modelado de datos de difusión del ash'arismo en el occidente islámico
## Schema.tql (Definition of concepts)

```#tql= 
define

#ATTRIBUTES
title sub attribute, value string;
reference sub attribute, value string;
part_title sub attribute, value string;
part_reference sub attribute, value string;
theme_description sub attribute, value string;
Hijri sub attribute, value string, regex "^[0-9]{4}(-[0-9]{2}(-[0-9]{2}){0,1}){0,1}$";
CE sub attribute, value string, regex "^[0-9]{4}(-[0-9]{2}(-[0-9]{2}){0,1}){0,1}$";
ar_name sub attribute, value string;
lat_name sub attribute, value string;
sentiment sub attribute, value string, regex "^(criticism|approval|neuter|unknown)$";


#ENTITIES

#texts and similar

text sub entity,
  owns title,
  owns reference,
  plays is_part_of:main,
  plays is_part_of:part,
  plays authorship:text,
  plays is_attested_by:source,
  plays teaching:object_of_study
  plays copy:text,
  plays quoting:quoted,
  plays quoting:quoting;

text_part sub entity,
  owns part_title,
  owns part_reference,
  plays is_part_of:part,
  plays authorship:text,
  plays is_attested_by:source,
  plays teaching:object_of_study,
  plays copy:text,
  plays quoting:quoted,
  plays quoting:quoting;

textual_set sub entity,
  owns theme_description,
  plays is_part_of:main,
  plays authorship:text,
  plays is_attested_by:source,
  plays teaching:object_of_study;

manuscript sub entity,
  owns reference
  plays copy:manuscript,
  plays ownership:owned,
  plays is_attested_by:source;

#date and place

absolute_date sub entity,
  owns Hijri,
  owns CE,
  plays dating:date,
  plays relative_date:after_value,
  plays relative_date:before_value;

place sub entity, abstract,
  plays locating:place,
  owns ar_name,
  owns lat_name;

locality sub place,
plays is_part_of:part,
plays geolocalization:place;

region sub place,
plays is_part_of:main,
plays is_part_of:part;

country sub place,
plays is_part_of:main;

coordinates sub entity,
  owns lat,
  owns lon,
  plays geolocalization:coordinates;


# persons
person sub entity,
  owns ar_name,
  owns lat_name,
  plays authorship:author,
  plays birth:person,
  plays death:person,
  plays stay:person,
  plays teaching:profesor,
  plays teaching:student,
  plays copying:copyist,
  plays ownership:owner,
  plays is_attested_by:source,
  plays reading:read,
  plays reading:reader;




#RELATIONS

is_attested_by sub relation,
  relates statement,
  relates source;

is_part_of sub relation,
  relates main,
  relates part;

authorship sub relation,
  relates text,
  relates author,
  plays locating:event,
  plays dating:event,
  plays is_attested_by:statement;

dating sub relation,
  relates event,
  relates date,
  plays is_attested_by:statement;

locating sub relation
  relates event,
  relates place,
  plays is_attested_by:statement;

relative_date sub relation,
  relates after_value,
  relates before_value,
  plays dating:date;


geolocalization sub relation,
  relates place,
  relates coordinates;

birth sub relation,
  relates person,
  plays dating:event,
  plays locating:event, 
  plays is_attested_by:statement;

death sub relation,
  relates person,
  plays dating:event,
  plays locating:event,
  plays is_attested_by:statement;

stay sub relation,
  relates person,
  plays dating:event,
  plays locating:event,
  plays is_attested_by:statement;

teaching sub relation,
  relates profesor,
  relates student,
  relates object_of_study,
  plays dating:event,
  plays locating:event,
  plays is_attested_by:statement;

copy sub relation,
  relates manuscript,
  relates text;

copying sub relation,
  relates copy,
  relates copyist,
  plays dating:event,
  plays locating:event,
  plays stay:person,
  plays is_attested_by:event;

ownership sub relation,
  relates owned,
  relates owner,
  plays is_attested_by:event;

quoting sub relation,
  relates quoted,
  relates quoting,
  owns sentiment;

reading sub relation,
  relates read,
  relates reader;



#RULES

rule transitive-authorship:
  when {
    (text: $text1, author: $author) isa authorship;
    ((main: $text1, part: $text2) isa is_part_of) or ((main: $text2, part: $text1) isa is_part_of);
  } then {
    (text: $text2, author: $author) isa authorship;
  };

rule transitive-ispartof:
  when {
    (main: $x, part: $y) isa is_part_of;
    (main: $z, part: $x) isa is_part_of;
  } then {
    (main: $z, part: $y) isa is_part_of;
  };

rule transitive-dating-fortextparts:
  when {
    (event:$text, date:$d) isa dating;
    $text isa text;
    $part isa text_part;
    (main:$text, part:$part) isa is_part_of;
  } then {
    (event:$part, date:$d) isa dating;
  };

rule transitive-source:
  when {
    (statement:$st, source:$subtext) isa is_attested_by;
    (main:$text, part:$subtext) isa is_part_of;

  } then {
    (statement:$st, source:$text) isa is_attested_by;
  };

```

## Interface components
### Logic
```flow
st=>start: What operation do you wish to do?
cond_add=>condition: Do you want to add registry? 
cond_remodif=>condition: Do you want to remove or modify registry?
ADD=>operation: Add which type of registry?
REMOVE=>operation: Remove which type of registry?
MODIFY=>operation: Modify which type of registry?
cond_text=> condition: TEXT and MANUSCRIPT?
cond_person=>condition: PERSON?
cond_place=>condition: PLACE?
e=>end: SEE in shell if there is no error

st->cond_add
cond_add(yes@Add)->ADD
cond_add(no@No)->cond_remodif
cond_remodif(yes@Remove)->REMOVE
cond_remodif(no@Modify)->MODIFY



```