pub enum RDFFormat {
Turtle,
NTriples,
Rdfxml,
TriG,
N3,
NQuads,
JsonLd,
}Expand description
Represents RDF serialization formats
Variants§
Turtle
Turtle (Terse RDF Triple Language) format.
NTriples
N-Triples format.
Rdfxml
TriG
N3
N3 (Notation3) format.
NQuads
N-Quads format.
JsonLd
JSON-LD (JSON for Linking Data) format.
Implementations§
Source§impl RDFFormat
impl RDFFormat
Sourcepub fn extensions(&self) -> Vec<&'static str>
pub fn extensions(&self) -> Vec<&'static str>
Returns the file extensions associated with this format.
§Extensions by Format
- Turtle:
["ttl", "turtle"] - N-Triples:
["nt"] - RDF/XML:
["rdf", "xml"] - TriG:
["trig"] - N3:
["n3"] - NQuads:
["nq", "nquads"] - JSON-LD:
["jsonld", "json-ld", "json"]
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RDFFormat
impl<'de> Deserialize<'de> for RDFFormat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromStr for RDFFormat
impl FromStr for RDFFormat
Source§fn from_str(s: &str) -> Result<RDFFormat, RDFError>
fn from_str(s: &str) -> Result<RDFFormat, RDFError>
Parses a string into an RDF format.
This implementation is case-insensitive and accepts multiple variations for each format, including format names and common abbreviations.
§Accepted Strings (case-insensitive)
- Turtle: “ttl”, “turtle”
- N-Triples: “ntriples”, “nt”
- RDF/XML: “rdf/xml”, “rdf”
- TriG: “trig”
- N3: “n3”
- NQuads: “nquads”, “nq”
- JSON-LD: “jsonld”, “json”
§Arguments
s- The string to parse (case-insensitive)
§Errors
Returns RDFError::NotSupportedRDFFormatError if the input string doesn’t match any known format.
Source§impl Ord for RDFFormat
impl Ord for RDFFormat
Source§impl PartialOrd for RDFFormat
impl PartialOrd for RDFFormat
impl Copy for RDFFormat
impl Eq for RDFFormat
impl StructuralPartialEq for RDFFormat
Auto Trait Implementations§
impl Freeze for RDFFormat
impl RefUnwindSafe for RDFFormat
impl Send for RDFFormat
impl Sync for RDFFormat
impl Unpin for RDFFormat
impl UnsafeUnpin for RDFFormat
impl UnwindSafe for RDFFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.