Struct json_ld::object::node::Node [−][src]
Expand description
A node object.
A node is defined by its identifier (@id
field), types, properties and reverse properties.
In addition, a node may represent a graph (@graph field
) and includes nodes
(@included
field).
Implementations
Checks if the node object has the given term as key.
Example
// Checks if the JSON object representation of the node has an `@id` key.
if node.has_key(&Term::Keyword(Keyword::Id)) {
// ...
}
Get the identifier of the node.
This correspond to the @id
field of the JSON object.
Get the node’s as an IRI if possible.
Returns the node’s IRI id if any. Returns None
otherwise.
Get the node’s id, is any, as a string slice.
Returns None
if the node has no @id
field.
Get the list of the node’s types.
This returns a list of Lenient
types, including malformed types that are not
IRIs of blank node identifiers.
Checks if the node has the given type.
Tests if the node is empty.
It is empty is every field other than @id
is empty.
Tests if the node is a graph object (has a @graph
field, and optionally an @id
field).
Note that node objects may have a @graph entry,
but are not considered graph objects if they include any other entries other than @id
.
Tests if the node is a simple graph object (a graph object without @id
field)
If the node is a graph object, get the graph.
If the node is a graph object, get the mutable graph.
Get the set of nodes included by this node.
This correspond to the @included
field in the JSON representation.
Get the mutable set of nodes included by this node.
This correspond to the @included
field in the JSON representation.
Set the set of nodes included by the node.
Get all the objects associated to the node with the given property.
Get one of the objects associated to the node with the given property.
If multiple objects are attaced to the node with this property, there are no guaranties on which object will be returned.
Associate the given object to the node through the given property.
Associate all the given objects to the node through the given property.
pub fn insert_all_reverse<Nodes: Iterator<Item = Indexed<Node<T>>>>(
&mut self,
reverse_prop: Reference<T>,
reverse_values: Nodes
)
Tests if the node is an unnamed graph object.
Returns true
is the only field of the object is a @graph
field.
Returns false
otherwise.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Node<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Node<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more