public void performAdd ( File file , String baseURI , RDFFormat dataFormat , Transaction tx , Resource ... contexts ) throws RDFParseException { try { graphManager . setDefaultMimetype ( dataFormat . getDefaultMIMEType ( ) ) ; if ( dataFormat . equals ( RDFFormat . NQUADS ) || dataFormat . equals ( RDFFormat . TRIG ) ) { graphManager . mergeGraphs ( new FileHandle ( file ) , tx ) ; } else { if ( notNull ( contexts ) && contexts . length > 0 ) { for ( int i = 0 ; i < contexts . length ; i ++ ) { if ( notNull ( contexts [ i ] ) ) { graphManager . mergeAs ( contexts [ i ] . toString ( ) , new FileHandle ( file ) , getGraphPerms ( ) , tx ) ; } else { graphManager . mergeAs ( DEFAULT_GRAPH_URI , new FileHandle ( file ) , getGraphPerms ( ) , tx ) ; } } } else { graphManager . mergeAs ( DEFAULT_GRAPH_URI , new FileHandle ( file ) , getGraphPerms ( ) , tx ) ; } } } catch ( FailedRequestException e ) { logger . error ( e . getLocalizedMessage ( ) ) ; throw new RDFParseException ( "Request to MarkLogic server failed, check file and format." ) ; } }
as we use mergeGraphs baseURI is always file . toURI