A Compositional Framework for Typed Graph Contexts on the Web
Foxxi Mediums Inc. — Specification Draft — 17 March 2026
This specification defines Context Graphs, an abstract data model and RDF vocabulary for representing, composing, and querying typed contextual metadata over RDF graphs and datasets. Context Graphs provide a principled mechanism for annotating RDF Named Graphs [RDF12-CONCEPTS] with structured provenance [PROV-O], temporal extent, agent attribution, access control policies, semiotic interpretation frames, and compositional relationships—all expressed as first-class RDF resources.
The model extends the RDF 1.2 Dataset abstraction by introducing Context Descriptors: typed resources that associate a Named Graph with one or more Context Facets, each drawn from a controlled vocabulary of context types. Context Descriptors compose via algebraic operations (union, intersection, restriction, projection) enabling federated systems to negotiate shared contexts across trust boundaries. The vocabulary reuses and profiles existing W3C Recommendations including RDF 1.2, SPARQL 1.2, JSON-LD 1.1, SHACL, PROV-O, Activity Streams 2.0, Verifiable Credentials Data Model 2.0, Web Annotation Data Model, and the Solid Protocol.
This section describes the status of this document at the time of its publication.
This document is an independent specification published by Foxxi Mediums Inc. It is written in the style of a W3C Technical Report and extensively profiles and reuses W3C Recommendations, but it is not a product of any W3C Working Group and does not carry W3C endorsement or Recommendation status. References to W3C specifications throughout this document indicate normative or informative dependencies on those specifications, not organizational affiliation.
This specification is offered under a permissive open license for community review, adoption, and extension. The author welcomes feedback and contributions.
Comments on this specification are welcome. Please file issues on the GitHub repository.
This section is non-normative.
The Resource Description Framework (RDF) [RDF12-CONCEPTS] provides Named Graphs as a mechanism for grouping triples into identifiable units within an RDF Dataset. However, the RDF specification intentionally leaves the semantics of graph naming open: a graph name is simply an IRI, and what that IRI denotes—whether the graph itself, the act of asserting the graph, or some external resource—is unspecified. This architectural openness, while preserving generality, has led to fragmented practices for associating contextual metadata (provenance, temporality, trust, access control) with graph-level units of data.
The Context Graphs specification addresses this gap by defining a formal, composable layer of typed contextual metadata over RDF Named Graphs. Rather than inventing new primitives, Context Graphs profiles and composes existing W3C vocabularies into a coherent framework with well-defined algebraic composition semantics.
Existing approaches to graph-level metadata suffer from several limitations:
Named Graph opacity. RDF 1.2 Named Graphs carry an IRI identifier but no standardized mechanism for describing what that graph represents, when it was asserted, by whom, or under what authority. Practitioners resort to ad hoc metadata triples in the default graph with no interoperable schema.
Vocabulary fragmentation. Provenance metadata uses PROV-O; temporal annotations use OWL-Time or Dublin Core; access control uses WAC or ACP; trust uses Verifiable Credentials. No specification defines how these vocabularies compose at the graph level or how a consuming system should interpret their co-occurrence.
Federation impedance. When graphs from multiple origins are merged into a single dataset—as in Solid pod aggregation, SPARQL federation, or linked data crawling—the contextual metadata from each source must be preserved, compared, and negotiated. There is no standard model for this operation.
Statement-level context. RDF 1.2 triple terms (RDF-star) enable statements about statements, but the relationship between triple-level annotations and graph-level context is undefined. Context Graphs bridges this gap by defining how triple term annotations inherit from, override, or refine their enclosing graph's context.
The design of this specification is guided by the following principles:
DG1. Maximal Reuse. Every concept in this specification SHOULD be expressible using an existing W3C vocabulary. New terms are introduced only when no existing term provides the required semantics.
DG2. Compositional Closure. Context Descriptors compose under well-defined algebraic operations (union, intersection, restriction, projection). The result of any composition operation is itself a valid Context Descriptor.
DG3. Layered Adoption. Conformant implementations may support any subset of Context Facet types. A system that understands only Temporal and Provenance facets can still consume and preserve facets it does not understand.
DG4. Decentralization. Context Graphs are designed for decentralized environments (Solid, federated SPARQL, linked data). No central authority is required for context creation, validation, or resolution.
DG5. Formal Grounding. The compositional model has a category-theoretic interpretation as a presheaf over a context category, ensuring formal properties (functoriality, naturality of context transformations) hold.
| Specification | Version | Relationship |
|---|---|---|
| RDF Concepts | 1.2 (WD) | Foundation. Context Graphs extends Named Graphs and Triple Terms. |
| RDF Schema | 1.2 (WD) | Vocabulary definitions use RDFS classes and properties. |
| SPARQL Query | 1.2 (WD) | Context-aware query patterns defined via SPARQL extension functions. |
| JSON-LD | 1.1 (Rec) | JSON-LD context document provided for serialization. |
| SHACL | 1.0 (Rec), 1.1 (WD) | SHACL shapes for validating Context Descriptors. |
| PROV-O | 1.0 (Rec) | Provenance Facet profiles prov:Activity, prov:Entity, prov:Agent. |
| OWL-Time | 1.0 (Rec) | Temporal Facet uses time:Interval, time:Instant. |
| Activity Streams | 2.0 (Rec) | Agent Facet compatible with AS2 Actor model. |
| Verifiable Credentials | 2.0 (Rec) | Trust Facet leverages VC Data Model for signed contexts. |
| Web Annotation | 1.0 (Rec) | Annotation model informs triple-level context targeting. |
| Web Access Control | (ED) | Access Facet profiles WAC authorization model. |
| Solid Protocol | 0.11 (ED) | Federation Facet and storage integration defined. |
| Dublin Core Terms | 2020 (ISO 15836) | Temporal and descriptive metadata alignment. |
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this document are to be interpreted as described in [RFC2119] and [RFC8174].
This specification defines four conformance classes:
cg: namespace and
MUST preserve unrecognized facets during processing. A consumer
SHOULD implement at least the Temporal and Provenance facets.The Context Graphs data model extends the RDF 1.2 Dataset model [RDF12-CONCEPTS §5] with three new abstract constructs: Context Descriptors, Context Facets, and Context–Graph Bindings. These constructs are themselves represented as RDF resources, ensuring that the meta-layer is fully expressible in the object language.
cg:ContextDescriptor
that aggregates one or more Context Facets into a single, identifiable unit of contextual
metadata. Each Context Descriptor is identified by an IRI and carries a set of facet bindings.
Formally, a Context Descriptor D is a tuple:
D = ( id: IRI,
facets: Set<ContextFacet>,
version: xsd:nonNegativeInteger,
supersedes: Set<IRI>,
validFrom: xsd:dateTime?,
validUntil: xsd:dateTime? )
Where:
• id is the IRI identifying this Context Descriptor.
• facets is a non-empty set of Context Facet instances.
• version is a monotonically increasing version counter (default: 0).
• supersedes is the (possibly empty) set of Context Descriptor IRIs that this descriptor replaces.
• validFrom / validUntil bound the temporal validity of the descriptor itself (distinct from any Temporal Facet within it).
validFrom/validUntil pair on the descriptor represents the
administrative validity window—when the descriptor itself is considered authoritative.
This is distinct from the Temporal Facet, which describes when the described graph's content
is temporally scoped. A descriptor can be administratively valid while describing a graph whose
temporal extent lies in the past.
Formally, a Context Facet F is a tuple:
F = ( type: cg:ContextType,
properties: Map<IRI, RDFTerm> )
The specification defines seven core facet types (§5). Implementations
MAY define additional facet types by minting new instances of
cg:ContextType in their own namespace.
| Facet Type IRI | Label | Primary Reused Vocabulary |
|---|---|---|
cg:Temporal | Temporal | OWL-Time, Dublin Core Terms |
cg:Provenance | Provenance | PROV-O |
cg:Agent | Agent | PROV-O, Activity Streams 2.0 |
cg:AccessControl | Access Control | WAC, ACP, Solid |
cg:Semiotic | Semiotic | (new vocabulary; see §5.5) |
cg:Trust | Trust & Verifiability | Verifiable Credentials 2.0, DID Core |
cg:Federation | Federation | Solid Protocol, LDP, DCAT 3 |
cg:describes property.
<urn:cg:descriptor:42> a cg:ContextDescriptor ;
cg:describes <urn:graph:observations-2026-Q1> ;
cg:describes <urn:graph:observations-2026-Q2> .
A single Context Descriptor MAY describe multiple Named Graphs (one-to-many). A single Named Graph MAY be described by multiple Context Descriptors (many-to-one). When a graph is described by multiple descriptors, the effective context is the union of all descriptor facets unless explicitly composed otherwise via composition operators.
<.well-known/context-graphs> relative to the dataset's base IRI. This
ensures that context metadata is discoverable without requiring knowledge of specific Named
Graph IRIs.
Context Descriptors compose under four algebraic operators. These operators are closed: the result of any operator applied to valid Context Descriptors is itself a valid Context Descriptor.
cg:union)Given descriptors D₁ and D₂, the union D₁ ∪ D₂ produces a new descriptor whose facet set is the set union of all facets from both operands. Where facets of the same type appear in both operands, they are combined according to the merge semantics defined by the facet type's profile (see §5).
<urn:cg:composed:1> a cg:ComposedDescriptor ;
cg:compositionOp cg:union ;
cg:operand <urn:cg:descriptor:A> ;
cg:operand <urn:cg:descriptor:B> .
cg:intersection)The intersection D₁ ∩ D₂ produces a descriptor containing only facet types present in both operands. For each shared facet type, the intersection of the facet's properties is computed (type-specific; see §5). This operator is useful for computing the common context when federating graphs from independent sources.
cg:restriction)Given a descriptor D and a set of facet types T, the restriction D|T produces a new descriptor containing only the facets whose types are in T. This enables context projection—e.g., extracting only the provenance information from a rich context.
<urn:cg:restricted:1> a cg:ComposedDescriptor ;
cg:compositionOp cg:restriction ;
cg:operand <urn:cg:descriptor:A> ;
cg:restrictToType cg:Provenance ;
cg:restrictToType cg:Temporal .
cg:override)Given descriptors D₁ (base) and D₂ (override), D₂ ▷ D₁ produces a descriptor where facets from D₂ replace same-typed facets in D₁, and facets unique to either operand are preserved. This models the common pattern where a local context overrides inherited defaults.
cg:union as join, cg:intersection as meet, the empty descriptor
as bottom, and the universal descriptor (containing all facet types with maximal property ranges)
as top. This lattice structure ensures that context negotiation in federated settings converges.
RDF 1.2 introduces triple terms [RDF12-CONCEPTS §3.5], enabling statements about statements. Context Graphs defines a mechanism for triple-level context annotations that interact with graph-level Context Descriptors.
cg: vocabulary, associating
context facet information directly with a specific statement.
# Graph-level context
<urn:cg:desc:1> a cg:ContextDescriptor ;
cg:describes <urn:graph:G1> ;
cg:hasFacet [ a cg:TemporalFacet ;
cg:validFrom "2026-01-01T00:00:00Z"^^xsd:dateTime ] .
# Triple-level context override (RDF 1.2 triple term)
<< <urn:sensor:7> <urn:vocab:reading> "42.3"^^xsd:double >>
cg:hasFacet [ a cg:TemporalFacet ;
cg:validFrom "2026-03-15T14:30:00Z"^^xsd:dateTime ] .
Inheritance rule: When a triple within a Named Graph has its own triple-level context annotation, the effective context for that triple is computed as:
effectiveContext(triple) = override(tripleContext, graphContext)
That is, triple-level facets override graph-level facets of the same type, and graph-level facets not overridden at the triple level are inherited. This follows the Override composition operator semantics (§3.4.4).
The Context Graphs vocabulary is identified by the namespace IRI:
https://ns.foxximediums.com/context-graphs#
The conventional prefix is cg:.
The following prefix bindings are used throughout this specification:
| Prefix | Namespace IRI | Specification |
|---|---|---|
cg: | https://ns.foxximediums.com/context-graphs# | This specification |
rdf: | http://www.w3.org/1999/02/22-rdf-syntax-ns# | RDF 1.2 |
rdfs: | http://www.w3.org/2000/01/rdf-schema# | RDF Schema 1.2 |
xsd: | http://www.w3.org/2001/XMLSchema# | XML Schema Datatypes |
owl: | http://www.w3.org/2002/07/owl# | OWL 2 |
prov: | http://www.w3.org/ns/prov# | PROV-O |
time: | http://www.w3.org/2006/time# | OWL-Time |
dct: | http://purl.org/dc/terms/ | Dublin Core Terms |
as: | https://www.w3.org/ns/activitystreams# | Activity Streams 2.0 |
shacl: | http://www.w3.org/ns/shacl# | SHACL |
acl: | http://www.w3.org/ns/auth/acl# | Web Access Control |
vc: | https://www.w3.org/2018/credentials# | Verifiable Credentials 2.0 |
did: | https://www.w3.org/ns/did# | DID Core |
dcat: | http://www.w3.org/ns/dcat# | DCAT 3 |
ldp: | http://www.w3.org/ns/ldp# | Linked Data Platform |
solid: | http://www.w3.org/ns/solid/terms# | Solid Terms |
oa: | http://www.w3.org/ns/oa# | Web Annotation |
cg:ContextDescriptorprov:Entity, dcat:Resourcecg:ComposedDescriptorcg:ContextDescriptorcg:compositionOp property identifies the
operator, and cg:operand links to the input descriptors.
cg:ContextFacetcg:TemporalFacetcg:ContextFacet, time:TemporalEntitycg:ProvenanceFacetcg:ContextFacet, prov:Entitycg:AgentFacetcg:ContextFacetcg:AccessControlFacetcg:ContextFacetcg:SemioticFacetcg:ContextFacetcg:TrustFacetcg:ContextFacetcg:FederationFacetcg:ContextFacet, dcat:DataServicecg:ContextTyperdfs:Classcg:Temporal, cg:Provenance, etc.). Extensible by third parties.
cg:describescg:ContextDescriptorrdfs:Resource (typically a Named Graph IRI)cg:hasFacetcg:ContextDescriptor ∪ RDF Triple Termcg:ContextFacetcg:hasFacet value.
cg:facetTypecg:ContextFacetcg:ContextTyperdf:type with a specific facet class, but useful for
extensibility when custom facet types are introduced.
cg:compositionOpcg:ComposedDescriptorcg:CompositionOperatorcg:operandcg:ComposedDescriptorcg:ContextDescriptorcg:restrictToTypecg:ComposedDescriptorcg:ContextTypecg:restriction to specify which facet types
to retain.
cg:supersedescg:ContextDescriptorcg:ContextDescriptorcg:versioncg:ContextDescriptorxsd:nonNegativeInteger
cg:validFromcg:ContextDescriptor ∪ cg:TemporalFacetxsd:dateTimedct:valid semantics and vc:validFrom.
cg:validUntilcg:ContextDescriptor ∪ cg:TemporalFacetxsd:dateTime
The following named individuals are instances of cg:ContextType:
cg:Temporal a cg:ContextType ; rdfs:label "Temporal"@en .
cg:Provenance a cg:ContextType ; rdfs:label "Provenance"@en .
cg:Agent a cg:ContextType ; rdfs:label "Agent"@en .
cg:AccessControl a cg:ContextType ; rdfs:label "Access Control"@en .
cg:Semiotic a cg:ContextType ; rdfs:label "Semiotic"@en .
cg:Trust a cg:ContextType ; rdfs:label "Trust"@en .
cg:Federation a cg:ContextType ; rdfs:label "Federation"@en .
cg:union a cg:CompositionOperator ; rdfs:label "Union"@en .
cg:intersection a cg:CompositionOperator ; rdfs:label "Intersection"@en .
cg:restriction a cg:CompositionOperator ; rdfs:label "Restriction"@en .
cg:override a cg:CompositionOperator ; rdfs:label "Override"@en .
Each facet type defines a profile: the set of properties it carries, the vocabularies it reuses, its merge semantics under composition, and its SHACL shape constraints.
The Temporal Facet represents the temporal extent or validity of the described graph's content. It profiles OWL-Time [OWL-Time] and Dublin Core temporal properties.
cg:TemporalFacet (subclass of cg:ContextFacet, time:TemporalEntity)cg:validFrom → xsd:dateTime (aligned with dct:valid start)cg:validUntil → xsd:dateTimetime:hasBeginning → time:Instant (for richer temporal modeling)time:hasEnd → time:Instantcg:temporalResolution → time:Duration (granularity of temporal claims)cg:temporalRelation → Allen Interval relation IRI (e.g., time:intervalDuring)
validFrom is the
minimum of the operands and whose validUntil is the maximum
(i.e., the convex hull of the temporal intervals).[] a cg:TemporalFacet ;
cg:validFrom "2026-01-01T00:00:00Z"^^xsd:dateTime ;
cg:validUntil "2026-03-31T23:59:59Z"^^xsd:dateTime ;
cg:temporalResolution "P1D"^^xsd:duration ;
time:hasBeginning [ a time:Instant ;
time:inXSDDateTimeStamp "2026-01-01T00:00:00Z"^^xsd:dateTimeStamp ] .
The Provenance Facet profiles PROV-O [PROV-O] to describe how the graph's content was generated, by what activities, and from which sources.
cg:ProvenanceFacet (subclass of cg:ContextFacet, prov:Entity)prov:wasGeneratedBy → prov:Activityprov:wasDerivedFrom → prov:Entity (source data)prov:wasAttributedTo → prov:Agentprov:generatedAtTime → xsd:dateTimeprov:used → prov:Entity (inputs consumed by the generating activity)cg:provenanceChain → rdf:List of cg:ProvenanceFacet (ordered derivation history)
prov:wasDerivedFrom sets.[] a cg:ProvenanceFacet ;
prov:wasGeneratedBy [
a prov:Activity ;
prov:wasAssociatedWith <https://example.org/agent/etl-pipeline-v3> ;
prov:startedAtTime "2026-03-17T08:00:00Z"^^xsd:dateTime ;
prov:used <https://data.example.org/raw/sensor-dump-20260317.csv>
] ;
prov:wasDerivedFrom <https://data.example.org/raw/sensor-dump-20260317.csv> ;
prov:generatedAtTime "2026-03-17T08:42:00Z"^^xsd:dateTime .
The Agent Facet identifies the agents (persons, organizations, software) responsible for or associated with the graph, profiling both PROV-O agents and Activity Streams 2.0 actors.
cg:AgentFacet (subclass of cg:ContextFacet)cg:assertingAgent → prov:Agent ∩ as:Actor (the agent asserting the graph)cg:onBehalfOf → prov:Agent (delegation chain, per prov:actedOnBehalfOf)cg:agentRole → cg:AgentRole (e.g., cg:Author, cg:Curator, cg:Validator)cg:agentIdentity → IRI (DID, WebID, ORCID, or other agent identifier)
[] a cg:AgentFacet ;
cg:assertingAgent [
a prov:SoftwareAgent, as:Application ;
rdfs:label "HELA Ingestion Pipeline" ;
cg:agentIdentity <did:web:foxximediums.com:hela:ingest>
] ;
cg:agentRole cg:Author ;
cg:onBehalfOf <https://foxximediums.com/#org> .
The Access Control Facet profiles Web Access Control (WAC) [WAC] to declare who may read, write, append, or control the described graph.
cg:AccessControlFacet (subclass of cg:ContextFacet)cg:authorization → acl:Authorizationacl:mode → { acl:Read, acl:Write, acl:Append, acl:Control }acl:agent → Agent IRIacl:agentClass → Class IRI (e.g., foaf:Agent for public access)cg:consentBasis → IRI (legal basis for data processing, e.g., GDPR Article 6 basis)
The Semiotic Facet is a novel contribution of this specification. It captures the interpretive frame under which the graph's content should be understood, grounded in Peircean triadic semiotics (sign–object–interpretant).
cg:SemioticFacet (subclass of cg:ContextFacet)cg:interpretationFrame → IRI (the ontological or conceptual framework for interpretation)cg:signSystem → IRI (the vocabulary or schema that defines the sign repertoire)cg:groundTruth → xsd:boolean (whether this graph is asserted as ground truth)cg:modalStatus → { cg:Asserted, cg:Hypothetical,
cg:Counterfactual, cg:Quoted, cg:Retracted }cg:epistemicConfidence → xsd:double [0.0, 1.0] (degree of belief)cg:languageTag → xsd:language (natural language of content, aligns with dct:language)
[] a cg:SemioticFacet ;
cg:interpretationFrame <https://schema.org/MedicalScholarlyArticle> ;
cg:signSystem <http://purl.bioontology.org/ontology/SNOMEDCT/> ;
cg:modalStatus cg:Asserted ;
cg:epistemicConfidence "0.92"^^xsd:double ;
cg:languageTag "en"^^xsd:language .
cg:modalStatus property provides
this missing pragmatic layer, extending the annotation capabilities of RDF 1.2 triple terms
to the graph level.
The Trust Facet profiles Verifiable Credentials Data Model 2.0 [VC-DATA-MODEL-2.0] and DID Core [DID-CORE] to enable cryptographic verification of context claims.
cg:TrustFacet (subclass of cg:ContextFacet)cg:verifiableCredential → vc:VerifiableCredentialcg:issuer → IRI (DID or WebID of the credential issuer, aligned with vc:issuer)cg:proofMechanism → IRI (e.g., https://w3id.org/security#Ed25519Signature2020)cg:trustLevel → { cg:SelfAsserted, cg:ThirdPartyAttested,
cg:CryptographicallyVerified }cg:revocationStatus → IRI (link to a VC status list or revocation endpoint)
The Federation Facet describes the origin, storage location, synchronization protocol, and cataloging metadata for graphs in a federated environment. It profiles DCAT 3 [DCAT-3], Linked Data Platform [LDP], and Solid Protocol.
cg:FederationFacet (subclass of cg:ContextFacet, dcat:DataService)cg:origin → IRI (the authoritative source of this graph)cg:storageEndpoint → IRI (the LDP/Solid container or SPARQL endpoint where the graph resides)dcat:endpointURL → IRI (SPARQL endpoint, if applicable)cg:syncProtocol → { cg:SolidNotifications, cg:WebSub,
cg:LinkedDataNotifications, cg:Polling }cg:replicaOf → IRI (link to the authoritative graph IRI if this is a replica)cg:lastSynced → xsd:dateTimedcat:distribution → dcat:Distribution (format, access URL, media type)
[] a cg:FederationFacet ;
cg:origin <https://pod.example.org/alice/data/observations> ;
cg:storageEndpoint <https://pod.example.org/alice/> ;
cg:syncProtocol cg:SolidNotifications ;
cg:lastSynced "2026-03-17T12:00:00Z"^^xsd:dateTime ;
dcat:endpointURL <https://sparql.example.org/query> ;
dcat:distribution [
a dcat:Distribution ;
dcat:mediaType "application/trig" ;
dcat:accessURL <https://pod.example.org/alice/data/observations.trig>
] .
The following SHACL [SHACL] shapes define the validation constraints for Context Graph data. Conformant producers MUST generate data that passes validation against these shapes. Conformant validators MUST implement these shapes.
@prefix cg: <https://ns.foxximediums.com/context-graphs#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
# ── Context Descriptor Shape ──────────────────────────────────
cg:ContextDescriptorShape a sh:NodeShape ;
sh:targetClass cg:ContextDescriptor ;
sh:property [
sh:path cg:hasFacet ;
sh:minCount 1 ;
sh:class cg:ContextFacet ;
sh:message "A ContextDescriptor MUST have at least one facet." ;
] ;
sh:property [
sh:path cg:describes ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:message "A ContextDescriptor MUST describe at least one Named Graph." ;
] ;
sh:property [
sh:path cg:version ;
sh:maxCount 1 ;
sh:datatype xsd:nonNegativeInteger ;
] ;
sh:property [
sh:path cg:validFrom ;
sh:maxCount 1 ;
sh:datatype xsd:dateTime ;
] ;
sh:property [
sh:path cg:validUntil ;
sh:maxCount 1 ;
sh:datatype xsd:dateTime ;
] ;
sh:sparql [
sh:message "validUntil MUST be after validFrom when both are present." ;
sh:select """
SELECT $this WHERE {
$this cg:validFrom ?from .
$this cg:validUntil ?until .
FILTER (?until <= ?from)
}
""" ;
] .
# ── Composed Descriptor Shape ─────────────────────────────────
cg:ComposedDescriptorShape a sh:NodeShape ;
sh:targetClass cg:ComposedDescriptor ;
sh:property [
sh:path cg:compositionOp ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:class cg:CompositionOperator ;
] ;
sh:property [
sh:path cg:operand ;
sh:minCount 1 ;
sh:class cg:ContextDescriptor ;
] .
# ── Temporal Facet Shape ──────────────────────────────────────
cg:TemporalFacetShape a sh:NodeShape ;
sh:targetClass cg:TemporalFacet ;
sh:property [
sh:path cg:validFrom ;
sh:maxCount 1 ;
sh:datatype xsd:dateTime ;
] ;
sh:property [
sh:path cg:validUntil ;
sh:maxCount 1 ;
sh:datatype xsd:dateTime ;
] ;
sh:property [
sh:path cg:temporalResolution ;
sh:maxCount 1 ;
sh:datatype xsd:duration ;
] .
# ── Provenance Facet Shape ────────────────────────────────────
cg:ProvenanceFacetShape a sh:NodeShape ;
sh:targetClass cg:ProvenanceFacet ;
sh:property [
sh:path prov:wasGeneratedBy ;
sh:class prov:Activity ;
] ;
sh:property [
sh:path prov:generatedAtTime ;
sh:maxCount 1 ;
sh:datatype xsd:dateTime ;
] .
# ── Semiotic Facet Shape ──────────────────────────────────────
cg:SemioticFacetShape a sh:NodeShape ;
sh:targetClass cg:SemioticFacet ;
sh:property [
sh:path cg:modalStatus ;
sh:maxCount 1 ;
sh:in ( cg:Asserted cg:Hypothetical cg:Counterfactual cg:Quoted cg:Retracted ) ;
] ;
sh:property [
sh:path cg:epistemicConfidence ;
sh:maxCount 1 ;
sh:datatype xsd:double ;
sh:minInclusive 0.0 ;
sh:maxInclusive 1.0 ;
] .
# ── Trust Facet Shape ─────────────────────────────────────────
cg:TrustFacetShape a sh:NodeShape ;
sh:targetClass cg:TrustFacet ;
sh:property [
sh:path cg:trustLevel ;
sh:maxCount 1 ;
sh:in ( cg:SelfAsserted cg:ThirdPartyAttested cg:CryptographicallyVerified ) ;
] .
The following JSON-LD 1.1 [JSON-LD11] context document enables compact serialization of Context Graph data. Conformant producers SHOULD reference this context when serializing Context Graphs as JSON-LD.
{
"@context": {
"@version": 1.1,
"cg": "https://ns.foxximediums.com/context-graphs#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"prov": "http://www.w3.org/ns/prov#",
"time": "http://www.w3.org/2006/time#",
"dct": "http://purl.org/dc/terms/",
"as": "https://www.w3.org/ns/activitystreams#",
"acl": "http://www.w3.org/ns/auth/acl#",
"vc": "https://www.w3.org/2018/credentials#",
"dcat": "http://www.w3.org/ns/dcat#",
"oa": "http://www.w3.org/ns/oa#",
"ContextDescriptor": "cg:ContextDescriptor",
"ComposedDescriptor": "cg:ComposedDescriptor",
"ContextFacet": "cg:ContextFacet",
"TemporalFacet": "cg:TemporalFacet",
"ProvenanceFacet": "cg:ProvenanceFacet",
"AgentFacet": "cg:AgentFacet",
"AccessControlFacet": "cg:AccessControlFacet",
"SemioticFacet": "cg:SemioticFacet",
"TrustFacet": "cg:TrustFacet",
"FederationFacet": "cg:FederationFacet",
"describes": { "@id": "cg:describes", "@type": "@id" },
"hasFacet": { "@id": "cg:hasFacet" },
"facetType": { "@id": "cg:facetType", "@type": "@id" },
"compositionOp": { "@id": "cg:compositionOp", "@type": "@id" },
"operand": { "@id": "cg:operand", "@type": "@id", "@container": "@set" },
"restrictToType": { "@id": "cg:restrictToType", "@type": "@id", "@container": "@set" },
"supersedes": { "@id": "cg:supersedes", "@type": "@id" },
"version": { "@id": "cg:version", "@type": "xsd:nonNegativeInteger" },
"validFrom": { "@id": "cg:validFrom", "@type": "xsd:dateTime" },
"validUntil": { "@id": "cg:validUntil", "@type": "xsd:dateTime" },
"temporalResolution": { "@id": "cg:temporalResolution", "@type": "xsd:duration" },
"wasGeneratedBy": { "@id": "prov:wasGeneratedBy" },
"wasDerivedFrom": { "@id": "prov:wasDerivedFrom", "@type": "@id" },
"wasAttributedTo": { "@id": "prov:wasAttributedTo", "@type": "@id" },
"generatedAtTime": { "@id": "prov:generatedAtTime", "@type": "xsd:dateTime" },
"assertingAgent": { "@id": "cg:assertingAgent" },
"onBehalfOf": { "@id": "cg:onBehalfOf", "@type": "@id" },
"agentRole": { "@id": "cg:agentRole", "@type": "@id" },
"agentIdentity": { "@id": "cg:agentIdentity", "@type": "@id" },
"interpretationFrame": { "@id": "cg:interpretationFrame", "@type": "@id" },
"signSystem": { "@id": "cg:signSystem", "@type": "@id" },
"modalStatus": { "@id": "cg:modalStatus", "@type": "@id" },
"epistemicConfidence": { "@id": "cg:epistemicConfidence", "@type": "xsd:double" },
"groundTruth": { "@id": "cg:groundTruth", "@type": "xsd:boolean" },
"trustLevel": { "@id": "cg:trustLevel", "@type": "@id" },
"issuer": { "@id": "cg:issuer", "@type": "@id" },
"proofMechanism": { "@id": "cg:proofMechanism", "@type": "@id" },
"origin": { "@id": "cg:origin", "@type": "@id" },
"storageEndpoint": { "@id": "cg:storageEndpoint", "@type": "@id" },
"syncProtocol": { "@id": "cg:syncProtocol", "@type": "@id" },
"replicaOf": { "@id": "cg:replicaOf", "@type": "@id" },
"lastSynced": { "@id": "cg:lastSynced", "@type": "xsd:dateTime" }
}
}
Context Graphs data is queryable via standard SPARQL 1.2 [SPARQL12-QUERY]
using GRAPH patterns and property paths. This section defines recommended query
patterns and optional extension functions for context-aware querying.
PREFIX cg: <https://ns.foxximediums.com/context-graphs#>
PREFIX prov: <http://www.w3.org/ns/prov#>
SELECT ?descriptor ?facetType ?validFrom ?validUntil ?agent
WHERE {
?descriptor a cg:ContextDescriptor ;
cg:describes <urn:graph:target> ;
cg:hasFacet ?facet .
?facet a ?facetType .
OPTIONAL { ?facet cg:validFrom ?validFrom }
OPTIONAL { ?facet cg:validUntil ?validUntil }
OPTIONAL {
?facet cg:assertingAgent ?agentNode .
?agentNode cg:agentIdentity ?agent .
}
}
PREFIX cg: <https://ns.foxximediums.com/context-graphs#>
SELECT ?graph ?content
WHERE {
?desc a cg:ContextDescriptor ;
cg:describes ?graph ;
cg:hasFacet ?tf .
?tf a cg:TemporalFacet ;
cg:validFrom ?from ;
cg:validUntil ?until .
FILTER (?from <= "2026-03-01T00:00:00Z"^^xsd:dateTime
&& ?until >= "2026-03-01T00:00:00Z"^^xsd:dateTime)
GRAPH ?graph { ?s ?p ?content }
}
PREFIX cg: <https://ns.foxximediums.com/context-graphs#>
# Find all graphs whose content is asserted (not hypothetical or quoted)
SELECT ?graph
WHERE {
?desc a cg:ContextDescriptor ;
cg:describes ?graph ;
cg:hasFacet ?sf .
?sf a cg:SemioticFacet ;
cg:modalStatus cg:Asserted .
}
This section is non-normative. Implementations MAY provide the following SPARQL extension functions for convenience:
| Function | Signature | Description |
|---|---|---|
cg:effectiveContext |
(tripleOrGraph: IRI) → ContextDescriptor |
Returns the effective (composed) Context Descriptor for a triple term or Named Graph, applying the inheritance/override rules. |
cg:hasContextType |
(graph: IRI, type: IRI) → xsd:boolean |
Returns true if the graph's effective context includes a facet of the given type. |
cg:temporalOverlaps |
(graph: IRI, instant: xsd:dateTime) → xsd:boolean |
Returns true if the graph's temporal facet interval contains the given instant. |
This section is non-normative.
In a Solid [Solid Protocol] deployment, Context Graphs integrate as follows:
Storage. Context Descriptors SHOULD be stored as RDF resources within the same Solid Pod as the graphs they describe. The recommended container structure is:
/pod-root/
.well-known/
context-graphs ← Context manifest (index of all descriptors)
data/
observations/
2026-Q1.trig ← Named Graph data
2026-Q1.ctx.ttl ← Context Descriptor for this graph
context/
descriptors/ ← LDP Container for all descriptors
Discovery. A Solid server SHOULD serve the
context manifest at .well-known/context-graphs as a TriG or JSON-LD resource
containing all Context–Graph Bindings for the pod.
Notifications. When a Context Descriptor is created, updated, or invalidated,
the Solid server SHOULD emit a notification via the Solid
Notifications Protocol. The notification body SHOULD include the
IRI of the affected descriptor and the change type (as:Create, as:Update,
as:Delete).
Access Control alignment. When an Access Control Facet is present on a Context
Descriptor, its acl:Authorization resources SHOULD
be consistent with the WAC .acl resources governing the described graph's storage
container. Inconsistencies between the facet's access declarations and the server's enforced
ACLs MUST be resolved in favor of the server's ACLs.
Context Descriptors make claims about graphs (provenance, authorship, trust level) that consuming systems may rely upon for access control or policy decisions. Implementations SHOULD verify the integrity of Context Descriptors using the Trust Facet's proof mechanisms. Unsigned or self-asserted descriptors MUST NOT be treated as authoritative without additional verification.
Context Descriptors may reveal sensitive information even when the described graph's content is access-controlled. For example, a Temporal Facet reveals when data was generated; an Agent Facet reveals who generated it; a Federation Facet reveals where it is stored. Implementations SHOULD apply access controls to Context Descriptors with at least the same level of restriction as the graphs they describe.
In federated environments, a malicious participant may inject false Context Descriptors to
misrepresent the provenance, trust level, or temporal validity of graphs. Consumers
MUST verify that the cg:describes target graph
actually exists and is reachable, and SHOULD verify that the
descriptor's cg:origin (if present) is authoritative for the described graph.
The cg:epistemicConfidence property in the Semiotic Facet is self-reported and
MUST NOT be used as the sole basis for trust decisions. It is
intended for informational use within systems that aggregate and display confidence metadata,
not as a security mechanism.
The cg:consentBasis property on the Access Control Facet is provided for
documentation purposes. It does not constitute a legal compliance mechanism. Implementations
operating in regulated jurisdictions MUST ensure that their
data processing practices comply with applicable law independently of Context Graph metadata.
This section is non-normative.
@prefix cg: <https://ns.foxximediums.com/context-graphs#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix as: <https://www.w3.org/ns/activitystreams#> .
@prefix ex: <https://example.org/> .
# ── Context Descriptor ────────────────────────────────────────
ex:ctx-sensor-2026Q1 a cg:ContextDescriptor ;
cg:version 1 ;
cg:describes ex:graph-sensor-2026Q1 ;
cg:validFrom "2026-03-17T00:00:00Z"^^xsd:dateTime ;
# Temporal Facet
cg:hasFacet [
a cg:TemporalFacet ;
cg:validFrom "2026-01-01T00:00:00Z"^^xsd:dateTime ;
cg:validUntil "2026-03-31T23:59:59Z"^^xsd:dateTime ;
cg:temporalResolution "PT1H"^^xsd:duration ;
] ;
# Provenance Facet
cg:hasFacet [
a cg:ProvenanceFacet ;
prov:wasGeneratedBy [
a prov:Activity ;
prov:wasAssociatedWith ex:agent-etl-v3 ;
prov:startedAtTime "2026-03-17T06:00:00Z"^^xsd:dateTime ;
prov:endedAtTime "2026-03-17T06:45:00Z"^^xsd:dateTime ;
prov:used ex:raw-sensor-dump-20260317
] ;
prov:generatedAtTime "2026-03-17T06:45:00Z"^^xsd:dateTime ;
prov:wasDerivedFrom ex:raw-sensor-dump-20260317 ;
] ;
# Agent Facet
cg:hasFacet [
a cg:AgentFacet ;
cg:assertingAgent [
a prov:SoftwareAgent, as:Application ;
rdfs:label "Sensor ETL Pipeline v3.2" ;
cg:agentIdentity <did:web:example.org:agents:etl-v3>
] ;
cg:agentRole cg:Author ;
] ;
# Semiotic Facet
cg:hasFacet [
a cg:SemioticFacet ;
cg:modalStatus cg:Asserted ;
cg:epistemicConfidence "0.95"^^xsd:double ;
cg:interpretationFrame <https://schema.org/Observation> ;
cg:signSystem <http://qudt.org/2.1/vocab/unit> ;
] ;
# Federation Facet
cg:hasFacet [
a cg:FederationFacet ;
cg:origin <https://pod.example.org/sensors/2026Q1> ;
cg:storageEndpoint <https://pod.example.org/sensors/> ;
cg:syncProtocol cg:SolidNotifications ;
cg:lastSynced "2026-03-17T07:00:00Z"^^xsd:dateTime ;
] ;
# Trust Facet
cg:hasFacet [
a cg:TrustFacet ;
cg:trustLevel cg:SelfAsserted ;
cg:issuer <did:web:example.org> ;
] .
# ── The Described Named Graph ─────────────────────────────────
GRAPH ex:graph-sensor-2026Q1 {
ex:sensor-7 ex:temperature "22.4"^^xsd:double .
ex:sensor-7 ex:humidity "0.65"^^xsd:double .
ex:sensor-12 ex:temperature "19.1"^^xsd:double .
}
@prefix cg: <https://ns.foxximediums.com/context-graphs#> .
@prefix ex: <https://example.org/> .
# Alice's context descriptor (from her Solid Pod)
ex:ctx-alice a cg:ContextDescriptor ;
cg:describes ex:graph-shared-research ;
cg:hasFacet [
a cg:TemporalFacet ;
cg:validFrom "2026-01-01T00:00:00Z"^^xsd:dateTime ;
cg:validUntil "2026-06-30T23:59:59Z"^^xsd:dateTime ;
] ;
cg:hasFacet [
a cg:TrustFacet ;
cg:trustLevel cg:CryptographicallyVerified ;
cg:issuer <did:web:alice.example.org> ;
] .
# Bob's context descriptor (from his Solid Pod)
ex:ctx-bob a cg:ContextDescriptor ;
cg:describes ex:graph-shared-research ;
cg:hasFacet [
a cg:TemporalFacet ;
cg:validFrom "2026-03-01T00:00:00Z"^^xsd:dateTime ;
cg:validUntil "2026-12-31T23:59:59Z"^^xsd:dateTime ;
] ;
cg:hasFacet [
a cg:TrustFacet ;
cg:trustLevel cg:ThirdPartyAttested ;
cg:issuer <did:web:bob.example.org> ;
] .
# Composed: intersection reveals shared temporal window and common trust
ex:ctx-composed a cg:ComposedDescriptor ;
cg:compositionOp cg:intersection ;
cg:operand ex:ctx-alice, ex:ctx-bob ;
cg:describes ex:graph-shared-research ;
# Effective temporal: 2026-03-01 to 2026-06-30 (overlap)
# Effective trust: both trust facets preserved (no common issuer)
cg:hasFacet [
a cg:TemporalFacet ;
cg:validFrom "2026-03-01T00:00:00Z"^^xsd:dateTime ;
cg:validUntil "2026-06-30T23:59:59Z"^^xsd:dateTime ;
] .
{
"@context": "https://ns.foxximediums.com/context-graphs/v1",
"@id": "urn:cg:desc:quickstart-1",
"@type": "ContextDescriptor",
"version": 0,
"describes": "urn:graph:my-observations",
"validFrom": "2026-03-17T00:00:00Z",
"hasFacet": [
{
"@type": "TemporalFacet",
"validFrom": "2026-01-01T00:00:00Z",
"validUntil": "2026-03-31T23:59:59Z"
},
{
"@type": "ProvenanceFacet",
"wasGeneratedBy": {
"@type": "prov:Activity",
"generatedAtTime": "2026-03-17T08:00:00Z"
},
"wasDerivedFrom": "https://data.example.org/raw/input.csv"
},
{
"@type": "SemioticFacet",
"modalStatus": "cg:Asserted",
"epistemicConfidence": 0.88
}
]
}