oxigraph::io

Enum GraphFormat

Source
#[non_exhaustive]
pub enum GraphFormat { NTriples, Turtle, RdfXml, }
๐Ÿ‘ŽDeprecated since 0.4.0: use RdfFormat instead
Expand description

RDF graph serialization formats.

This enumeration is non exhaustive. New formats like JSON-LD will be added in the future.

Variants (Non-exhaustive)ยง

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ยง

NTriples

๐Ÿ‘ŽDeprecated since 0.4.0: use RdfFormat instead
ยง

Turtle

๐Ÿ‘ŽDeprecated since 0.4.0: use RdfFormat instead
ยง

RdfXml

๐Ÿ‘ŽDeprecated since 0.4.0: use RdfFormat instead

Implementationsยง

Sourceยง

impl GraphFormat

Source

pub fn iri(self) -> &'static str

The format canonical IRI according to the Unique URIs for file formats registry.

use oxigraph::io::GraphFormat;

assert_eq!(
    GraphFormat::NTriples.iri(),
    "http://www.w3.org/ns/formats/N-Triples"
)
Source

pub fn media_type(self) -> &'static str

The format IANA media type.

use oxigraph::io::GraphFormat;

assert_eq!(GraphFormat::NTriples.media_type(), "application/n-triples")
Source

pub fn file_extension(self) -> &'static str

The format IANA-registered file extension.

use oxigraph::io::GraphFormat;

assert_eq!(GraphFormat::NTriples.file_extension(), "nt")
Source

pub fn from_media_type(media_type: &str) -> Option<Self>

Looks for a known format from a media type.

It supports some media type aliases. For example, โ€œapplication/xmlโ€ is going to return GraphFormat::RdfXml even if it is not its canonical media type.

Example:

use oxigraph::io::GraphFormat;

assert_eq!(
    GraphFormat::from_media_type("text/turtle; charset=utf-8"),
    Some(GraphFormat::Turtle)
)
Source

pub fn from_extension(extension: &str) -> Option<Self>

Looks for a known format from an extension.

It supports some aliases.

Example:

use oxigraph::io::GraphFormat;

assert_eq!(
    GraphFormat::from_extension("nt"),
    Some(GraphFormat::NTriples)
)

Trait Implementationsยง

Sourceยง

impl Clone for GraphFormat

Sourceยง

fn clone(&self) -> GraphFormat

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 Debug for GraphFormat

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl From<GraphFormat> for RdfFormat

Sourceยง

fn from(format: GraphFormat) -> Self

Converts to this type from the input type.
Sourceยง

impl From<GraphFormat> for RdfParser

Sourceยง

fn from(format: GraphFormat) -> Self

Converts to this type from the input type.
Sourceยง

impl From<GraphFormat> for RdfSerializer

Sourceยง

fn from(format: GraphFormat) -> Self

Converts to this type from the input type.
Sourceยง

impl Hash for GraphFormat

Sourceยง

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 ยท Sourceยง

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Sourceยง

impl PartialEq for GraphFormat

Sourceยง

fn eq(&self, other: &GraphFormat) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 ยท Sourceยง

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Sourceยง

impl TryFrom<DatasetFormat> for GraphFormat

Sourceยง

fn try_from(value: DatasetFormat) -> Result<Self, Self::Error>

Attempts to find a graph format that is a subset of this DatasetFormat.

Sourceยง

type Error = ()

The type returned in the event of a conversion error.
Sourceยง

impl TryFrom<GraphFormat> for DatasetFormat

Sourceยง

fn try_from(value: GraphFormat) -> Result<Self, Self::Error>

Attempts to find a dataset format that is a superset of this GraphFormat.

Sourceยง

type Error = ()

The type returned in the event of a conversion error.
Sourceยง

impl Copy for GraphFormat

Sourceยง

impl Eq for GraphFormat

Sourceยง

impl StructuralPartialEq for GraphFormat

Auto Trait Implementationsยง

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> 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> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dst: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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

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, 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> Same for T

Sourceยง

type Output = T

Should always be Self
Sourceยง

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

Sourceยง

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, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

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> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Sourceยง

fn vzip(self) -> V