Skip to content

Output

JSON

The knowledge (KNWL) graph can be outputed in JSON format.

Format

Json Format Description :

{
  "cards": [],            // List of document cards
  "question_infos": [],   // List of question targets
  "variables": {},        // Graph pattern result
  "pattern_data": {       // Text pattern result
    "classification": {}, // Classification pattern result
	"property": {}        // Property pattern result
  },
  "project_id": "",       // Lettria Project Id
  "document_id": "",      // Document Id
}

RDF

The KNWL graph can also be outputed in RDF format. By default we return a Turtle file (.ttl), but other RDF format are supported : ttl, xml, pretty-xml, json-ld, n3, nt, trig.

Example

Example Turtle output for this input : "Yesterday, John has eaten orange fruits."

@prefix card: <https://data.lettria.com/card/> .
@prefix d: <https://doc.lettria.com/ontology/1.0/Data/> .
@prefix info: <https://data.lettria.com/info/> .
@prefix l: <https://doc.lettria.com/ontology/1.0/> .
@prefix m: <https://doc.lettria.com/ontology/1.0/Metadata/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<https://data.lettria.com/project/blankProject> a l:Project ;
    rdfs:label "blankProject" ;
    l:Document <https://data.lettria.com/document/blankProject_document_0> ;
    m:projectId "" .

card:d7f3316f-1c56-4b2c-926a-ee5b9408f651 a l:Card ;
    l:Attribute info:da636bc7-aa43-4041-8310-db6040e861af ;
    d:categopath "concrete_thing|natural_thing|person|[person_by_characteristics]|person_by_name|person_by_firstname" ;
    d:categosens "[person_by_characteristics]",
        "concrete_thing",
        "natural_thing",
        "person",
        "person_by_firstname",
        "person_by_name" ;
    d:finestCategosens "person_by_firstname" ;
    d:lemma "john" ;
    l:Event info:36f7aa8e-62d2-4498-af30-df9c71a570d8 ;
    m:creationDate "Friday, November 03, 2023 02:31:49" ;
    m:negation false ;
    m:origin "Lettria" ;
    m:plural false ;
    m:position "0:2" ;
    m:projectId "" ;
    m:purePosition "11:15" ;
    m:uniqueId "d7f3316f-1c56-4b2c-926a-ee5b9408f651|1699018309.561978" .

<https://data.lettria.com/document/blankProject_document_0> a l:Document ;
    rdfs:label "blankProject_document_0" ;
    rdf:language "en" ;
    l:Card card:64692444-eb22-40a0-9ffa-b7c14bd4d58a,
        card:d7f3316f-1c56-4b2c-926a-ee5b9408f651,
        card:e48227e6-1a84-4140-a1d9-b3016b6581d7 ;
    m:projectId "" .

info:36f7aa8e-62d2-4498-af30-df9c71a570d8 a l:Event ;
    rdfs:label "root:act:doing:absorption:eat" ;
    l:Attribute info:fb3d8799-3cdb-4e38-bf20-5261bbb0d5e9 ;
    d:categopath "root|act|doing|absorption|eat" ;
    d:categosens "absorption",
        "act",
        "doing",
        "eat",
        "root" ;
    d:finestCategosens "eat" ;
    d:value card:64692444-eb22-40a0-9ffa-b7c14bd4d58a ;
    m:creationDate "Friday, November 03, 2023 02:31:49" ;
    m:extra "{'verb': 'eat', 'verb_perso': False, 'mode': 'present perfect'}" ;
    m:intensity 1e+00 ;
    m:negation false ;
    m:position "0:2|0:3|0:5" ;
    m:projectId "" ;
    m:purePosition "11:15|16:25|33:39" ;
    m:temporality "present" ;
    m:uniqueId "36f7aa8e-62d2-4498-af30-df9c71a570d8|1699018309.5634634" .

info:6bd469fa-85ca-480d-bdc0-8bb21094cc39 a l:Attribute ;
    rdfs:label "characteristic_jj:concrete_characteristic:color" ;
    d:categopath "characteristic_jj|concrete_characteristic|color" ;
    d:categosens "characteristic_jj",
        "color",
        "concrete_characteristic" ;
    d:finestCategosens "color" ;
    d:value card:e48227e6-1a84-4140-a1d9-b3016b6581d7 ;
    m:creationDate "Friday, November 03, 2023 02:31:49" ;
    m:intensity 1e+00 ;
    m:negation false ;
    m:position "0:4|0:5" ;
    m:projectId "" ;
    m:purePosition "26:32|33:39" ;
    m:temporality "present" ;
    m:uniqueId "6bd469fa-85ca-480d-bdc0-8bb21094cc39|1699018309.563416" .

info:da636bc7-aa43-4041-8310-db6040e861af a l:Attribute ;
    rdfs:label "name" ;
    d:value "John" ;
    m:creationDate "Friday, November 03, 2023 02:31:49" ;
    m:intensity 1e+00 ;
    m:negation false ;
    m:position "0:2" ;
    m:projectId "" ;
    m:purePosition "11:15" ;
    m:temporality "present" ;
    m:uniqueId "da636bc7-aa43-4041-8310-db6040e861af|1699018309.5633535" .

info:fb3d8799-3cdb-4e38-bf20-5261bbb0d5e9 a l:Attribute ;
    rdfs:label "date" ;
    d:value "{'ISO': '2023-11-02', 'formatted': 'Thursday 02 November 2023 00:00:00', 'timestamp': 1698879600, 'chronology': 'past', 'chronology_day': 1, 'confidence': 0.99, 'entity': 'date', 'type': 'date', 'path': 'ENTITY:date', 'source': 'yesterday', 'entity_base': 'date'}" ;
    d:valueSource "yesterday" ;
    m:creationDate "Friday, November 03, 2023 02:31:49" ;
    m:intensity 1e+00 ;
    m:negation false ;
    m:position "0:0|0:3" ;
    m:projectId "" ;
    m:purePosition "0:9|16:25" ;
    m:temporality "present" ;
    m:uniqueId "fb3d8799-3cdb-4e38-bf20-5261bbb0d5e9|1699018309.5634975" .

card:64692444-eb22-40a0-9ffa-b7c14bd4d58a a l:Card ;
    l:Attribute info:6bd469fa-85ca-480d-bdc0-8bb21094cc39 ;
    d:categopath "concrete_thing|natural_thing|other_living_being|plant|plant_part|fruit" ;
    d:categosens "concrete_thing",
        "fruit",
        "natural_thing",
        "other_living_being",
        "plant",
        "plant_part" ;
    d:finestCategosens "fruit" ;
    d:lemma "fruit" ;
    m:creationDate "Friday, November 03, 2023 02:31:49" ;
    m:negation false ;
    m:origin "Lettria" ;
    m:plural true ;
    m:position "0:5" ;
    m:projectId "" ;
    m:purePosition "33:39" ;
    m:uniqueId "64692444-eb22-40a0-9ffa-b7c14bd4d58a|1699018309.5618558" .

card:e48227e6-1a84-4140-a1d9-b3016b6581d7 a l:Card ;
    d:categopath "characteristic_jj|concrete_characteristic|color" ;
    d:categosens "characteristic_jj",
        "color",
        "concrete_characteristic" ;
    d:finestCategosens "color" ;
    d:lemma "orange" ;
    m:creationDate "Friday, November 03, 2023 02:31:49" ;
    m:negation false ;
    m:origin "Lettria" ;
    m:plural false ;
    m:position "0:4" ;
    m:projectId "" ;
    m:purePosition "26:32" ;
    m:uniqueId "e48227e6-1a84-4140-a1d9-b3016b6581d7|1699018309.5619407" .