Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sparqlify now ported to the new the new API towards unified virtual g…
…raph handling
- Loading branch information
Showing
19 changed files
with
229 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
.../src/main/java/net/sansa_stack/query/spark/api/domain/JavaQueryExecutionFactorySpark.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package net.sansa_stack.query.spark.api.domain; | ||
|
||
import org.aksw.jena_sparql_api.core.QueryExecutionFactory; | ||
import org.apache.jena.query.Query; | ||
import org.apache.jena.query.QueryExecution; | ||
|
||
public interface JavaQueryExecutionFactorySpark | ||
extends QueryExecutionFactory | ||
{ | ||
@Override | ||
JavaQueryExecutionSpark createQueryExecution(Query query); | ||
|
||
@Override | ||
JavaQueryExecutionSpark createQueryExecution(String queryString); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...in/scala/net/sansa_stack/query/spark/api/impl/QueryExecutionFactorySparkJavaWrapper.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package net.sansa_stack.query.spark.api.impl | ||
|
||
import net.sansa_stack.query.spark.api.domain.{JavaQueryExecutionFactorySpark, QueryExecutionFactorySpark, QueryExecutionSpark} | ||
import org.aksw.jena_sparql_api.core.QueryExecutionFactoryDecoratorBase | ||
import org.apache.jena.query.Query | ||
|
||
class QueryExecutionFactorySparkJavaWrapper(delegate: JavaQueryExecutionFactorySpark) | ||
extends QueryExecutionFactoryDecoratorBase[JavaQueryExecutionFactorySpark](delegate) | ||
with QueryExecutionFactorySpark | ||
{ | ||
override def createQueryExecution(query: Query): QueryExecutionSpark = new QueryExecutionSparkJavaWrapper(decoratee.createQueryExecution(query)) | ||
override def createQueryExecution(queryString: String): QueryExecutionSpark = new QueryExecutionSparkJavaWrapper(decoratee.createQueryExecution(queryString)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...rk/src/main/scala/net/sansa_stack/query/spark/sparqlify/QueryEngineFactorySparqlify.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package net.sansa_stack.query.spark.sparqlify | ||
|
||
import net.sansa_stack.query.spark.api.domain.QueryExecutionFactorySpark | ||
import net.sansa_stack.query.spark.api.impl.{QueryEngineFactoryBase, QueryExecutionFactorySparkJavaWrapper} | ||
import org.aksw.sparqlify.core.interfaces.SparqlSqlStringRewriter | ||
import org.apache.jena.rdf.model.Model | ||
import org.apache.spark.sql.SparkSession | ||
|
||
class QueryEngineFactorySparqlify(sparkSession: SparkSession) extends QueryEngineFactoryBase(sparkSession) { | ||
override def create(databaseName: String, mappingModel: Model): QueryExecutionFactorySpark = { | ||
val rewriter: SparqlSqlStringRewriter = SparqlifyUtils3.createSparqlSqlRewriter(sparkSession, databaseName, mappingModel) | ||
|
||
val result = new QueryExecutionFactorySparkJavaWrapper( | ||
new JavaQueryExecutionFactorySparqlifySpark(sparkSession, rewriter)) | ||
|
||
result | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
...n/src/main/scala/net/sansa_stack/rdf/common/partition/core/RdfPartitionImportExport.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...on/src/main/scala/net/sansa_stack/rdf/common/partition/r2rml/R2rmlMappingCollection.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package net.sansa_stack.rdf.common.partition.r2rml | ||
|
||
import org.apache.jena.rdf.model.Model | ||
|
||
/** | ||
* A dedicated type for an R2RML model such that | ||
* implicit functions can be defined for it | ||
*/ | ||
trait R2rmlMappingCollection { // TODO Consider renaming to R2rmlBasedPartitioning | ||
|
||
def getR2rmlModel(): Model | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
...rc/main/scala/net/sansa_stack/rdf/common/partition/r2rml/R2rmlMappingCollectionImpl.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package net.sansa_stack.rdf.common.partition.r2rml | ||
|
||
import org.apache.jena.rdf.model.Model | ||
|
||
class R2rmlMappingCollectionImpl(val r2rmlModel: Model) | ||
extends R2rmlMappingCollection with Serializable { | ||
override def getR2rmlModel(): Model = r2rmlModel | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.