@prefix : <https://ontology.inferal.com/modules/graphs/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix hg: <https://ontology.inferal.com/modules/hypergraphs/> .
@prefix mod: <https://w3id.org/mod#> .
@prefix ord: <https://ontology.inferal.com/modules/ordering/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pubacc: <https://ontology.inferal.com/modules/publication-access/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix vann: <http://purl.org/vocab/vann/> .

:
    a owl:Ontology, pubacc:PublicationManagedOntology ;
    dcterms:accessRights pubacc:PublicAccess ;
    owl:imports hg: ;
    owl:imports ord: ;
    dcterms:title "Graphs Ontology" ;
    dcterms:description "Terms for graphs as binary specializations of hypergraphs, including ordered endpoint structure for directed edges." ;
    dcterms:license <https://creativecommons.org/licenses/by/4.0/> ;
    dcterms:source hg:, ord: ;
    vann:preferredNamespacePrefix "graph" ;
    vann:preferredNamespaceUri "https://ontology.inferal.com/modules/graphs/" ;
    mod:status "draft" ;
    rdfs:comment "This module models graph edges as constrained hyperedges with exactly two endpoint incidences. Directed edges are represented by ordering the endpoint resources in a local ordering context rather than by ordering the vertices globally." ;
    owl:versionInfo "0.1.0" .

:Graph
    a rdfs:Class ;
    rdfs:subClassOf hg:Hypergraph ;
    rdfs:label "graph" ;
    rdfs:comment "A hypergraph specialization whose edges are binary graph edges." .

:DirectedGraph
    a rdfs:Class ;
    rdfs:subClassOf :Graph ;
    rdfs:label "directed graph" ;
    rdfs:comment "A graph whose edges are directed edges with locally ordered endpoints." .

:UndirectedGraph
    a rdfs:Class ;
    rdfs:subClassOf :Graph ;
    rdfs:label "undirected graph" ;
    rdfs:comment "A graph whose edges are undirected binary edges without endpoint ordering." .

:Vertex
    a rdfs:Class ;
    rdfs:subClassOf hg:Vertex ;
    rdfs:label "graph vertex" ;
    rdfs:comment "A vertex in a graph." .

:Edge
    a rdfs:Class ;
    rdfs:subClassOf hg:Hyperedge ;
    rdfs:label "edge" ;
    rdfs:comment "A binary hyperedge with exactly two endpoint occurrences whose endpoint vertices are distinct in this base graph model." .

:DirectedEdge
    a rdfs:Class ;
    rdfs:subClassOf :Edge ;
    rdfs:label "directed edge" ;
    rdfs:comment "An edge whose two endpoint occurrences are ordered in a local endpoint ordering. Rank 1 is the source side and rank 2 is the target side." .

:UndirectedEdge
    a rdfs:Class ;
    rdfs:subClassOf :Edge ;
    rdfs:label "undirected edge" ;
    rdfs:comment "An edge whose endpoint occurrences are not ordered by this graph module." .

:Endpoint
    a rdfs:Class ;
    rdfs:subClassOf hg:Incidence ;
    rdfs:label "endpoint" ;
    rdfs:comment "A graph-specific incidence occurrence connecting exactly one graph edge to exactly one graph vertex." .

:EdgeMembership
    a rdfs:Class ;
    rdfs:subClassOf hg:HyperedgeMembership ;
    rdfs:label "edge membership" ;
    rdfs:comment "A graph-specific membership occurrence connecting exactly one graph to exactly one edge contained in that graph." .

:hasVertex
    a rdf:Property ;
    rdfs:subPropertyOf hg:hasVertex ;
    rdfs:label "has graph vertex" ;
    rdfs:comment "Connects a graph to a vertex in its vertex set." ;
    rdfs:domain :Graph ;
    rdfs:range :Vertex .

:hasEdge
    a rdf:Property ;
    rdfs:subPropertyOf hg:hasHyperedge ;
    rdfs:label "has edge" ;
    rdfs:comment "Connects a graph to one of its binary edges." ;
    rdfs:domain :Graph ;
    rdfs:range :Edge .

:edgeInGraph
    a rdf:Property ;
    rdfs:subPropertyOf hg:edgeInHypergraph ;
    rdfs:label "edge in graph" ;
    rdfs:comment "Connects an edge to a graph that contains it." ;
    rdfs:domain :Edge ;
    rdfs:range :Graph .

:hasEdgeMembership
    a rdf:Property ;
    rdfs:subPropertyOf hg:hasHyperedgeMembership ;
    rdfs:label "has edge membership" ;
    rdfs:comment "Connects a graph to a membership occurrence for one of its contained edges." ;
    rdfs:domain :Graph ;
    rdfs:range :EdgeMembership .

:membershipGraph
    a rdf:Property ;
    rdfs:subPropertyOf hg:membershipHypergraph ;
    rdfs:label "membership graph" ;
    rdfs:comment "Connects an edge membership occurrence to the graph in which it occurs." ;
    rdfs:domain :EdgeMembership ;
    rdfs:range :Graph .

:membershipEdge
    a rdf:Property ;
    rdfs:subPropertyOf hg:membershipHyperedge ;
    rdfs:label "membership edge" ;
    rdfs:comment "Connects an edge membership occurrence to the edge that is a member of the graph." ;
    rdfs:domain :EdgeMembership ;
    rdfs:range :Edge .

:hasEndpoint
    a rdf:Property ;
    rdfs:subPropertyOf hg:hasIncidence ;
    rdfs:label "has endpoint" ;
    rdfs:comment "Connects an edge to one of its endpoint occurrences." ;
    rdfs:domain :Edge ;
    rdfs:range :Endpoint .

:endpointOf
    a rdf:Property ;
    rdfs:subPropertyOf hg:incidentEdge ;
    rdfs:label "endpoint of" ;
    rdfs:comment "Connects an endpoint occurrence to the edge in which it occurs." ;
    rdfs:domain :Endpoint ;
    rdfs:range :Edge .

:endpointVertex
    a rdf:Property ;
    rdfs:subPropertyOf hg:incidentVertex ;
    rdfs:label "endpoint vertex" ;
    rdfs:comment "Connects an endpoint occurrence to the graph vertex at that endpoint." ;
    rdfs:domain :Endpoint ;
    rdfs:range :Vertex .

:connects
    a rdf:Property ;
    rdfs:label "connects" ;
    rdfs:comment "Direct convenience relation from an edge to a vertex reached by one of its endpoints." ;
    rdfs:domain :Edge ;
    rdfs:range :Vertex .

:endpointOrder
    a rdf:Property ;
    rdfs:label "endpoint order" ;
    rdfs:comment "Connects a directed edge to the local total ordering used to order its endpoint occurrences." ;
    rdfs:domain :DirectedEdge ;
    rdfs:range ord:TotalOrdering .

:source
    a rdf:Property ;
    rdfs:subPropertyOf :connects ;
    rdfs:label "source" ;
    rdfs:comment "Convenience relation from a directed edge to the vertex of its rank-1 endpoint." ;
    rdfs:domain :DirectedEdge ;
    rdfs:range :Vertex .

:target
    a rdf:Property ;
    rdfs:subPropertyOf :connects ;
    rdfs:label "target" ;
    rdfs:comment "Convenience relation from a directed edge to the vertex of its rank-2 endpoint." ;
    rdfs:domain :DirectedEdge ;
    rdfs:range :Vertex .
