Skip to content

Results and sharing

Results and provenance

GET /jobs/{id}/result takes graph, facts (default) or ontology (the ontologies the job used or updated), and format: turtle (default), ntriples, nquads, trig or jsonld. Each fact's provenance (the chunk it was extracted from) is an rdf:Statement describing the fact, with prov:wasDerivedFrom: RDF 1.1, readable by any RDF tool. profile=native keeps it as stored, in RDF 1.2 (rdf:reifies).

Two more formats give tables instead of RDF: format=csv is a zip with one <Class>.csv per class (id, label, types, then a column per datatype property), links.csv and a README.txt; format=neo4j is a zip with nodes.csv, relationships.csv, an import.cypher for a running Neo4j and the neo4j-admin database import command in its README.txt. Provenance is left out, blank nodes are skipped (the README counts them), and a graph over max_graph_triples answers 413. /projects/{slug}/export?bundle=true takes the same two formats and puts one such zip per graph in the bundle.

Each job writes its facts to its own named graph (graph_uri), so running a document again adds a second set of facts beside the first; delete the job you no longer want. Entity IRIs come from the document, so the same document gives the same IRIs in every run. A job's outputs also say how its facts hang together: facts_components (connected groups), facts_isolated (entities linked to no other), facts_links_removed (links the validation repairs removed) and facts_untyped_inferred (entities typed from the ontology instead of dropped). What a job wrote or read can be deleted later; its result then answers 410.

Comparing two runs

GET /jobs/{id}/compare?with={other} compares the facts of two completed jobs of yours, entity by entity, with provenance left out. It returns a and b (the job in the path and the one in with: id, name, created_at, triples), same_document, counts (added, removed, changed, unchanged, and blank_triples_a/blank_triples_b, triples through blank nodes, which are counted and not compared) and entities: one object per entity with iri, status (added means only b has it), label, types and the triples that differ as added/removed lists of [predicate, object]. Entities match by IRI, which is minted per document: runs over the same document (same_document true) line up, runs over different documents show mostly added and removed. The list stops at 2,000 entities with truncated: true; counts stay complete. Errors: 404 job_not_found (also for another account's job) or facts_not_found, 409 job_not_complete, 410 results_removed, 413 graph_too_large above max_graph_triples, 422 same_job, 502 store_failed when the triple store fails (retry).

Source passages

GET /jobs/{id}/units returns the text of each part (content unit) a finished extraction processed, in document order: {"units": […]}, one object per part with iri, index, section, headings and text. iri is the part's IRI, the one each fact's provenance names with prov:wasDerivedFrom, so a fact can be shown with the passage it came from; section is the section label the run gave the part (or null) and headings the headings that open its section. The text is kept with the job and deleted with it, its project or your account. Imports, jobs still running and jobs from before it was kept answer 404 units_not_found.

Share links

A share is a public link to a frozen copy of one completed job: anyone holding the link can read it, without an account. Later changes to the job, its project or its ontologies do not reach the copy.

  • POST /jobs/{id}/shares with {"include_passages": false} makes one and answers 201 with id, url, created_at and includes_passages. The link is shown only now; only a hash of its token is kept, so a lost link cannot be recovered: make another. The copy holds the job's facts, the ontology versions it used (an import, which records none, gets the project's current versions) and, with include_passages, the text of its parts when the job kept them. Imports can be shared; sample projects cannot (409 sample_read_only). A job that has not completed answers 409 job_not_complete, one with ten live shares 409 too_many_shares, facts over max_graph_triples 413 graph_too_large; a job without facts 404 facts_not_found, one whose facts were deleted 410 results_removed, and a triple store failure 502 store_failed, as in Comparing two runs.
  • GET /jobs/{id}/shares lists a job's shares, newest first, revoked ones included, without their links.
  • DELETE /shares/{id} revokes a share: its copy is deleted and its link answers 404. Deleting the job, its project or your account revokes its shares too.
  • GET /public/shares/{token}/{file} reads the copy, with no credentials. file is meta.json (title, created_at, document, counts with triples and entities, includes_passages, ontology_titles), graph.ttl (the facts as Turtle, provenance as rdf:Statement; the provenance names each fact's part with its position and section labels, which repeat the document's headings, but not the part's text), ontology.ttl (absent when the job used no ontology) or units.json ({"units": […]} as in Source passages, present only with passages). Anything else, and a revoked share, answers 404 share_not_found. Responses may be cached for five minutes, so a revoked copy can stay visible that long. Reads are limited per address (429).