Why can a Subject be a Triple?
hoijui opened this issue · 6 comments
Reffering to:
https://docs.rs/rio_api/0.6.1/rio_api/model/enum.Subject.html
To me, that is very confusing.
Could you maybe add a comment explaining that,
maybe referencing the related part of the RDF spec?
Thank you!
Though... the documentation you linked to, states:
the subject, which is an IRI or a blank node
So this makes me even more confused,
why your code allows to use a triple as the subject.
I see:
NamedNode
in code maps toIRI
in the definitionBlankNode
in code maps toblank node
in the definitionTriple
in code ... I don't understand
Hi! Yes, that's a great point. It's because Rio does support RDF-star that allows triples to be the subject of other triples. To make it less confusing, I can maybe define Subject
as the union of NamedNode
, BlankNode
and Triple
without connecting it to the notion of "RDF triple subject". Similarly a Term
can be a Triple
in Rio.
ahaa!!
thanks, now I got it!
I would like to see this explanation there!
maybe:
pub enum Subject<'a> {
NamedNode(NamedNode<'a>),
BlankNode(BlankNode<'a>),
/// Rio does support [RDF-star](https://w3c.github.io/rdf-star/cg-spec/2021-07-01.html#dfn-triple),
/// which allows triples to be the subject of other triples.
/// If you do not use RDF-star, you should not see or use this variant.
Triple(&'a Triple<'a>),
}
?
ahh nice, thank you!
that should do now. :-)