pub fn as_triples(bgp: &[TripleOrPathPattern]) -> Result<Vec<TriplePattern>, types::InvalidRule> {
    bgp.iter()
        .map(|trpl| match trpl {
            TripleOrPathPattern::Triple(tp @ TriplePattern { .. }) => Ok(tp.clone()),
            TripleOrPathPattern::Path(_) => Err(types::InvalidRule::IllegalPathPattern),
        })
        .collect()
}
/// try to represent a basic graph pattern as triples only. If the pattern contains path items
/// return Err
try to represent a basic graph pattern as triples only. If the pattern contains path items
return Err
try to represent a basic graph pattern as triples only . If the pattern contains path items return Err
pub fn as_triples(bgp: &[TripleOrPathPattern]) -> Result<Vec<TriplePattern>, types::InvalidRule> {
    bgp.iter()
        .map(|trpl| match trpl {
            TripleOrPathPattern::Triple(tp @ TriplePattern { .. }) => Ok(tp.clone()),
            TripleOrPathPattern::Path(_) => Err(types::InvalidRule::IllegalPathPattern),
        })
        .collect()
}
pub fn as_triples ( bgp : & [ TripleOrPathPattern ] ) -> Result < Vec < TriplePattern > , types :: InvalidRule > { bgp . iter ( ) . map ( | trpl | match trpl { TripleOrPathPattern :: Triple ( tp @ TriplePattern { .. } ) => Ok ( tp . clone ( ) ) , TripleOrPathPattern :: Path ( _ ) => Err ( types :: InvalidRule :: IllegalPathPattern ) , } ) . collect ( ) }
try to represent a basic graph pattern as triples only.
try to represent a basic graph pattern as triples only .
bgp
&[TripleOrPathPattern]
bgp
&[TripleOrPathPattern]