Interface CortexIngestor

All Known Subinterfaces:
Cortex

public interface CortexIngestor
Validates and stages incoming RDF assertions, and edits to approved ones, onto a review branch.
  • Method Summary

    Modifier and Type
    Method
    Description
    Validates the given assertions and stages them on a new branch.
    Stages an edit to an already-approved resource on a new branch.
  • Method Details

    • ingest

      IngestResult ingest(String ttl)
      Validates the given assertions and stages them on a new branch.

      The input must first pass the lint check against the ontology; assertions failing it are rejected without being staged. Input that lints clean is then validated against the configured SHACL shapes, together with the already approved assertions, so incoming statements may rely on approved ones to conform. If the union conforms, the statements not already approved are stored on a newly created branch awaiting approval; otherwise nothing is stored and the validation errors are reported in the result. Statements that are already approved are never staged again; if nothing novel remains, no branch is created.

      Parameters:
      ttl - RDF assertions in Turtle syntax, based on the classes and properties of the ontology
      Returns:
      the outcome, carrying either the name of the created branch — null if every assertion was already approved — or the lint or validation errors
    • revise

      IngestResult revise(ResourceEdit edit)
      Stages an edit to an already-approved resource on a new branch.

      Editing an approved statement means retracting it as well as asserting its replacement, so the branch this stages carries both: the statements to add and the statements to remove. It is still only a proposal — nothing reaches the approved assertions until the branch is approved, which is the same guarantee ingest(String) gives.

      The additions must lint clean against the ontology, and the assertions as they would be once the branch is approved must conform to the configured SHACL shapes — a stricter check than ingest(String) makes, because a retraction can break a constraint an approved statement was satisfying. If either fails, nothing is staged and the errors are reported in the result. Additions already approved and retractions of statements that are not approved are dropped; if nothing remains, no branch is created.

      Parameters:
      edit - the proposed edit
      Returns:
      the outcome, carrying either the name of the created branch — null if the edit would change nothing — or the lint or validation errors