diff --git a/README.md b/README.md index 4c8da06..6fb631a 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ You can specify the output format using `-f,--format`. Available output formats: * `ntriples` - [N-Triples](https://www.w3.org/TR/n-triples/) (based on [MolecularEntitly](https://bioschemas.org/types/MolecularEntity/) type) * `rdfxml` - [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) (based on [MolecularEntitly](https://bioschemas.org/types/MolecularEntity/) type) * `rdfthrift` - [RDF Binary encoding using Thrift](https://afs.github.io/rdf-thrift/rdf-binary-thrift.html) (based on [MolecularEntitly](https://bioschemas.org/types/MolecularEntity/) type) +* `jsonldhtml` - [JSON-LD](https://json-ld.org/) with HTML (based on [MolecularEntitly](https://bioschemas.org/types/MolecularEntity/) type) * `jsonld` - [JSON-LD](https://json-ld.org/) (based on [MolecularEntitly](https://bioschemas.org/types/MolecularEntity/) type) * `rdfa` - Simple HTML with [RDFa](http://rdfa.info/) (based on [MolecularEntitly](https://bioschemas.org/types/MolecularEntity/) type) * `microdata` - Simple HTML with [Microdata](https://www.w3.org/TR/microdata/) (based on [MolecularEntitly](https://bioschemas.org/types/MolecularEntity/) type) diff --git a/src/main/java/pl/edu/uwb/ii/sdfeater/File.java b/src/main/java/pl/edu/uwb/ii/sdfeater/File.java index b4f5647..1c773af 100644 --- a/src/main/java/pl/edu/uwb/ii/sdfeater/File.java +++ b/src/main/java/pl/edu/uwb/ii/sdfeater/File.java @@ -1,4 +1,4 @@ -/* +/* * The MIT License * * Copyright 2017-2019 Ɓukasz Szeremeta. @@ -48,7 +48,6 @@ class File { * File class constructor * * @param filename filename of input file - * */ File(String filename) { this.filename = filename; @@ -59,12 +58,11 @@ class File { * appropriate program structures * * @param molecule Molecule object to which values from the file will be entered - * @param format Output format: c - Cypher, r - cvme, s - smiles, n - inchi - * @param urls Try to generate full database URLs instead of IDs - * (true/false) + * @param format Output format: c - Cypher, r - cvme, s - smiles, n - inchi + * @param urls Try to generate full database URLs instead of IDs + * (true/false) * @param periodic Map with additional atoms data from periodic table for - * cypher format (true/false) - * + * cypher format (true/false) */ void parse(Molecule molecule, char format, boolean urls, boolean periodic) { try { @@ -77,6 +75,14 @@ void parse(Molecule molecule, char format, boolean urls, boolean periodic) { /* Do something BEFORE file reading */ switch (format) { + // JSON-LD with HTML + case 'd': + System.out.println("\n" + + "\n" + + " \n" + + " Example Document\n" + + " \n" + + " \n" + + ""); + break; case 'x': jenaModel.write(System.out, "RDF/XML"); break; diff --git a/src/main/java/pl/edu/uwb/ii/sdfeater/SDFEater.java b/src/main/java/pl/edu/uwb/ii/sdfeater/SDFEater.java index 2eb388c..e76466e 100644 --- a/src/main/java/pl/edu/uwb/ii/sdfeater/SDFEater.java +++ b/src/main/java/pl/edu/uwb/ii/sdfeater/SDFEater.java @@ -127,6 +127,9 @@ public static void main(String[] args) { } else if (format.equalsIgnoreCase("ntriples")) { initializeJenaModel(); file.parse(molecule, 'n', false, false); + } else if (format.equalsIgnoreCase("jsonldhtml")) { + initializeJenaModel(); + file.parse(molecule, 'd', false, false); } else if (format.equalsIgnoreCase("jsonld")) { initializeJenaModel(); file.parse(molecule, 'j', false, false);