Class CortexNamespace
cortex:// namespace used by the knowledge graph.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe URI namespace of all resources managed by Cortex.static final org.apache.jena.rdf.model.ResourceThe named graph holding per-statement provenance within the assertions dataset.static final org.apache.jena.rdf.model.ResourceThe named graph holding per-resource view counts within the assertions dataset.static final org.apache.jena.rdf.model.PropertyThe property recording a resource's time-decayed view score, withinUSAGE.static final org.apache.jena.rdf.model.PropertyThe instantVIEW_COUNTwas last recomputed, withinUSAGE. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.jena.rdf.model.ResourceReturns a fresh, randomly named branch resource.static org.apache.jena.rdf.model.ResourcegetResource(String name) Returns the resource with the given name in the Cortex namespace.static org.apache.jena.rdf.model.ResourcegetRetractions(org.apache.jena.rdf.model.Resource branch) Returns the graph holding the statements a branch stages for removal from the approved assertions.static booleanisBranch(org.apache.jena.rdf.model.Resource graph) Reports whether the named graph is a branch, by its name alone.
-
Field Details
-
NS
The URI namespace of all resources managed by Cortex.- See Also:
-
PROVENANCE
public static final org.apache.jena.rdf.model.Resource PROVENANCEThe named graph holding per-statement provenance within the assertions dataset. -
USAGE
public static final org.apache.jena.rdf.model.Resource USAGEThe named graph holding per-resource view counts within the assertions dataset.Like
PROVENANCEthis is a reserved graph, not a branch and not part of the approved assertions: it records how the graph is used rather than what it claims. -
VIEW_COUNT
public static final org.apache.jena.rdf.model.Property VIEW_COUNTThe property recording a resource's time-decayed view score, withinUSAGE.Not a plain tally: the value is discounted towards zero as it ages, so it is only meaningful alongside
VIEW_COUNT_UPDATED, which says when it was last brought up to date. -
VIEW_COUNT_UPDATED
public static final org.apache.jena.rdf.model.Property VIEW_COUNT_UPDATEDThe instantVIEW_COUNTwas last recomputed, withinUSAGE.
-
-
Method Details
-
getResource
Returns the resource with the given name in the Cortex namespace.- Parameters:
name- the local name of the resource- Returns:
- the resource named
cortex://<name>
-
getResource
public static org.apache.jena.rdf.model.Resource getResource()Returns a fresh, randomly named branch resource.- Returns:
- a resource named
cortex://branch-<uuid>
-
getRetractions
public static org.apache.jena.rdf.model.Resource getRetractions(org.apache.jena.rdf.model.Resource branch) Returns the graph holding the statements a branch stages for removal from the approved assertions.It is a graph of its own rather than part of the branch graph because the branch graph is a set of statements to add, and the two must not be confused with each other by any reader. Its name deliberately does not start with
branch-, soisBranch(org.apache.jena.rdf.model.Resource)does not mistake it for a branch of its own.- Parameters:
branch- the branch resource, namedcortex://branch-<uuid>- Returns:
- a resource named
cortex://retract-<uuid>
-
isBranch
public static boolean isBranch(org.apache.jena.rdf.model.Resource graph) Reports whether the named graph is a branch, by its name alone.Branches are named graphs of the assertions dataset, but so are
PROVENANCE,USAGE, and the retraction graphs ofbranches themselves— none of which is a branch, and every one of which would otherwise be listed as one and could be approved into the default graph.- Parameters:
graph- the named graph resource- Returns:
trueif the graph is a branch
-