Module rdftk_core::statement [−][src]
Expand description
This module provides types for the RDF Statement (triple) concept.
- A statement comprises a subject, a predicate, and an object.
- A subject may be a blank (unnamed) node, an IRI (named node), or a statement reference according to RDF-star.
- A predicate is an IRI.
- An object may be a blank (unnamed) node, an IRI (named node), a literal value, or a statement reference according to RDF-star.
- A literal has a string-like lexical form and may have an asserted data type or a language identifier.
Example
use rdftk_core::{Statement, SubjectNode, ObjectNode}; use rdftk_core::statement::StatementList; use rdftk_iri::IRI; use std::rc::Rc; use std::str::FromStr; let mut statements: StatementList = Default::default(); statements.push(Statement::new_ref( SubjectNode::from(IRI::from_str("http://en.wikipedia.org/wiki/Tony_Benn").unwrap()).into(), IRI::from_str("http://purl.org/dc/elements/1.1/title").unwrap().into(), ObjectNode::literal_str("Tony Benn").into(), ));
Structs
ObjectNode | An object node may be another resource, or a literal value. In this way graphs can easily be made using resource links. |
Statement | A statement comprises a subject, a predicate, and an object. |
SubjectNode | A subject node anchors one or more statements in a graph such that all statements with a common subject are considered to be statements about the same thing. |
Type Definitions
ObjectNodeRef | The actual object storage type, reference counted for memory management. |
StatementList | A list of statements, this can be used to pass non-graph sets of statements. |
StatementRef | The actual statement storage type, reference counted for memory management. |
SubjectNodeRef | The actual subject storage type, reference counted for memory management. |