/// The owned union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri) and [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node).
/// The owned union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri), [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node) and [triples](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-triple).
@ -67,28 +75,42 @@ impl From<BlankNodeRef<'_>> for Subject {
}
}
}
}
/// The borrowed union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri) and [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node).
implFrom<Triple>forSubject{
#[inline]
fnfrom(node: Triple)-> Self{
Self::Triple(Arc::new(node))
}
}
implFrom<TripleRef<'_>>forSubject{
#[inline]
fnfrom(node: TripleRef<'_>)-> Self{
node.into_owned().into()
}
}
/// The borrowed union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri), [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node) and [triples](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-triple).
SubjectRef::Triple(_)=>unimplemented!("Rio library does not support RDF* yet"),
}
}
}
}
}
}
/// An owned RDF [term](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-term)
/// An owned RDF [term](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-term)
/// It is the union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri), [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node) and [literals](https://www.w3.org/TR/rdf11-concepts/#dfn-literal).
/// It is the union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri), [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node), [literals](https://www.w3.org/TR/rdf11-concepts/#dfn-literal) and [triples](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-triple).
@ -245,6 +289,19 @@ impl From<LiteralRef<'_>> for Term {
literal.into_owned().into()
literal.into_owned().into()
}
}
}
}
implFrom<Triple>forTerm{
#[inline]
fnfrom(triple: Triple)-> Self{
Self::Triple(Arc::new(triple))
}
}
implFrom<TripleRef<'_>>forTerm{
#[inline]
fnfrom(triple: TripleRef<'_>)-> Self{
triple.into_owned().into()
}
}
implFrom<Subject>forTerm{
implFrom<Subject>forTerm{
#[inline]
#[inline]
@ -252,6 +309,7 @@ impl From<Subject> for Term {
matchnode{
matchnode{
Subject::NamedNode(node)=>node.into(),
Subject::NamedNode(node)=>node.into(),
Subject::BlankNode(node)=>node.into(),
Subject::BlankNode(node)=>node.into(),
Subject::Triple(triple)=>Self::Triple(triple),
}
}
}
}
}
}
@ -264,12 +322,13 @@ impl From<SubjectRef<'_>> for Term {
}
}
/// A borrowed RDF [term](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-term)
/// A borrowed RDF [term](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-term)
/// It is the union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri), [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node) and [literals](https://www.w3.org/TR/rdf11-concepts/#dfn-literal).
/// It is the union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri), [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node), [literals](https://www.w3.org/TR/rdf11-concepts/#dfn-literal) and [triples](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-triple).
TermRef::Triple(_)=>unimplemented!("Rio library does not support RDF* yet"),
}
}
}
}
}
}
@ -600,45 +682,6 @@ impl From<BlankNodeRef<'_>> for GraphName {
}
}
}
}
implFrom<Subject>forGraphName{
#[inline]
fnfrom(node: Subject)-> Self{
matchnode{
Subject::NamedNode(node)=>node.into(),
Subject::BlankNode(node)=>node.into(),
}
}
}
implFrom<SubjectRef<'_>>forGraphName{
#[inline]
fnfrom(node: SubjectRef<'_>)-> Self{
node.into_owned().into()
}
}
implFrom<Option<Subject>>forGraphName{
#[inline]
fnfrom(name: Option<Subject>)-> Self{
ifletSome(node)=name{
node.into()
}else{
GraphName::DefaultGraph
}
}
}
implFrom<GraphName>forOption<Subject>{
#[inline]
fnfrom(name: GraphName)-> Self{
matchname{
GraphName::NamedNode(node)=>Some(node.into()),
GraphName::BlankNode(node)=>Some(node.into()),
GraphName::DefaultGraph=>None,
}
}
}
/// A possible borrowed graph name.
/// A possible borrowed graph name.
/// It is the union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri), [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node), and the [default graph name](https://www.w3.org/TR/rdf11-concepts/#dfn-default-graph).
/// It is the union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri), [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node), and the [default graph name](https://www.w3.org/TR/rdf11-concepts/#dfn-default-graph).