Skip to content

Commit

Permalink
fix: handle triples
Browse files Browse the repository at this point in the history
  • Loading branch information
mosoriob committed Nov 3, 2023
1 parent 9a5dd21 commit c76cddf
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 17 deletions.
41 changes: 38 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,41 @@ execution =

The publisher section of the configuration file describes how the Wings system shares data, execution, and provenance. The following properties are available:

| Name | Description | Default Value |
| -------------- | ------------------------------------------------ | ------------- |
| publisher.data | Location and URI of the WINGS ontology data file | /data |
```
publisher =
{
file-store=
{
url = "https://publisher.mint.isi.edu";
type = "FILE_SYSTEM";
}
triple-store = {
export-name = "exportTest";
export-url = "https://opmw.org/";
publish = https://endpoint.mint.isi.edu/provenance/data;
query = https://endpoint.mint.isi.edu/provenance/query;
domains-directory = /opt/wings/storage/default;
}
}
```

### File store

The file store section of the configuration file describes how the Wings system shares data. The following properties are available:

| Name | Description | Default Value |
| ------------------------- | --------------------------------- | ------------- |
| publisher.file-store.url | URI where the files are published | |
| publisher.file-store.type | Type of file store (FILE_SYSTEM) | FILE_SYSTEM |

### Triple store

The triple store section of the configuration file describes how the Wings system shares execution and provenance. The following properties are available:

| Name | Description | Default Value |
| ---------------------------------------- | -------------------------------------- | ---------------------------------------------- |
| publisher.triple-store.export-name | Name of the export (exportTest) | exportTest |
| publisher.triple-store.export-url | URI where the files are published | https://opmw.org/ |
| publisher.triple-store.publish | URI where the provenance is published | https://endpoint.mint.isi.edu/provenance/data |
| publisher.triple-store.query | URI where the provenance is queried | https://endpoint.mint.isi.edu/provenance/query |
| publisher.triple-store.domains-directory | Directory where the domains are stored | /opt/wings/storage/default |
7 changes: 4 additions & 3 deletions portal.properties
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@
type = "FILE_SYSTEM";
}
triple-store = {
graph-name = "exportTest"
publish = http://ontosoft.isi.edu:3030/provenance/data;
query = http://ontosoft.isi.edu:3030/provenance/sparql;
export-name = "exportTest";
export-url = "https://opmw.org/";
publish = https://endpoint.mint.isi.edu/provenance/data;
query = https://endpoint.mint.isi.edu/provenance/query;
domains-directory = /opt/wings/storage/default;
}
}
Expand Down
2 changes: 1 addition & 1 deletion portal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<properties>
<!-- rewrite.version>2.0.12.Final</rewrite.version -->
<wings-opmm.version>2.0.0</wings-opmm.version>
<wings-opmm.version>2.0.1</wings-opmm.version>
<servlet-api.version>2.5</servlet-api.version>
<httpclient.version>4.5.2</httpclient.version>
<jersey.version>2.27</jersey.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ public static enum Type {
SecureShell ssh;
Http http;

public FileStore.Type getType() {
return type;
}

public FileSystem getFileSystem() {
return fileSystem;
}

public SecureShell getSsh() {
return ssh;
}

public Http getHttp() {
return http;
}

public FileStore(PropertyListConfiguration serverConfig) {
this.type = FileStore.Type.valueOf(serverConfig.getString(PUBLISHER_FILE_STORE_TYPE));
switch (this.type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ public class FileSystem {
private static final String PUBLISHER_FILE_STORE_FILE_SYSTEM_DIRECTORY = "publisher.file-store.file-system.directory";
private String directory;

public static String getPublisherFileStoreFileSystemDirectory() {
return PUBLISHER_FILE_STORE_FILE_SYSTEM_DIRECTORY;
}

public String getDirectory() {
return directory;
}

public FileSystem(PropertyListConfiguration serverConfig) {
this.directory = serverConfig.getString(PUBLISHER_FILE_STORE_FILE_SYSTEM_DIRECTORY);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@ public class TripleStoreConfig {
private static final String PUBLISHER_SPARQL_DOMAINS_DIRECTORY_KEY = "publisher.triple-store.domains-directory";
private static final String PUBLISHER_ENDPOINT_QUERY_KEY = "publisher.triple-store.query";
private static final String PUBLISHER_ENDPOINT_POST_KEY = "publisher.triple-store.publish";
private static final String PUBLISHER_GRAPH_NAME = "publisher.triple-store.graph-name";
private static final String PUBLISHER_EXPORT_URL = "publisher.triple-store.export-url";
private static final String PUBLISHER_EXPORT_NAME = "publisher.triple-store.export-name";

String publishUrl;
String queryUrl;
String graphName;
String exportName;
String exportUrl;

String domainsDir;

public TripleStoreConfig(PropertyListConfiguration serverConfig) {
this.publishUrl = serverConfig.getString(PUBLISHER_ENDPOINT_POST_KEY);
this.queryUrl = serverConfig.getString(PUBLISHER_ENDPOINT_QUERY_KEY);
this.graphName = serverConfig.getString(PUBLISHER_GRAPH_NAME);
this.exportName = serverConfig.getString(PUBLISHER_EXPORT_NAME);
this.exportUrl = serverConfig.getString(PUBLISHER_EXPORT_URL);
this.domainsDir = serverConfig.getString(PUBLISHER_SPARQL_DOMAINS_DIRECTORY_KEY);
}

Expand All @@ -37,11 +41,16 @@ public String getQueryUrl() {
return queryUrl;
}

public String getGraphName() {
return graphName;
public String getExportPath() {
return exportName;
}

public String getDomainsDir() {
return domainsDir;
}

public String getExportUrl() {
return exportUrl;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.jena.base.Sys;
import org.apache.jena.riot.Lang;

public class RunController {

Expand Down Expand Up @@ -631,8 +632,6 @@ public ProvenanceResponseSchema publishRun(String runid) throws Exception {
webServerDomain);
String domain = config.getDomainId();
String catalogRepositoryDirectory = "domains";
String endpointQueryURI = "https://endpoint.mint.isi.edu/provenance/query";
String endpointPostURI = "https://endpoint.mint.isi.edu/provenance/query";
PublisherConfig publisher = config.portalConfig.getPublisher();

String runName = runid.substring(runid.indexOf('#') + 1);
Expand Down Expand Up @@ -731,9 +730,11 @@ public ProvenanceResponseSchema publishRun(String runid) throws Exception {
/**
* Publisher configuration
*/
String serialization = "turtle";
String exportUrl = "https://opmw.org/";
String exportPath = "exportTest";
Lang serialization = Lang.TURTLE;
String exportUrl = config.portalConfig.getPublisher().getTripleStore().getExportUrl();
String exportPath = config.portalConfig.getPublisher().getTripleStore().getExportPath();
String endpointQueryURI = config.portalConfig.getPublisher().getTripleStore().getQueryUrl();
String endpointPostURI = config.portalConfig.getPublisher().getTripleStore().getPublishUrl();
TriplesPublisher executionPublisher = new TriplesPublisher(
endpointQueryURI,
endpointPostURI,
Expand Down

0 comments on commit c76cddf

Please sign in to comment.