Enum json_ld::expansion::Policy [−][src]
pub enum Policy {
Relaxed,
Standard,
Strict,
Strictest,
}
Expand description
Key expansion policy.
The default behavior of the expansion algorithm is to drop keys that are not defined in the context unless:
- there is a vocabulary mapping (
@vocab
) defined in the context; or - the term contains a
:
character. In other words, a key that cannot be expanded into an IRI or a blank node identifier is dropped unless it contains a:
character.
Sometimes, it is preferable to keep undefined keys in the
expanded document, or to forbid them completely by raising an error.
You can define your preferred policy using one of this type variant
with the Options::policy
field.
Variants
Relaxed policy.
Undefined keys are always kept in the expanded document
using the [Reference::Invalid
] variant.
Standard policy.
Every key that cannot be expanded into an
IRI or a blank node identifier is dropped unless it contains a :
character.
Strict policy.
Every key that cannot be expanded into an IRI or a blank node identifier
will raise an error unless the term contains a :
character.
Strictest policy.
Every key that cannot be expanded into an IRI or a blank node identifier will raise an error.
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Policy
impl UnwindSafe for Policy
Blanket Implementations
Mutably borrows from an owned value. Read more