Expand description
This library provides primitive traits to serialize and deserialize
Linked-Data types. It is shipped with derive macros (using the derive
feature) that can automatically implement those primitives for you.
§Example
use iref::IriBuf;
use static_iref::iri;
#[derive(linked_data_next::Serialize, linked_data_next::Deserialize)]
#[ld(prefix("ex" = "http://example.org/"))]
struct Foo {
  #[ld(id)]
  id: IriBuf,
  #[ld("ex:name")]
  name: String,
  #[ld("ex:email")]
  email: String
}
let value = Foo {
  id: iri!("http://example.org/JohnSmith").to_owned(),
  name: "John Smith".to_owned(),
  email: "john.smith@example.org".to_owned()
};
let quads = linked_data_next::to_quads(rdf_types::generator::Blank::new(), &value)
  .expect("RDF serialization failed");
for quad in quads {
  use rdf_types::RdfDisplay;
  println!("{} .", quad.rdf_display())
}This should print the following:
<http://example.org/JohnSmith> <http://example.org/name> "John Smith" .
<http://example.org/JohnSmith> <http://example.org/email> "john.smith@example.org" .Macros§
Structs§
- Anonymous
- Anonymous lexical representation.
- AnonymousBinding 
- AnonymousGraph 
- Ref
Enums§
- Context
- ContextIris 
- CowRdfLiteral 
- CowRdfTerm 
- CowRef
- FromLinked Data Error 
- IntoQuads Error 
- RdfLiteral
- RdfLiteralRef 
- ResourceInterpretation 
- Resource interpretation.
- ResourceOrIri Ref 
Traits§
- AsRdfLiteral 
- GraphVisitor 
- LinkedData 
- Linked-Data type.
- LinkedData Deserialize 
- LinkedData Deserialize Predicate Objects 
- LinkedData Deserialize Subject 
- LinkedData Graph 
- Serialize a Linked-Data graph.
- LinkedData Predicate Objects 
- Type representing the objects of an RDF subject’s predicate binding.
- LinkedData Resource 
- Type that can have an interpretation.
- LinkedData Resource Ref 
- Type that can have an interpretation bound to the given lifetime.
- LinkedData Subject 
- Serialize a Linked-Data node.
- PredicateObjects Visitor 
- RdfLiteralType 
- RdfLiteralValue 
- SubjectVisitor 
- Visitor
- RDF dataset visitor.
Functions§
- to_interpreted_ graph_ quads 
- to_interpreted_ quads 
- to_interpreted_ subject_ quads 
- to_lexical_ quads 
- to_lexical_ quads_ with 
- to_lexical_ subject_ quads 
- to_lexical_ subject_ quads_ with 
- to_quads 
- to_quads_ with