sophia_api/term/
_graph_name.rs

1use super::*;
2
3/// A [`GraphName`] is an optional [`Term`](super::Term),
4/// used to name a graph in an [RDF dataset](https://www.w3.org/TR/rdf11-concepts/#section-dataset).
5///
6/// By convention, `None` is the "name" of the default graph.
7pub type GraphName<T> = Option<T>;
8
9/// Determines if two [`GraphName`]s represent the same RDF term.
10pub fn graph_name_eq<T1: Term, T2: Term>(gn1: GraphName<T1>, gn2: GraphName<T2>) -> bool {
11    match (gn1, gn2) {
12        (Some(t1), Some(t2)) => t1.eq(t2),
13        (None, None) => true,
14        _ => false,
15    }
16}