The Inferal Graphs Ontology defines RDF terms for graphs as binary specializations of hypergraphs. Edge containment is represented by graph-specific edge membership occurrences. An edge is modeled as a constrained hyperedge with two endpoint occurrences. Directedness is represented by ordering those endpoint resources in a local endpoint ordering. This enables RDF publishers to describe classical directed and undirected graphs while retaining first-class membership and endpoint occurrences for validation and domain annotations.

This is an unofficial 0.1 Editor's Draft maintained in the Inferal ontology repository.

Feedback should be sent to contact@inferal.com.

This specification defines three conformance classes: graphs data graph, graphs producer, and graphs validator.

A graphs data graph is an RDF graph that uses terms from this specification consistently with the term definitions and validation expectations below.

A graphs producer is software or an authoring process that emits graphs, vertices, edges, endpoints, and optional source/target shortcuts.

A graphs validator is software that checks binary edge constraints, directed endpoint ordering, source/target agreement, and graph vertex containment.

Scope and Boundaries

This module is limited to classical binary edges with two distinct endpoint vertices. It does not model self-loops, parallel-edge identity policies, weighted paths, graph algorithms, or mutable graph storage. Extensions MAY specialize the occurrence model for those purposes, but MUST NOT treat the convenience relations alone as proof that the required membership and endpoint occurrences exist.

Competency Questions

Namespaces

Prefix IRI
graph https://ontology.inferal.com/modules/graphs/
hg https://ontology.inferal.com/modules/hypergraphs/
ord https://ontology.inferal.com/modules/ordering/

The graph namespace imports the Inferal Hypergraphs Ontology [[!INFERAL-HYPERGRAPHS]] and the Inferal Ordering Ontology [[!INFERAL-ORDERING]].

Term Index

Term Kind Normative role
graph:Graph Class A binary-edge specialization of a hypergraph.
graph:DirectedGraph Class A graph whose contained edges are directed edges.
graph:UndirectedGraph Class A graph whose contained edges are undirected edges.
graph:Vertex Class A graph-specific vertex.
graph:Edge Class A binary edge with exactly two endpoint occurrences.
graph:Endpoint Class A graph-specific incidence occurrence connecting one edge to one vertex.
graph:EdgeMembership Class A graph-specific membership occurrence connecting one graph to one contained edge.
graph:DirectedEdge Class An edge whose endpoints are ordered in a local ordering context.
graph:UndirectedEdge Class An edge with no endpoint ordering in this module.
graph:hasVertex Object property Connects a graph to a vertex in its vertex set.
graph:hasEdge Object property Connects a graph to one of its contained binary edges.
graph:edgeInGraph Object property Connects an edge to a graph that contains it.
graph:hasEndpoint Object property Connects an edge to one endpoint occurrence.
graph:hasEdgeMembership Object property Connects a graph to an edge membership occurrence.
graph:membershipGraph Object property Connects an edge membership occurrence to its graph.
graph:membershipEdge Object property Connects an edge membership occurrence to its edge.
graph:endpointOf Object property Connects an endpoint occurrence to the edge in which it occurs.
graph:endpointVertex Object property Connects an endpoint occurrence to its vertex.
graph:connects Object property Connects an edge directly to a vertex reached by one of its endpoints.
graph:endpointOrder Object property Connects a directed edge to its local endpoint ordering.
graph:source Object property Convenience relation to the rank-1 endpoint vertex.
graph:target Object property Convenience relation to the rank-2 endpoint vertex.

Graph Model

The model distinguishes graph-native terms from their reusable hypergraph foundations. A graph:Graph is a subclass of hg:Hypergraph. A graph:Edge is a subclass of hg:Hyperedge. A graph:Endpoint is a subclass of hg:Incidence. A graph:EdgeMembership is a subclass of hg:HyperedgeMembership. This preserves the hypergraph view while providing graph-native terms.

A conforming producer MUST state graph:hasEdge and graph:hasEdgeMembership for graph edge containment. The membership occurrence MUST identify exactly one graph:membershipGraph and exactly one graph:membershipEdge. When cross-module validation uses imported hypergraph and set shapes, processors SHOULD run RDFS entailment or an equivalent materialization step so graph-specific subproperties are visible at the hypergraph and set layers.

Under OWL property-chain reasoning inherited from the Sets Ontology, graph:EdgeMembership occurrences entail direct set:hasMember triples from a graph to its edges, and graph:Endpoint occurrences entail direct set:hasMember triples from an edge to its endpoint vertices. SPARQL materialization queries are provided for consumers that do not run OWL property-chain reasoning.

This ontology also declares graph-level property chains: inverse(graph:membershipGraph) o graph:membershipEdge -> graph:hasEdge and graph:hasEndpoint o graph:endpointVertex -> graph:connects. graph:EdgeMembership declares an OWL key over graph:membershipGraph and graph:membershipEdge. graph:Endpoint is not keyed in OWL, so later loop, pseudograph, or tuple extensions can distinguish repeated edge/vertex occurrences. SHACL validation remains responsible for reporting duplicate classical endpoints in this source profile.

Each graph:Edge MUST have exactly two graph:Endpoint occurrences. Each endpoint MUST identify exactly one graph:endpointOf edge and one graph:endpointVertex vertex. The two endpoint vertices MUST be distinct in this base module.

The distinct-endpoint rule keeps the base graph module aligned with classical hypergraphs, where an edge is a two-element set of vertices. Self-loops, pseudographs, and endpoint tuples require repeated vertex occurrences and should be defined by a later extension.

Directedness

Directedness is modeled as local ordering over endpoint occurrences. A graph:DirectedEdge MUST have exactly one graph:endpointOrder value, and that value MUST be an ord:TotalOrdering. Both endpoint occurrences MUST be ord:Comparable resources in that same ordering.

The endpoint with ord:rank 1 is the source-side endpoint. The endpoint with ord:rank 2 is the target-side endpoint. The rank-2 endpoint MUST sort after the rank-1 endpoint using ord:greaterThan.

The graph:source and graph:target properties are direct convenience relations. A producer MAY omit them when the ordered endpoint structure is present. If they are stated, they MUST agree with the endpoint vertices selected by rank 1 and rank 2.

Vertices themselves are not ordered by this module. The ordered resources are endpoints, because the same vertex can be source-side in one edge, target-side in another edge, and unordered in an undirected edge.

Validation Expectations

A conforming graphs data graph MUST satisfy the following constraints:

These constraints define a source-authoring validation profile. Producers SHOULD validate source graphs before applying OWL inverse-property materialization, or with an entailment regime that does not add derived forward containment links. Conforming source data states graph:hasEdge, graph:hasEdgeMembership, and graph:hasEndpoint explicitly; OWL or SPARQL materialization can run afterward for consumer convenience.

Examples