Skip to content

Commit

Permalink
Added datasources module (essentially a dataset provisioning service)…
Browse files Browse the repository at this point in the history
… to this project
  • Loading branch information
Aklakan committed Dec 15, 2021
1 parent 2dbadeb commit 48b4663
Show file tree
Hide file tree
Showing 13 changed files with 895 additions and 609 deletions.
13 changes: 4 additions & 9 deletions conjure-cli-native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
</dependency>

<dependency>
<groupId>org.aksw.jena-sparql-api</groupId>
<artifactId>jena-sparql-api-conjure</artifactId>
<groupId>org.aksw.jenax</groupId>
<artifactId>jenax-conjure-core</artifactId>
</dependency>

<dependency>
Expand All @@ -64,13 +64,8 @@
</dependency>

<dependency>
<groupId>com.beust</groupId>
<artifactId>jcommander</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j18-impl</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.aksw.jena_sparql_api.conjure.dataset.engine.ConjureConstants;
import org.aksw.jena_sparql_api.conjure.dataset.engine.ConjureFormatConfig;
import org.aksw.jena_sparql_api.conjure.job.api.Job;
import org.aksw.jena_sparql_api.transform.result_set.QueryExecutionTransformResult;
import org.aksw.jenax.arq.util.node.NodeTransformLib2;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.riot.RDFDataMgr;
Expand All @@ -19,46 +19,46 @@

@Configuration
public class ConfigCliConjureNative {

// @Bean
// public Object applicationRunner() {
// System.out.println("Test");
// return 1;
// }

@Bean
@Autowired
public ApplicationRunner applicationRunner(
DataRef catalogDataRef,
Job job,
ConjureFormatConfig formatConfig) {
return args -> {
List<DcatDataset> datasets = MainCliConjureNative.executeJob(catalogDataRef, job, formatConfig);

Model model = ModelFactory.createDefaultModel();
for(DcatDataset dataset : datasets) {
Model contribModel = dataset.getModel();
model.add(contribModel);
}
@Bean
@Autowired
public ApplicationRunner applicationRunner(
DataRef catalogDataRef,
Job job,
ConjureFormatConfig formatConfig) {
return args -> {
List<DcatDataset> datasets = MainCliConjureNative.executeJob(catalogDataRef, job, formatConfig);

Model model = ModelFactory.createDefaultModel();
for(DcatDataset dataset : datasets) {
Model contribModel = dataset.getModel();
model.add(contribModel);
}

postProcessResultModel(model, job);

RDFDataMgr.write(System.out, model, RDFFormat.TURTLE_PRETTY);

postProcessResultModel(model, job);

RDFDataMgr.write(System.out, model, RDFFormat.TURTLE_PRETTY);


// RDFDataMgr.write(System.out, job.getModel(), RDFFormat.TURTLE_BLOCKS);
// for(DcatDataset dataset : datasets) {
// RDFDataMgr.write(System.out, dataset.getModel(), RDFFormat.TURTLE_BLOCKS);
// }
};
}
public static void postProcessResultModel(Model model, Job job) {
model.add(job.getModel());
};
}

public static void postProcessResultModel(Model model, Job job) {
model.add(job.getModel());

QueryExecutionTransformResult.applyNodeTransform(
n -> ConjureConstants.PROV_PLACEHOLDER_NODE.equals(n) ? job.asNode() : n,
model);
}
NodeTransformLib2.applyNodeTransform(
n -> ConjureConstants.PROV_PLACEHOLDER_NODE.equals(n) ? job.asNode() : n,
model);
}

}
Loading

0 comments on commit 48b4663

Please sign in to comment.