// Version for proposed Turtle-in-TriG and keyword GRAPH
protected final void oneNamedGraphBlock2() {
// Which may not be a graph block.
Node graphNode = null ;
Token token = peekToken() ;
Token t = token ; // Keep for error message.
boolean mustBeNamedGraph = false ;
if ( lookingAt(KEYWORD) ) {
if ( token.getImage().equalsIgnoreCase("GRAPH") ) {
nextToken() ;
mustBeNamedGraph = true ;
token = peekToken() ;
// GRAPH <g>
// GRAPH []
} else
exception(t, "Keyword '" + token.getImage() + "' not allowed here") ;
}
// GRAPH dealt with.
// Starting points:
// [ ] { .... }
// :g { ... }
// :s :p :o .
// [ ] :p :o .
// [ :p 123 ] :p :o .
// () :p :o .
// (1 2) :p :o .
// XXX Find the Turtle code to do this for the Trutle case and refactor.
if ( lookingAt(LBRACKET) ) {
nextToken() ;
token = peekToken() ;
Node blank = profile.createBlankNode(graphNode, t.getLine(), t.getColumn()) ;
if ( lookingAt(RBRACKET) ) {
// Can be Turtle, "[] :predicate", or named graph "[] {"
nextToken() ;
if ( lookingAt(LBRACE) )
graphNode = blank ;