|
|
@ -127,7 +127,7 @@ impl RuleRecognizer for TriGRecognizer { |
|
|
|
TriGState::TriplesOrGraph => match token { |
|
|
|
TriGState::TriplesOrGraph => match token { |
|
|
|
N3Token::IriRef(iri) => { |
|
|
|
N3Token::IriRef(iri) => { |
|
|
|
self.stack.push(TriGState::WrappedGraphOrPredicateObjectList { |
|
|
|
self.stack.push(TriGState::WrappedGraphOrPredicateObjectList { |
|
|
|
term: NamedNode::new_unchecked(iri.into_inner()).into() |
|
|
|
term: NamedNode::from(iri).into() |
|
|
|
}); |
|
|
|
}); |
|
|
|
self |
|
|
|
self |
|
|
|
} |
|
|
|
} |
|
|
@ -291,7 +291,7 @@ impl RuleRecognizer for TriGRecognizer { |
|
|
|
self |
|
|
|
self |
|
|
|
} |
|
|
|
} |
|
|
|
N3Token::IriRef(iri) => { |
|
|
|
N3Token::IriRef(iri) => { |
|
|
|
self.cur_subject.push(NamedNode::new_unchecked(iri.into_inner()).into()); |
|
|
|
self.cur_subject.push(NamedNode::from(iri).into()); |
|
|
|
self.stack.push(TriGState::PredicateObjectList); |
|
|
|
self.stack.push(TriGState::PredicateObjectList); |
|
|
|
self |
|
|
|
self |
|
|
|
} |
|
|
|
} |
|
|
@ -337,7 +337,7 @@ impl RuleRecognizer for TriGRecognizer { |
|
|
|
// [7g] labelOrSubject ::= iri | BlankNode
|
|
|
|
// [7g] labelOrSubject ::= iri | BlankNode
|
|
|
|
TriGState::GraphName => match token { |
|
|
|
TriGState::GraphName => match token { |
|
|
|
N3Token::IriRef(iri) => { |
|
|
|
N3Token::IriRef(iri) => { |
|
|
|
self.cur_graph = NamedNode::new_unchecked(iri.into_inner()).into(); |
|
|
|
self.cur_graph = NamedNode::from(iri).into(); |
|
|
|
self |
|
|
|
self |
|
|
|
} |
|
|
|
} |
|
|
|
N3Token::PrefixedName { prefix, local, might_be_invalid_iri } => match resolve_local_name(prefix, &local, might_be_invalid_iri, &self.prefixes) { |
|
|
|
N3Token::PrefixedName { prefix, local, might_be_invalid_iri } => match resolve_local_name(prefix, &local, might_be_invalid_iri, &self.prefixes) { |
|
|
@ -451,7 +451,7 @@ impl RuleRecognizer for TriGRecognizer { |
|
|
|
self |
|
|
|
self |
|
|
|
} |
|
|
|
} |
|
|
|
N3Token::IriRef(iri) => { |
|
|
|
N3Token::IriRef(iri) => { |
|
|
|
self.cur_predicate.push(NamedNode::new_unchecked(iri.into_inner())); |
|
|
|
self.cur_predicate.push(NamedNode::from(iri)); |
|
|
|
self |
|
|
|
self |
|
|
|
} |
|
|
|
} |
|
|
|
N3Token::PrefixedName { prefix, local, might_be_invalid_iri } => match resolve_local_name(prefix, &local, might_be_invalid_iri, &self.prefixes) { |
|
|
|
N3Token::PrefixedName { prefix, local, might_be_invalid_iri } => match resolve_local_name(prefix, &local, might_be_invalid_iri, &self.prefixes) { |
|
|
@ -479,7 +479,7 @@ impl RuleRecognizer for TriGRecognizer { |
|
|
|
// [137s] BlankNode ::= BLANK_NODE_LABEL | ANON
|
|
|
|
// [137s] BlankNode ::= BLANK_NODE_LABEL | ANON
|
|
|
|
TriGState::Object => match token { |
|
|
|
TriGState::Object => match token { |
|
|
|
N3Token::IriRef(iri) => { |
|
|
|
N3Token::IriRef(iri) => { |
|
|
|
self.cur_object.push(NamedNode::new_unchecked(iri.into_inner()).into()); |
|
|
|
self.cur_object.push(NamedNode::from(iri).into()); |
|
|
|
self.emit_quad(results); |
|
|
|
self.emit_quad(results); |
|
|
|
self |
|
|
|
self |
|
|
|
} |
|
|
|
} |
|
|
@ -632,7 +632,7 @@ impl RuleRecognizer for TriGRecognizer { |
|
|
|
TriGState::LiteralExpectDatatype { value, emit } => { |
|
|
|
TriGState::LiteralExpectDatatype { value, emit } => { |
|
|
|
match token { |
|
|
|
match token { |
|
|
|
N3Token::IriRef(datatype) => { |
|
|
|
N3Token::IriRef(datatype) => { |
|
|
|
self.cur_object.push(Literal::new_typed_literal(value, NamedNode::new_unchecked(datatype.into_inner())).into()); |
|
|
|
self.cur_object.push(Literal::new_typed_literal(value, datatype).into()); |
|
|
|
if emit { |
|
|
|
if emit { |
|
|
|
self.emit_quad(results); |
|
|
|
self.emit_quad(results); |
|
|
|
} |
|
|
|
} |
|
|
@ -694,7 +694,7 @@ impl RuleRecognizer for TriGRecognizer { |
|
|
|
self |
|
|
|
self |
|
|
|
} |
|
|
|
} |
|
|
|
N3Token::IriRef(iri) => { |
|
|
|
N3Token::IriRef(iri) => { |
|
|
|
self.cur_subject.push(NamedNode::new_unchecked(iri.into_inner()).into()); |
|
|
|
self.cur_subject.push(NamedNode::from(iri).into()); |
|
|
|
self |
|
|
|
self |
|
|
|
} |
|
|
|
} |
|
|
|
N3Token::PrefixedName { prefix, local, might_be_invalid_iri } => match resolve_local_name(prefix, &local, might_be_invalid_iri, &self.prefixes) { |
|
|
|
N3Token::PrefixedName { prefix, local, might_be_invalid_iri } => match resolve_local_name(prefix, &local, might_be_invalid_iri, &self.prefixes) { |
|
|
@ -726,7 +726,7 @@ impl RuleRecognizer for TriGRecognizer { |
|
|
|
self |
|
|
|
self |
|
|
|
} |
|
|
|
} |
|
|
|
N3Token::IriRef(iri) => { |
|
|
|
N3Token::IriRef(iri) => { |
|
|
|
self.cur_object.push(NamedNode::new_unchecked(iri.into_inner()).into()); |
|
|
|
self.cur_object.push(NamedNode::from(iri).into()); |
|
|
|
self |
|
|
|
self |
|
|
|
} |
|
|
|
} |
|
|
|
N3Token::PrefixedName { prefix, local, might_be_invalid_iri } => match resolve_local_name(prefix, &local, might_be_invalid_iri, &self.prefixes) { |
|
|
|
N3Token::PrefixedName { prefix, local, might_be_invalid_iri } => match resolve_local_name(prefix, &local, might_be_invalid_iri, &self.prefixes) { |
|
|
|