Skip to main content

Crate jsonld_core

Crate jsonld_core 

Source
Expand description

Core types shared by the JSON-LD processing algorithms.

This crate defines the data model the algorithm crates operate on — the processed Context, the Object tree an expanded document is made of, ExpandedDocument and FlattenedDocument, and the Loader trait used to dereference remote contexts — together with the conversions to RDF (rdf) and the pretty-printer (print).

Identifiers are generic over the vocabulary that interns them: T is an IRI handle and B a blank node identifier handle, defaulting to owned iri_rs::IriBuf and rdfx::BlankIdBuf values.

Most users should depend on the jsonld umbrella crate rather than on this one directly; it re-exports everything here alongside the algorithms.

Re-exports§

pub use context::Context;
pub use context::ContextRef;
pub use flattening::Flatten;
pub use object::IndexedNode;
pub use object::IndexedObject;
pub use object::Node;
pub use object::Nodes;
pub use object::Object;
pub use object::Objects;
pub use object::TryFromJson;
pub use object::Value;
pub use quad::LdQuads;
pub use rdf::RdfQuads;
pub use id::*;
pub use loader::*;

Modules§

context
Context processing algorithm and related types.
expanded
Expanded documents.
flattened
Flattened documents.
flattening
Flattening algorithm and related types.
id
Node identifiers, valid or not.
loader
Document loaders.
object
Nodes, lists and values.
print
Pretty-printing of JSON-LD documents. Pretty-printing of expanded documents through a vocabulary.
quad
RDF quads of an expanded document.
rdf
Conversion of expanded JSON-LD documents to RDF, and the well-known IRI constants the conversion needs.
utils
Utility functions.
warning
Warnings raised by the algorithms.

Structs§

Document
JSON-LD document in both compact and expanded form.
Environment
Vocabulary, loader and warning handler an algorithm runs against.
ExpandedDocument
Result of the document expansion algorithm: a set of (indexed) objects.
Indexed
Indexed objects.
InvalidLangString
Raised when something tried to build a language string without language tag or direction.
LangStr
Language string reference.
LangString
Language string.
LenientLangTag
Language tag that may not be well-formed.
LenientLangTagBuf
Owned language tag that may not be well-formed.
MissingLangQualifier
Raised when a LangString mutation would leave it without both a language tag and a direction.
UnknownProcessingMode
Error raised when parsing an unknown processing-mode name.

Enums§

Container
Container mapping of a term: the combination of @container values it was defined with.
ContainerKind
A single @container value.
Direction
Internationalized string direction.
Nullable
Value that can be null.
ProcessingMode
Processing mode.
SerializationError
Term
Identifier, keyword or @null.
Type
Object type.

Traits§

Print
Print methods.

Type Aliases§

DefaultBuildHashergxhash
Hasher used by the collections of this crate.
DocumentParts
Remote document paired with its expanded form.
FlattenedDocument
Result of the document flattening algorithm.
HashMap
Hash map using DefaultBuildHasher.
HashSet
Hash set using DefaultBuildHasher.
IndexMap
Insertion-ordered map using DefaultBuildHasher.
IndexSet
Insertion-ordered set using DefaultBuildHasher.