Struct rdftk_core::resource::Resource[][src]

pub struct Resource { /* fields omitted */ }

The main resource builder type.

Implementations

impl Resource[src]

pub fn new(subject: SubjectNode) -> Self[src]

Construct a new Resource with the subject cloned from an existing SubjectNode.

pub fn blank() -> Self[src]

Construct a new Resource with a new blank node as the subject.

pub fn blank_named(name: &str) -> Self[src]

Construct a new Resource with a named blank node as the subject.

pub fn named(name: IRIRef) -> Self[src]

Construct a new Resource with the provided IRI as the subject.

pub fn is_a_resource(&self) -> bool[src]

Returns true if this instance is a resource in web terms, that is it's subject is an IRI.

pub fn is_an_individual(&self) -> bool[src]

Returns true if this instance is an individual in RDFS terms, that is it has at least one rdf:type predicate.

pub fn predicate(&mut self, predicate: Predicate) -> &mut Self[src]

Add the Predicate instance to this resource.

pub fn property(&mut self, predicate: IRIRef, value: Literal) -> &mut Self[src]

Add a new predicate with a literal value to this resource.

pub fn value_of(&mut self, predicate: IRIRef, value: Literal) -> &mut Self[src]

Add a new predicate with a literal value to this resource.

pub fn literal(&mut self, predicate: IRIRef, value: Literal) -> &mut Self[src]

Add a new predicate with a literal value to this resource.

pub fn property_alternatives(
    &mut self,
    predicate: IRIRef,
    values: &[Literal]
) -> &mut Self
[src]

pub fn property_bag(
    &mut self,
    predicate: IRIRef,
    values: &[Literal]
) -> &mut Self
[src]

pub fn property_sequence(
    &mut self,
    predicate: IRIRef,
    values: &[Literal]
) -> &mut Self
[src]

pub fn property_container(
    &mut self,
    predicate: IRIRef,
    values: &[Literal],
    kind: IRIRef
) -> &mut Self
[src]

pub fn resource_blank_named(
    &mut self,
    predicate: IRIRef,
    name: &str
) -> &mut Self
[src]

pub fn resource_named(&mut self, predicate: IRIRef, name: IRIRef) -> &mut Self[src]

pub fn resource(&mut self, predicate: IRIRef, resource: Resource) -> &mut Self[src]

pub fn resource_alternatives(
    &mut self,
    predicate: IRIRef,
    values: &[Resource]
) -> &mut Self
[src]

pub fn resource_bag(
    &mut self,
    predicate: IRIRef,
    values: &[Resource]
) -> &mut Self
[src]

pub fn resource_sequence(
    &mut self,
    predicate: IRIRef,
    values: &[Resource]
) -> &mut Self
[src]

pub fn resource_container(
    &mut self,
    predicate: IRIRef,
    values: &[Resource],
    kind: IRIRef
) -> &mut Self
[src]

pub fn instance_of(&mut self, name: IRIRef) -> &mut Self[src]

Set the RDF type (classifier) of this resource.

Trait Implementations

impl Clone for Resource[src]

impl Debug for Resource[src]

impl Into<Vec<Rc<Statement>, Global>> for Resource[src]

impl Into<Vec<Statement, Global>> for Resource[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.