5555import org .aksw .jenax .dataaccess .sparql .connection .common .RDFConnectionUtils ;
5656import org .aksw .jenax .dataaccess .sparql .creator .RDFDatabase ;
5757import org .aksw .jenax .dataaccess .sparql .creator .RDFDatabaseFactory ;
58- import org .aksw .jenax .dataaccess .sparql .creator .RdfDatabaseBuilder ;
58+ import org .aksw .jenax .dataaccess .sparql .creator .RDFDatabaseBuilder ;
5959import org .aksw .jenax .dataaccess .sparql .datasource .RDFDataSource ;
6060import org .aksw .jenax .dataaccess .sparql .engine .RDFEngine ;
6161import org .aksw .jenax .dataaccess .sparql .engine .RDFEngines ;
@@ -269,7 +269,19 @@ public static int sparqlIntegrate(CmdSparqlIntegrateMain cmd) throws Exception {
269269 });
270270 }
271271
272- List <String > args = cmd .nonOptionArgs ;
272+ List <String > rawArgs = cmd .nonOptionArgs ;
273+
274+ List <String > args = new ArrayList <>();
275+
276+ for (String rawArg : rawArgs ) {
277+ List <String > resolved = ClassPathResourceResolver .resolve (rawArg );
278+ if (resolved .isEmpty ()) {
279+ args .add (rawArg );
280+ } else {
281+ logger .info ("Resolved " + rawArg + " to " + resolved );
282+ args .addAll (resolved );
283+ }
284+ }
273285
274286 // If an in/out file is given then prepend it to the arguments
275287 Path outFile = null ;
@@ -437,7 +449,10 @@ public static int sparqlIntegrate(CmdSparqlIntegrateMain cmd) throws Exception {
437449 if (databaseFactory != null ) {
438450 closeablePath = setupDbFolder (cmd );
439451
440- RdfDatabaseBuilder <?> databaseBuilder = databaseFactory .newBuilder ();
452+ RDFDatabaseBuilder <?> databaseBuilder = databaseFactory .newBuilder ();
453+
454+ databaseBuilder .setProperties (cmd .dbLoaderOptions );
455+
441456 Path outputFolder = closeablePath .path ();
442457 databaseBuilder .setOutputFolder (outputFolder );
443458
@@ -681,7 +696,7 @@ public static int sparqlIntegrate(CmdSparqlIntegrateMain cmd) throws Exception {
681696 Document metaDoc = parser .parseDocument (metaSchemaRawStr );
682697
683698 String graphQlSchemaRawStr = toStringUtf8 (streamMgr , cmd .graphQlSchema );
684- Document schemaDoc = parser . parseDocument (graphQlSchemaRawStr );
699+ Document schemaDoc = GraphQlUtils . parseUnrestricted (graphQlSchemaRawStr );
685700
686701 List <Definition > mergedDefinitions = new ArrayList <>();
687702 mergedDefinitions .addAll (metaDoc .getDefinitions ());
@@ -795,7 +810,7 @@ public void beforeExec() {
795810 public void beforeExec () {
796811 Context finalDatasetCxt = finalDataset .getContext ();
797812 if (finalDatasetCxt != null && finalDatasetCxt .isFalseOrUndef (SPATIAL_INDEX_IS_CLEAN )) {
798- updateSpatialIndex (finalDataset );
813+ updateSpatialIndex (finalDataset , cmd . arqConfig . geoindexSrs , cmd . arqConfig . geoindexFile );
799814
800815 // The the spatial index symbol is in the dataset's context
801816 // copy it into the query exec's context.
@@ -851,7 +866,7 @@ public void beforeExec() {
851866 if (finalDatasetCxt != null && finalDatasetCxt .isFalseOrUndef (SPATIAL_INDEX_IS_CLEAN )) {
852867 spatialUpdateNeeded = isSpatialIndexUpdateImmediatelyRequired (ur );
853868 if (spatialUpdateNeeded ) {
854- updateSpatialIndex (finalDataset );
869+ updateSpatialIndex (finalDataset , cmd . arqConfig . geoindexSrs , cmd . arqConfig . geoindexFile );
855870
856871 // The the spatial index symbol is in the dataset's context
857872 // copy it into the query exec's context.
@@ -875,7 +890,7 @@ public void afterExec() {
875890 // Defer update
876891 if (false && spatialUpdateNeeded ) {
877892 // Note: The update runs in the same transaction as the update!
878- updateSpatialIndex (finalDataset );
893+ updateSpatialIndex (finalDataset , cmd . arqConfig . geoindexSrs , cmd . arqConfig . geoindexFile );
879894 }
880895 }
881896 };
@@ -1112,11 +1127,11 @@ private static void loadMacros(Set<String> macroProfiles, Map<String, UserDefine
11121127 }
11131128
11141129 /** Be careful not to call within a read transaction! */
1115- public static void updateSpatialIndex (Dataset dataset ) {
1130+ public static void updateSpatialIndex (Dataset dataset , String srs , Path file ) {
11161131 Context cxt = dataset .getContext ();
1117- logger .info ("(Re-)computing geo index" );
1132+ // logger.info("(Re-)computing geo index");
11181133 try {
1119- GeoSPARQLConfig .setupSpatialIndex (dataset );
1134+ GeoSPARQLConfig .setupSpatialIndex (dataset , srs , file );
11201135 cxt .setTrue (SPATIAL_INDEX_IS_CLEAN );
11211136 } catch (Exception e ) {
11221137 if (e .getMessage ().toLowerCase ().contains ("no srs found" )) {
0 commit comments