pub struct ExpandedDocument<T = IriBuf, B = BlankIdBuf>(/* private fields */);
Expand description

Result of the document expansion algorithm.

It is just an alias for a set of (indexed) objects.

Implementations§

source§

impl<T, B> ExpandedDocument<T, B>

source

pub fn new() -> ExpandedDocument<T, B>

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn objects(&self) -> &IndexSet<Indexed<Object<T, B>>>

source

pub fn into_objects(self) -> IndexSet<Indexed<Object<T, B>>>

source

pub fn iter(&self) -> Iter<'_, Indexed<Object<T, B>>>

source

pub fn traverse(&self) -> Traverse<'_, T, B>

source

pub fn count(&self, f: impl FnMut(&FragmentRef<'_, T, B>) -> bool) -> usize

source

pub fn identify_all_with<V, G>(&mut self, vocabulary: &mut V, generator: &mut G)
where V: Vocabulary<Iri = T, BlankId = B>, G: Generator<V>, T: Eq + Hash, B: Eq + Hash,

Give an identifier (@id) to every nodes using the given generator to generate fresh identifiers for anonymous nodes.

source

pub fn identify_all<G>(&mut self, generator: &mut G)
where G: Generator, T: Eq + Hash, B: Eq + Hash, (): Vocabulary<Iri = T, BlankId = B>,

Give an identifier (@id) to every nodes using the given generator to generate fresh identifiers for anonymous nodes.

source

pub fn relabel_and_canonicalize_with<V, G>( &mut self, vocabulary: &mut V, generator: &mut G )
where V: Vocabulary<Iri = T, BlankId = B>, G: Generator<V>, T: Clone + Eq + Hash, B: Clone + Eq + Hash,

Give an identifier (@id) to every nodes and canonicalize every literals using the given generator to generate fresh identifiers for anonymous nodes.

source

pub fn relabel_and_canonicalize<G>(&mut self, generator: &mut G)
where G: Generator, T: Clone + Eq + Hash, B: Clone + Eq + Hash, (): Vocabulary<Iri = T, BlankId = B>,

Give an identifier (@id) to every nodes and canonicalize every literals using the given generator to generate fresh identifiers for anonymous nodes.

source

pub fn relabel_with<V, G>(&mut self, vocabulary: &mut V, generator: &mut G)
where V: Vocabulary<Iri = T, BlankId = B>, G: Generator<V>, T: Clone + Eq + Hash, B: Clone + Eq + Hash,

Relabels nodes.

source

pub fn relabel<G>(&mut self, generator: &mut G)
where G: Generator, T: Clone + Eq + Hash, B: Clone + Eq + Hash, (): Vocabulary<Iri = T, BlankId = B>,

Relabels nodes.

source

pub fn canonicalize_with(&mut self, buffer: &mut Buffer)
where T: Eq + Hash, B: Eq + Hash,

Puts this document literals into canonical form using the given buffer.

The buffer is used to compute the canonical form of numbers.

source

pub fn canonicalize(&mut self)
where T: Eq + Hash, B: Eq + Hash,

Puts this document literals into canonical form.

source

pub fn blank_ids(&self) -> HashSet<&B>
where B: Eq + Hash,

Returns the set of all blank identifiers in the given document.

source

pub fn main_node(&self) -> Option<&Node<T, B>>

Returns the main node object of the document, if any.

The main node is the unique top level (root) node object. If multiple node objects are on the root, None is returned.

source

pub fn into_main_node(self) -> Option<Node<T, B>>

Consumes the document and returns its main node object, if any.

The main node is the unique top level (root) node object. If multiple node objects are on the root, None is returned.

source§

impl<T, B> ExpandedDocument<T, B>
where T: Hash + Eq, B: Hash + Eq,

source

pub fn insert(&mut self, object: Indexed<Object<T, B>>) -> bool

source§

impl<T, B> ExpandedDocument<T, B>
where T: Clone + Eq + Hash, B: Clone + Eq + Hash,

source

pub fn generate_node_map_with<V, G>( &self, vocabulary: &mut V, generator: G ) -> Result<NodeMap<T, B>, ConflictingIndexes<T, B>>
where V: Vocabulary<Iri = T, BlankId = B>, G: Generator<V>,

source§

impl<I, B> ExpandedDocument<I, B>

source

pub fn from_interpreted_quads_in<'a, V, T>( vocabulary: &V, interpretation: &T, quads: impl IntoIterator<Item = Quad<&'a <T as Interpretation>::Resource>>, context: Context<'_, T> ) -> Result<ExpandedDocument<I, B>, SerializationError>
where V: Vocabulary<Iri = I, BlankId = B>, T: ReverseTermInterpretation<Iri = I, BlankId = B, Literal = <V as LiteralVocabulary>::Literal>, <T as Interpretation>::Resource: 'a + Ord + Hash, I: Clone + Eq + Hash, B: Clone + Eq + Hash,

source

pub fn from_interpreted_quads<'a, V, T>( vocabulary: &V, interpretation: &T, quads: impl IntoIterator<Item = Quad<&'a <T as Interpretation>::Resource>> ) -> Result<ExpandedDocument<I, B>, SerializationError>
where V: Vocabulary<Iri = I, BlankId = B>, T: ReverseTermInterpretation<Iri = I, BlankId = B, Literal = <V as LiteralVocabulary>::Literal>, <T as Interpretation>::Resource: 'a + Ord + Hash, I: Clone + Eq + Hash, B: Clone + Eq + Hash,

Trait Implementations§

source§

impl<I, B> Borrow<ExpandedDocument<I, B>> for Document<I, B>

source§

fn borrow(&self) -> &ExpandedDocument<I, B>

Immutably borrows from an owned value. Read more
source§

impl<T, B> Clone for ExpandedDocument<T, B>
where T: Clone, B: Clone,

source§

fn clone(&self) -> ExpandedDocument<T, B>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<I, B> Compact<I, B> for ExpandedDocument<I, B>

source§

async fn compact_full<'a, N, L>( &'a self, vocabulary: &'a mut N, context: ProcessedRef<'a, 'a, I, B>, loader: &'a mut L, options: Options ) -> Result<Value, Error<<L as Loader<I>>::Error>>
where N: VocabularyMut<Iri = I, BlankId = B>, I: Clone + Hash + Eq, B: Clone + Hash + Eq, L: Loader<I>,

Compacts the input document with full options.
source§

impl<T, B> Debug for ExpandedDocument<T, B>
where T: Debug, B: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T, B> Default for ExpandedDocument<T, B>

source§

fn default() -> ExpandedDocument<T, B>

Returns the “default value” for a type. Read more
source§

impl<T, B> Extend<Indexed<Object<T, B>>> for ExpandedDocument<T, B>
where T: Hash + Eq, B: Hash + Eq,

source§

fn extend<I>(&mut self, iter: I)
where I: IntoIterator<Item = Indexed<Object<T, B>>>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<I, B> Flatten<I, B> for ExpandedDocument<I, B>
where I: Clone + Eq + Hash, B: Clone + Eq + Hash,

source§

fn flatten_with<V, G>( self, vocabulary: &mut V, generator: G, ordered: bool ) -> Result<Vec<Indexed<Node<I, B>>>, ConflictingIndexes<I, B>>
where G: Generator<V>, V: Vocabulary<Iri = I, BlankId = B>,

source§

fn flatten_unordered_with<V, G>( self, vocabulary: &mut V, generator: G ) -> Result<HashSet<Indexed<Node<I, B>>>, ConflictingIndexes<I, B>>
where G: Generator<V>, V: Vocabulary<Iri = I, BlankId = B>,

source§

impl<T, B> From<IndexSet<Indexed<Object<T, B>>>> for ExpandedDocument<T, B>

source§

fn from(set: IndexSet<Indexed<Object<T, B>>>) -> ExpandedDocument<T, B>

Converts to this type from the input type.
source§

impl<T, B> From<Indexed<Node<T, B>>> for ExpandedDocument<T, B>
where T: Eq + Hash, B: Eq + Hash,

source§

fn from(value: Indexed<Node<T, B>>) -> ExpandedDocument<T, B>

Converts to this type from the input type.
source§

impl<T, B> FromIterator<Indexed<Object<T, B>>> for ExpandedDocument<T, B>
where T: Hash + Eq, B: Hash + Eq,

source§

fn from_iter<I>(iter: I) -> ExpandedDocument<T, B>
where I: IntoIterator<Item = Indexed<Object<T, B>>>,

Creates a value from an iterator. Read more
source§

impl<'a, T, B> IntoIterator for &'a ExpandedDocument<T, B>

§

type IntoIter = Iter<'a, Indexed<Object<T, B>>>

Which kind of iterator are we turning this into?
§

type Item = &'a Indexed<Object<T, B>>

The type of the elements being iterated over.
source§

fn into_iter(self) -> <&'a ExpandedDocument<T, B> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, B> IntoIterator for ExpandedDocument<T, B>

§

type IntoIter = IntoIter<T, B>

Which kind of iterator are we turning this into?
§

type Item = Indexed<Object<T, B>>

The type of the elements being iterated over.
source§

fn into_iter(self) -> <ExpandedDocument<T, B> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, B> LdQuads<T, B> for ExpandedDocument<T, B>

source§

fn quads(&self) -> Quads<'_, T, B>

source§

impl<T, B, V, I> LinkedData<I, V> for ExpandedDocument<T, B>

source§

fn visit<S>( &self, visitor: S ) -> Result<<S as Visitor<I, V>>::Ok, <S as Visitor<I, V>>::Error>
where S: Visitor<I, V>,

Visit the RDF dataset represented by this type.
source§

impl<V, I> LinkedDataDeserialize<V, I> for ExpandedDocument<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>
where I: ReverseTermInterpretation<Iri = <V as IriVocabulary>::Iri, BlankId = <V as BlankIdVocabulary>::BlankId, Literal = <V as LiteralVocabulary>::Literal>, V: Vocabulary, <I as Interpretation>::Resource: Ord + Hash, <V as IriVocabulary>::Iri: Clone + Eq + Hash, <V as BlankIdVocabulary>::BlankId: Clone + Eq + Hash,

source§

fn deserialize_dataset_in( vocabulary: &V, interpretation: &I, dataset: &(impl TraversableDataset<Resource = <I as Interpretation>::Resource> + PatternMatchingDataset), context: Context<'_, I> ) -> Result<ExpandedDocument<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>, FromLinkedDataError>

source§

fn deserialize_dataset( vocabulary: &V, interpretation: &I, dataset: &(impl TraversableDataset<Resource = <I as Interpretation>::Resource> + PatternMatchingDataset) ) -> Result<Self, FromLinkedDataError>

source§

impl<T, B, V, I> LinkedDataGraph<I, V> for ExpandedDocument<T, B>

source§

fn visit_graph<S>( &self, visitor: S ) -> Result<<S as GraphVisitor<I, V>>::Ok, <S as GraphVisitor<I, V>>::Error>
where S: GraphVisitor<I, V>,

source§

impl<T, B> PartialEq for ExpandedDocument<T, B>
where T: Eq + Hash, B: Eq + Hash,

source§

fn eq(&self, other: &ExpandedDocument<T, B>) -> bool

Comparison between two expanded documents.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, B, N> PrecomputeSizeWithContext<N> for ExpandedDocument<T, B>
where N: Vocabulary<Iri = T, BlankId = B>,

source§

fn contextual_pre_compute_size( &self, vocabulary: &N, options: &Options, sizes: &mut Vec<Size> ) -> Size

source§

impl<T, B, N> PrintWithContext<N> for ExpandedDocument<T, B>
where N: Vocabulary<Iri = T, BlankId = B>,

source§

fn contextual_fmt_with( &self, vocabulary: &N, f: &mut Formatter<'_>, options: &Options, indent: usize ) -> Result<(), Error>

source§

impl<T, B, N> PrintWithSizeAndContext<N> for ExpandedDocument<T, B>
where N: Vocabulary<Iri = T, BlankId = B>,

source§

fn contextual_fmt_with_size( &self, vocabulary: &N, f: &mut Formatter<'_>, options: &Options, indent: usize, sizes: &[Size], index: &mut usize ) -> Result<(), Error>

source§

impl<T, B> RdfQuads<T, B> for ExpandedDocument<T, B>

source§

fn rdf_quads_full<'n, 'g, V, G>( &self, vocabulary: &'n mut V, generator: &'g mut G, rdf_direction: Option<RdfDirection>, produce_generalized_rdf: bool ) -> Quads<'_, 'n, 'g, V, G>
where V: Vocabulary<Iri = T, BlankId = B>, G: Generator<V>,

source§

fn rdf_quads_with<'n, 'g, V, G>( &self, vocabulary: &'n mut V, generator: &'g mut G, rdf_direction: Option<RdfDirection> ) -> Quads<'_, 'n, 'g, V, G>
where V: Vocabulary<Iri = T, BlankId = B>, G: Generator<V>,

source§

impl<T, B> TryFromJson<T, B> for ExpandedDocument<T, B>
where T: Eq + Hash, B: Eq + Hash,

source§

fn try_from_json_in( vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>, value: Value ) -> Result<ExpandedDocument<T, B>, InvalidExpandedJson>

source§

impl<T, B> Eq for ExpandedDocument<T, B>
where T: Eq + Hash, B: Eq + Hash,

Auto Trait Implementations§

§

impl<T, B> Freeze for ExpandedDocument<T, B>

§

impl<T, B> RefUnwindSafe for ExpandedDocument<T, B>

§

impl<T, B> Send for ExpandedDocument<T, B>
where T: Send, B: Send,

§

impl<T, B> Sync for ExpandedDocument<T, B>
where T: Sync, B: Sync,

§

impl<T, B> Unpin for ExpandedDocument<T, B>
where T: Unpin,

§

impl<T, B> UnwindSafe for ExpandedDocument<T, B>
where T: UnwindSafe, B: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> At for T

source§

fn at<M>(self, metadata: M) -> Meta<T, M>

Wraps self inside a Meta<Self, M> using the given metadata. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowStripped for T

source§

fn stripped(&self) -> &Stripped<T>

source§

impl<T> BorrowUnordered for T

source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, C> FromWithContext<T, C> for T

source§

fn from_with(value: T, _context: &C) -> T

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U, C> IntoWithContext<U, C> for T
where U: FromWithContext<T, C>,

source§

fn into_with(self, context: &C) -> U

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToOwned for T

§

type Owned = T

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U, C> TryFromWithContext<U, C> for T
where U: IntoWithContext<T, C>,

§

type Error = Infallible

source§

fn try_from_with( value: U, context: &C ) -> Result<T, <T as TryFromWithContext<U, C>>::Error>

source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, U, C> TryIntoWithContext<U, C> for T
where U: TryFromWithContext<T, C>,

§

type Error = <U as TryFromWithContext<T, C>>::Error

source§

fn try_into_with( self, context: &C ) -> Result<U, <T as TryIntoWithContext<U, C>>::Error>

source§

impl<T> WithContext for T
where T: ?Sized,

source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

source§

fn into_with<C>(self, context: C) -> Contextual<T, C>

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more