/// Builds an RDF [literal](https://www.w3.org/TR/rdf11-concepts/#dfn-literal) with a [datatype](https://www.w3.org/TR/rdf11-concepts/#dfn-datatype-iri)
/// Builds an RDF [language-tagged string](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string)
#[inline]
pubfnnew_language_tagged_literal(
value: implInto<String>,
language: implInto<String>,
@ -81,6 +84,7 @@ impl Literal {
///
/// Except if you really know what you do,
/// you should use [`new_language_tagged_literal`](#method.new_language_tagged_literal).
#[inline]
pubfnnew_language_tagged_literal_unchecked(
value: implInto<String>,
language: implInto<String>,
@ -92,6 +96,7 @@ impl Literal {
}
/// The literal [lexical form](https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form)
#[inline]
pubfnvalue(&self)-> &str{
self.as_ref().value()
}
@ -100,6 +105,7 @@ impl Literal {
///
/// Language tags are defined by the [BCP47](https://tools.ietf.org/html/bcp47).
/// They are normalized to lowercase by this implementation.
#[inline]
pubfnlanguage(&self)-> Option<&str>{
self.as_ref().language()
}
@ -108,6 +114,7 @@ impl Literal {
///
/// The datatype of [language-tagged string](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string) is always [rdf:langString](http://www.w3.org/1999/02/22-rdf-syntax-ns#langString).
/// The datatype of [simple literals](https://www.w3.org/TR/rdf11-concepts/#dfn-simple-literal) is [xsd:string](http://www.w3.org/2001/XMLSchema#string).
#[inline]
pubfndatatype(&self)-> NamedNodeRef<'_>{
self.as_ref().datatype()
}
@ -116,10 +123,12 @@ impl Literal {
///
/// It returns true if the literal is a [language-tagged string](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string)
/// or has the datatype [xsd:string](http://www.w3.org/2001/XMLSchema#string).
@ -269,6 +294,7 @@ impl From<Decimal> for Literal {
}
implFrom<DateTime>forLiteral{
#[inline]
fnfrom(value: DateTime)-> Self{
Literal(LiteralContent::TypedLiteral{
value: value.to_string(),
@ -278,6 +304,7 @@ impl From<DateTime> for Literal {
}
implFrom<Time>forLiteral{
#[inline]
fnfrom(value: Time)-> Self{
Literal(LiteralContent::TypedLiteral{
value: value.to_string(),
@ -287,6 +314,7 @@ impl From<Time> for Literal {
}
implFrom<Date>forLiteral{
#[inline]
fnfrom(value: Date)-> Self{
Literal(LiteralContent::TypedLiteral{
value: value.to_string(),
@ -296,6 +324,7 @@ impl From<Date> for Literal {
}
implFrom<GYearMonth>forLiteral{
#[inline]
fnfrom(value: GYearMonth)-> Self{
Literal(LiteralContent::TypedLiteral{
value: value.to_string(),
@ -305,6 +334,7 @@ impl From<GYearMonth> for Literal {
}
implFrom<GYear>forLiteral{
#[inline]
fnfrom(value: GYear)-> Self{
Literal(LiteralContent::TypedLiteral{
value: value.to_string(),
@ -314,6 +344,7 @@ impl From<GYear> for Literal {
}
implFrom<GMonthDay>forLiteral{
#[inline]
fnfrom(value: GMonthDay)-> Self{
Literal(LiteralContent::TypedLiteral{
value: value.to_string(),
@ -323,6 +354,7 @@ impl From<GMonthDay> for Literal {
}
implFrom<GMonth>forLiteral{
#[inline]
fnfrom(value: GMonth)-> Self{
Literal(LiteralContent::TypedLiteral{
value: value.to_string(),
@ -332,6 +364,7 @@ impl From<GMonth> for Literal {
}
implFrom<GDay>forLiteral{
#[inline]
fnfrom(value: GDay)-> Self{
Literal(LiteralContent::TypedLiteral{
value: value.to_string(),
@ -341,6 +374,7 @@ impl From<GDay> for Literal {
}
implFrom<Duration>forLiteral{
#[inline]
fnfrom(value: Duration)-> Self{
Literal(LiteralContent::TypedLiteral{
value: value.to_string(),
@ -350,6 +384,7 @@ impl From<Duration> for Literal {
}
implFrom<YearMonthDuration>forLiteral{
#[inline]
fnfrom(value: YearMonthDuration)-> Self{
Literal(LiteralContent::TypedLiteral{
value: value.to_string(),
@ -359,6 +394,7 @@ impl From<YearMonthDuration> for Literal {
}
implFrom<DayTimeDuration>forLiteral{
#[inline]
fnfrom(value: DayTimeDuration)-> Self{
Literal(LiteralContent::TypedLiteral{
value: value.to_string(),
@ -404,11 +440,13 @@ enum LiteralRefContent<'a> {
impl<'a>LiteralRef<'a>{
/// Builds an RDF [simple literal](https://www.w3.org/TR/rdf11-concepts/#dfn-simple-literal)
#[inline]
pubfnnew_simple_literal(value: &'astr)-> Self{
LiteralRef(LiteralRefContent::String(value))
}
/// Builds an RDF [literal](https://www.w3.org/TR/rdf11-concepts/#dfn-literal) with a [datatype](https://www.w3.org/TR/rdf11-concepts/#dfn-datatype-iri)
/// The datatype of [language-tagged string](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string) is always [rdf:langString](http://www.w3.org/1999/02/22-rdf-syntax-ns#langString).
/// The datatype of [simple literals](https://www.w3.org/TR/rdf11-concepts/#dfn-simple-literal) is [xsd:string](http://www.w3.org/2001/XMLSchema#string).
#[inline]
pubfndatatype(self)-> NamedNodeRef<'a>{
matchself.0{
LiteralRefContent::String(_)=>xsd::STRING,
@ -466,6 +508,7 @@ impl<'a> LiteralRef<'a> {
///
/// It returns true if the literal is a [language-tagged string](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string)
/// or has the datatype [xsd:string](http://www.w3.org/2001/XMLSchema#string).
/// Builds an RDF [triple](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-triple) in a [RDF dataset](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset)
/// Builds an RDF [triple](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-triple) in a [RDF dataset](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset)