<commit_before># Abstraction

What we called abstraction is the askomics ontology, this is what describe the data.
It is quite small and defines what is a bubble and what is a link the the graphical interface.
Its prefix is "askomics:".
* entity : what will be bubble, usually a owl:Class
* startPoint : an entity that could start an askomics query. What will be displayed in the first query page.
* attribute : what will be links between bubbles or bubble and value.
* category : what will be choice list, used in some attribute value.

## Turtle Example
Here i show you the minimal information to provide as an abstraction.
### prefixes
```
@prefix xsd:      <http://www.w3.org/2001/XMLSchema#>
@prefix owl:      <http://www.w3.org/2002/07/owl#> .
@prefix rdfs:     <http://www.w3.org/2000/01/rdf-schema#> .
@prefix askomics: <askomics_is_good#> .
@base <scrap#> .
```
### entity
```
# entity (startpoint to have a start, can be avoid in standard entity)
<People>
            askomics:entity "true"^^xsd:boolean ;
            rdfs:label "People"^^xsd:string ;
            askomics:startPoint "true"^^xsd:boolean ;
.
```
### <entity> --relation--> value
```
# attribute DatatypeProperty
<First_name>
            askomics:attribute "true"^^xsd:boolean ;
            rdf:type    owl:DatatypeProperty ;
            rdfs:label  "First_name"^^xsd:string ;
            rdfs:domain <People> ;
            rdfs:range  xsd:string ;
.
```
### <entity> --relation--> category=short list
```
# attribute DatatypeProperty
<Sex>
        askomics:attribute "true"^^xsd:boolean ;
        rdf:type    owl:DatatypeProperty ;
        rdfs:label  "Sex"^^xsd:string ;
        rdfs:domain <People> ;
        rdfs:range  <SexCategory> ;
.
<SexCategory>
        askomics:category <M>, <F> ;
.
<M>
    rdfs:label "M"^^xsd:string ;
.
<F>
    rdfs:label "F"^^xsd:string ;
.

```
### <entity> --relation--> <entity>
```
# attribute ObjectProperty
<PlayWith>
        askomics:attribute "true"^^xsd:boolean ;
        rdf:type    owl:ObjectProperty ;
        rdfs:label  "play with"^^xsd:string ;
        rdfs:domain <People> ;
        rdfs:range  <People> ;
.
```

full file in in people_mini.abstract.ttl

## Python Management Code
As seen abose, we have 2 kinds of class, "entity" and "attribute"/relation.
To manage them (~get turtle strings), we use the 2 classes ```AbstractedEntity__``` and ```AbstractedRelation__``` in libaskomics/integration.

cf __python doc__ to have details.
### basics uses
```python
ttl  += AbstractedEntity__( uri, label, startpoint=True ).get_turtle()
ttl  += AbstractedRelation__( uri, rdf_type, domain, range_, label ).get_turtle()
```
<commit_msg>typo in abstraction.md<commit_after># Abstraction

What we called abstraction is the askomics ontology, this is what describe the data.
It is quite small and defines what is a bubble and what is a link the the graphical interface.
Its prefix is "askomics:".
* entity : what will be bubble, usually a owl:Class
* startPoint : an entity that could start an askomics query. What will be displayed in the first query page.
* attribute : what will be links between bubbles or bubble and value.
* category : what will be choice list, used in some attribute value.

## Turtle Example
Here i show you the minimal information to provide as an abstraction.
### prefixes
```
@prefix xsd:      <http://www.w3.org/2001/XMLSchema#>
@prefix owl:      <http://www.w3.org/2002/07/owl#> .
@prefix rdfs:     <http://www.w3.org/2000/01/rdf-schema#> .
@prefix askomics: <askomics_is_good#> .
@base <scrap#> .
```
### entity
```
# entity (startpoint to have a start, can be avoid in standard entity)
<People>
            askomics:entity "true"^^xsd:boolean ;
            rdfs:label "People"^^xsd:string ;
            askomics:startPoint "true"^^xsd:boolean ;
.
```
### <entity> --relation--> value
```
# attribute DatatypeProperty
<First_name>
            askomics:attribute "true"^^xsd:boolean ;
            rdf:type    owl:DatatypeProperty ;
            rdfs:label  "First_name"^^xsd:string ;
            rdfs:domain <People> ;
            rdfs:range  xsd:string ;
.
```
### <entity> --relation--> category=short list
```
# attribute DatatypeProperty
<Sex>
        askomics:attribute "true"^^xsd:boolean ;
        rdf:type    owl:DatatypeProperty ;
        rdfs:label  "Sex"^^xsd:string ;
        rdfs:domain <People> ;
        rdfs:range  <SexCategory> ;
.
<SexCategory>
        askomics:category <M>, <F> ;
.
<M>
    rdfs:label "M"^^xsd:string ;
.
<F>
    rdfs:label "F"^^xsd:string ;
.

```
### <entity> --relation--> <entity>
```
# attribute ObjectProperty
<PlayWith>
        askomics:attribute "true"^^xsd:boolean ;
        rdf:type    owl:ObjectProperty ;
        rdfs:label  "play with"^^xsd:string ;
        rdfs:domain <People> ;
        rdfs:range  <People> ;
.
```

full file in people_mini.abstract.ttl

## Python Management Code
As seen abose, we have 2 kinds of class, "entity" and "attribute"/relation.
To manage them (~get turtle strings), we use the 2 classes ```AbstractedEntity__``` and ```AbstractedRelation__``` in libaskomics/integration.

cf __python doc__ to have details.
### basics uses
```python
ttl  += AbstractedEntity__( uri, label, startpoint=True ).get_turtle()
ttl  += AbstractedRelation__( uri, rdf_type, domain, range_, label ).get_turtle()
```

{'fraction_non_alphanumeric': 0.13379751599548362, 'fraction_numerical': 0.007903650733910425, 'mean_word_length': 3.3458708094848735, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3055485', 'n_tokens_mistral': 1825, 'n_tokens_neox': 1648, 'n_words': 511}