-
Notifications
You must be signed in to change notification settings - Fork 24
JSON LD
Keith Alcock edited this page May 4, 2018
·
75 revisions
The JSON-LD output format for Eidos is documented in the table below. An example follows which illustrates some of the notation used.
| Name | Property | Type | Description |
|---|---|---|---|
| Corpus | @type | "Corpus" | A corpus is typed. |
| documents | [Document] | It has a list of documents | |
| extractions | [Entity, DirectedRelation, or UndirectionRelation] | and a set of mixed extracted entities and relations. | |
| Document | @type | "Document" | A document is typed |
| @id | IRI | and provided an ID. | |
| title | string | It has a title, | |
| text | string | some text, | |
| sentences | [Sentence] | a list of sentences, | |
| Sentence | @type | "Sentence" | A sentence is typed |
| @id | IRI | and provided an ID. | |
| text | string | It has a text, | |
| words | [Word] | a list of words, | |
| dependencies | [Dependency] | and a set of universal enhanced dependencies | |
| Word | @type | "Word" | A word is typed |
| @id | IRI | and provided an ID. | |
| text | string | It has a text, | |
| tag | string | a tag from the Penn Treebank tag set, | |
| entity | string | an entity type, | |
| startOffset | integer | an inclusive, 0-based index of the first letter of the word in the text, | |
| endOffset | integer | an exclusive, 0-based index of the last letter of the word, | |
| lemma | string | a lemma, | |
| chunk | string | and a chunk. | |
| Dependency | @type | "Dependency" | A dependency is typed. |
| source | {@id(Word)} | It has a source ID referring to a Word, | |
| destination | {@id(Word)} | a destination ID referring to a Word, | |
| relation | string | and a relation. | |
| Entity | @type | "Entity" | An entity is typed |
| @id | IRI | and provided an ID. | |
| labels | [string] | It has a list of labels, | |
| text | [string] | a text, | |
| rule | [string] | a rule, | |
| canonicalName | string | a canonical name, | |
| groundings | [Groundings] | a list of groundings(es), | |
| provenance | [Provenance] | a set of provenance values, | |
| state | [State] | and a set of states. | |
| DirectedRelation | @type | "DirectedRelation" | A directed relation is typed |
| @id | IRI | and provided an ID. | |
| labels | [string] | It has a list of labels, | |
| text | string | a text, | |
| rule | string | a rule, | |
| canonicalName | string | a canonical name, | |
| groundings | [Groundings] | a list of groundings(es), | |
| provenance | [Provenance] | a set of provenance values, | |
| trigger | Trigger | a trigger, | |
| sources | [{@id(Entity, DirectedRelation, or UndirectedRelation)}] | a set of IDs to other source extractions, | |
| destinations | [{@id(Entity, DirectedRelation, or UndirectedRelation)}] | and a set of IDs to other destination extractions. | |
| UndirectedRelation | @type | "UndirectedRelation" | An undirected relation is typed |
| @id | IRI | and provided an ID. | |
| labels | [string] | It has a list of labels, | |
| text | string | a text, | |
| rule | string | a rule, | |
| canonicalName | string | a canonical name, | |
| groundings | [Groundings] | a list of groundings(es), | |
| provenance | [Provenance] | a set of provenance values, | |
| arguments | [{@id(Entity, DirectedRelation, or UndirectedRelation)}] | and a set of IDs to argument extractions. | |
| Groundings | @type | "Groundings" | A groundings is typed. |
| name | string | It has a name such as "un", "wdi", "fao", or "domain" | |
| values | [Grounding] | and a list of grounding values. | |
| Grounding | @type | "Grounding | A grounding is typed. |
| ontologyConcept | string | It has an ontology concept | |
| value | string | and a matching value. | |
| Provenance | @type | "Provenance" | A "provenance" is typed. |
| document | {@id(Document)} | It has a document ID referring to a Document, | |
| documentCharPositions | [Interval] | an interval for characters within the document, | |
| sentence | {@id(Sentence)} | a sentence ID referring to a Sentence, | |
| positions (sentenceWordPositions) | [Interval] | and an interval for words within the sentence. | |
| Interval | @type | "Interval" | An interval is typed. |
| start | integer | It has an inclusive, 1-based index of the first word of the interval in the sentence | |
| end | integer | and an inclusive, 1-based index of the last word. | |
| State | @type | "State" | A state is typed. |
| type | string | It has an Eidos type such as INC, DEC, or QUANT, | |
| text | string | a text, | |
| provenance | [Provenance] | a set of provenance values, now used, | |
| modifiers | [Modifier] | and a set of modifiers. | |
| Modifier | @type | "Modifier" | A modifier is typed. |
| text | string | It has a text, | |
| provenance | [Provenance] | a set of provenance values, now used, | |
| intercept | double | an intercept, | |
| mu | double | a mu, | |
| sigma | double | and a sigma. | |
| Trigger | @type | "Trigger" | A trigger is typed. |
| text | string | It has a text | |
| provenance | [Provenance] | and a set of provenance values. |
This example shows valid JSON-LD syntax and links between elements, even though the linguistic analysis is fabricated.
{
"@context" : {
"Corpus" : "https://github.com/clulab/eidos/wiki/JSON-LD#Corpus",
"Dependency" : "https://github.com/clulab/eidos/wiki/JSON-LD#Dependency",
"DirectedRelation" : "https://github.com/clulab/eidos/wiki/JSON-LD#DirectedRelation",
"Document" : "https://github.com/clulab/eidos/wiki/JSON-LD#Document",
"Entity" : "https://github.com/clulab/eidos/wiki/JSON-LD#Entity",
"Grounding" : "https://github.com/clulab/eidos/wiki/JSON-LD#Grounding",
"Groundings" : "https://github.com/clulab/eidos/wiki/JSON-LD#Groundings",
"Interval" : "https://github.com/clulab/eidos/wiki/JSON-LD#Interval",
"Modifier" : "https://github.com/clulab/eidos/wiki/JSON-LD#Modifier",
"Provenance" : "https://github.com/clulab/eidos/wiki/JSON-LD#Provenance",
"Sentence" : "https://github.com/clulab/eidos/wiki/JSON-LD#Sentence",
"State" : "https://github.com/clulab/eidos/wiki/JSON-LD#State",
"Trigger" : "https://github.com/clulab/eidos/wiki/JSON-LD#Trigger",
"UndirectedRelation" : "https://github.com/clulab/eidos/wiki/JSON-LD#UndirectedRelation",
"Word" : "https://github.com/clulab/eidos/wiki/JSON-LD#Word"
},
"@type" : "Corpus",
"documents" : [ {
"@type" : "Document",
"@id" : "_:Document_1",
"title" : "Example Document",
"sentences" : [ {
"@type" : "Sentence",
"@id" : "_:Sentence_1",
"text" : "Hello , world !",
"words" : [ {
"@type" : "Word",
"@id" : "_:Word_1",
"text" : "Hello",
"tag" : "UH",
"entity" : "O",
"startOffset": 0,
"endOffset" : 5,
"lemma" : "hello",
"chunk" : "B-ADVP"
}, {
"@type" : "Word",
"@id" : "_:Word_2",
"text" : ",",
"tag" : ",",
"entity" : "O",
"startOffset" : 5,
"endOffset" : 6,
"lemma" : ",",
"chunk" : "O"
}, {
"@type" : "Word",
"@id" : "_:Word_3",
"text" : "world",
"tag" : "NN",
"entity" : "O",
"startOffset" : 7,
"endOffset" : 12,
"lemma" : "world",
"chunk" : "B-NP"
}, {
"@type" : "Word",
"@id" : "_:Word_4",
"text" : "!",
"tag" : ".",
"entity" : "O",
"startOffset" : 12,
"endOffset" : 13,
"lemma" : "!",
"chunk" : "O"
} ],
"dependencies" : [ {
"@type" : "Dependency",
"source" : {
"@id" : "_:Word_3"
},
"destination" : {
"@id" : "_:Word_1"
},
"relation" : "discourse"
}, {
"@type" : "Dependency",
"source" : {
"@id" : "_:Word_3"
},
"destination" : {
"@id" : "_:Word_2"
},
"relation" : "punct"
} ]
} ]
} ],
"extractions" : [ {
"@type" : "Entity",
"@id" : "_:Entity_1",
"labels" : [ "NounPhrase", "Entity" ],
"text" : "world",
"rule" : "simple-np",
"canonicalName" : "world",
"groundings" : [ {
"@type" : "Groundings",
"name" : "un",
"values" : [ {
"grounding" : [ {
"@type" : "Grounding",
"ontologyConcept" : "/entities/human/livelihood",
"value" : 0.47524851930210044
}, {
"@type" : "Grounding",
"ontologyConcept" : "/entities/human/economy",
"value" : 0.4713680118187502
} ]
}, {
"@type" : "Groundings",
"name" : "fao",
"values" : [ {
"grounding" : [ {
"@type" : "Grounding",
"ontologyConcept" : "/events/Urban population",
"value" : 0.4898354789898607
}, {
"@type" : "Grounding",
"ontologyConcept" : "/events/Annual growth",
"value" : 0.3403485379430627
} ]
} ],
"provenance" : [ {
"@type" : "Provenance",
"document" : {
"@id" : "_:Document_1"
},
"sentence" : {
"@id" : "_:Sentence_1"
},
"positions" : [ {
"@type" : "Interval",
"start" : 3,
"end" : 3
} ]
} ],
"states" : [ {
"@type" : "State",
"type" : "INC",
"text" : "Hello",
"modifiers" : [ {
"@type" : "Modifier",
"text" : "world",
"intercept" : 0.6154,
"mu" : 1.034E-5,
"sigma" : -0.001123
} ]
} ]
}, {
"@type" : "DirectedRelation",
"@id" : "_:DirectedRelation_1",
"labels" : [ "Causal", "DirectedRelation", "EntityLinker", "Event" ],
"text" : "Hello",
"rule" : "dueToSyntax1-Causal",
"canonicalName" : "hello",
"provenance" : [ {
"@type" : "Provenance",
"document" : {
"@id" : "_:Document_1"
},
"sentence" : {
"@id" : "_:Sentence_1"
},
"positions" : [ {
"@type" : "Interval",
"start" : 1,
"end" : 1
} ]
} ],
"trigger" : {
"@type" : "Trigger",
"text" : "world",
"provenance" : [ {
"@type" : "Provenance",
"document" : {
"@id" : "_:Document_1"
},
"sentence" : {
"@id" : "_:Sentence_1"
},
"positions" : [ {
"@type" : "Interval",
"start" :3,
"end" : 3
} ]
} ]
},
"sources" : [ {
"@id" : "_:Entity_1"
} ],
"destinations" : [ {
"@id" : "_:UndirectedRelation_1"
} ]
}, {
"@type" : "UndirectedRelation",
"@id" : "_:UndirectedRelation_1",
"labels" : [ "SameAs", "UndirectedRelation", "EntityLinker", "Event" ],
"text" : "world",
"rule" : "dueToSyntax1-Causal",
"canonicalName" : "world",
"provenance" : [ {
"@type" : "Provenance",
"document" : {
"@id" : "_:Document_1"
},
"sentence" : {
"@id" : "_:Sentence_1"
},
"positions" : [ {
"@type" : "Interval",
"start" : 3,
"end" : 3
} ]
} ],
"trigger" : {
"@type" : "Trigger",
"text" : "Hello",
"provenance" : [ {
"@type" : "Provenance",
"document" : {
"@id" : "_:Document_1"
},
"sentence" : {
"@id" : "_:Sentence_1"
},
"positions" : [ {
"@type" : "Interval",
"start" : 1,
"end" : 1
} ]
} ]
},
"arguments" : [ {
"@id" : "_:Entity_1"
}, {
"@id" : "_:DirectedRelation_1"
} ]
} ]
}