Skip to content

Commit

Permalink
cleaned up log output
Browse files Browse the repository at this point in the history
  • Loading branch information
Aklakan committed Apr 7, 2018
1 parent fd60e8e commit 34411a7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ dcat import ckan --host=http://ckan.qrowd.aksw.org --dataset=org-linkedgeodata-o
dcat deploy virtuoso --allowed=/writeable/dir/readable/by/virtuoso /tmp/dcat.nt
```

Note: It works also for the DCAT based DBpedia DataID datasets:
```
dcat show http://downloads.dbpedia.org/2016-10/core-i18n/en/2016-10_dataid_en.ttl > /tmp/dcat.ttl
```

*Question:* _And how do I create a [graph group](http://docs.openlinksw.com/virtuoso/rdfgraphsecuritygroups/) so I can view all these files as a single graph?_

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ public static void deploy(

if(!Files.exists(actualFile)) {
Path tmpFile = allowedFolder.resolve(".tmp-unzip-" + unzippedFilename);

Files.deleteIfExists(tmpFile);

logger.info("bzip archive detected, unzipping to " + tmpFile.toAbsolutePath());

try(InputStream in = new MetaBZip2CompressorInputStream(Files.newInputStream(path))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,9 @@ public Collection<URI> resolveDistribution(Resource dcatResource, Function<Strin
//String url = iriResolver.resolveToStringSilent(downloadURL);


logger.info("Downloading " + downloadUrl);
Path file = downloadFile(downloadUrl, dataFolder);
logger.info("Download:\n Url: " + downloadUrl + "\n File: " + file + "\n");
logger.info("Download finished:\n Url: " + downloadUrl + "\n File: " + file + "\n");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.nio.file.Paths;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.function.Function;

Expand Down Expand Up @@ -336,6 +337,14 @@ private static void processDeployVirtuoso(CommandDeployVirtuoso cmDeployVirtuoso

Model dcatModel = DcatUtils.createModelWithNormalizedDcatFragment(dcatSource);

Collection<DcatDataset> dcatDatasets = DcatUtils.listDcatDatasets(dcatModel);

logger.info("Detected datasets:");
for(DcatDataset dcatDataset: dcatDatasets) {
logger.info(" " + dcatDataset);
}
logger.info(dcatDatasets.size() + " datasets enqueued");

Path allowedFolder = Paths.get(cmDeployVirtuoso.allowed);

VirtuosoDataSource dataSource = new VirtuosoDataSource();
Expand All @@ -349,7 +358,7 @@ private static void processDeployVirtuoso(CommandDeployVirtuoso cmDeployVirtuoso

VirtuosoBulkLoad.logEnable(conn, 2, 0);

for(DcatDataset dcatDataset : DcatUtils.listDcatDatasets(dcatModel)) {
for(DcatDataset dcatDataset : dcatDatasets) {

DcatDeployVirtuosoUtils.deploy(dcatRepository, dcatDataset, iriResolver, allowedFolder, cmDeployVirtuoso.nosymlinks, conn);
}
Expand All @@ -358,7 +367,8 @@ private static void processDeployVirtuoso(CommandDeployVirtuoso cmDeployVirtuoso
}

// TODO rollback on error
} catch(Exception e ) {
} catch(Exception e) {
throw new RuntimeException(e);
//conn.rollback();
}
}
Expand Down
2 changes: 2 additions & 0 deletions dcat-suite-cli/src/main/resources/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ log4j.appender.stderr.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.stderr.layout.ConversionPattern=%d [%t] %-5p %c: %m%n
#log4j.appender.stderr.layout.ConversionPattern=%d %-5p %c: %m%n

log4j.appender.stderr.layout.ConversionPattern=[%p] %m%n

###############################################################################
# Log levels
###############################################################################
Expand Down

0 comments on commit 34411a7

Please sign in to comment.