Interface CortexBranches
- All Known Subinterfaces:
Cortex
-
Method Summary
Modifier and TypeMethodDescriptionvoidMerges the assertions staged on the given branch into the knowledge graph.Returns the assertions staged on the given branch.getBranchInfo(String branch) Summarizes a branch pending review from the provenance activity recorded when it was staged.getBranchSubjects(String branch) Returns the assertions staged on the given branch grouped by subject, excluding the provenance activity of the ingestion.booleanReports whether a branch with the given name is pending review.Returns the names of all branches with staged assertions awaiting review.voidRejects the given branch, discarding its staged assertions.booleanrenameBranchSubjects(String branch, List<BranchRename> renames) Renames subjects staged on the given branch.booleanupdateBranch(String branch, List<BranchChange> changes) Applies reviewer changes — deletions and object edits — to the assertions staged on the given branch.
-
Method Details
-
listBranches
Returns the names of all branches with staged assertions awaiting review.- Returns:
- the branch names, empty if nothing is pending
-
hasBranch
Reports whether a branch with the given name is pending review.- Parameters:
branch- the branch name- Returns:
trueif the branch exists
-
getBranch
Returns the assertions staged on the given branch.- Parameters:
branch- the branch name- Returns:
- the staged assertions serialized in Turtle syntax
-
getBranchInfo
Summarizes a branch pending review from the provenance activity recorded when it was staged.- Parameters:
branch- the branch name- Returns:
- the branch summary
-
getBranchSubjects
Returns the assertions staged on the given branch grouped by subject, excluding the provenance activity of the ingestion.- Parameters:
branch- the branch name- Returns:
- the staged subjects sorted by name, each with its statements sorted by predicate
-
updateBranch
Applies reviewer changes — deletions and object edits — to the assertions staged on the given branch.When the deletions remove every statement a subject carried, its IRI is gone from the branch, so every staged statement referencing that IRI as object is deleted as well.
Changes addressing the provenance activity of the branch are ignored.
- Parameters:
branch- the branch namechanges- the changes to apply- Returns:
trueif the branch existed and the changes were applied
-
renameBranchSubjects
Renames subjects staged on the given branch.Every staged statement referencing a renamed IRI as object is rewritten to reference the new IRI; the statements describing the renamed subject — those carrying the IRI as subject — are removed rather than rewritten.
Renames addressing the provenance activity of the branch are ignored.
- Parameters:
branch- the branch namerenames- the renames to apply- Returns:
trueif the branch existed and the renames were applied
-
approve
Merges the assertions staged on the given branch into the knowledge graph.Each merged statement is recorded with creation provenance, the branch is deleted, and the newly approved statements are added to the inference closure incrementally. Does nothing if the branch does not exist.
- Parameters:
branch- the branch name
-
reject
Rejects the given branch, discarding its staged assertions.Does nothing if the branch does not exist.
- Parameters:
branch- the branch name
-