|
1 |
| -# net.binary_array_ld.bald |
2 |
| -Java library for parsing, validating and managing binary array linked data files, e.g. HDF, netCDF. |
| 1 | +# Binary Array Linked Data |
| 2 | + |
| 3 | +[Kotlin](https://kotlinlang.org/) library and CLI for Binary Array Linked Data (BALD) functionality. |
| 4 | +* NetCDF to RDF conversion according to [OGC draft specification]((http://docs.opengeospatial.org/DRAFTS/19-002.html)). |
| 5 | + |
| 6 | +This project consists of the following modules: |
| 7 | +* **binary-array-ld-lib** Core library containing BALD functionality. In particular, binary array to linked data (RDF) conversion. |
| 8 | +RDF representations are provided by [Apache Jena](https://jena.apache.org/). |
| 9 | +* **binary-array-ld-netcdf** NetCDF implementation of binary array concepts. |
| 10 | +* **binary-array-ld-cli** Command line interface for converting NetCDF metadata to RDF. |
| 11 | +* **binary-array-ld-test** Common test utilities used by other modules. |
| 12 | +* **binary-array-ld-demo** Demonstrations of BALD API usage. |
| 13 | + |
| 14 | +## Usage |
| 15 | + |
| 16 | +This project can be used either as a library or as a command line application. |
| 17 | + |
| 18 | +### Library |
| 19 | + |
| 20 | +To use the BALD core library, add the following dependency to your Maven project: |
| 21 | + |
| 22 | +```xml |
| 23 | +<dependency> |
| 24 | + <groupId>net.binary-array-ld</groupId> |
| 25 | + <artifactId>binary-array-ld-lib</artifactId> |
| 26 | + <version>${bald.version}</version> |
| 27 | +</dependency> |
| 28 | +``` |
| 29 | + |
| 30 | +You can implement the `net.bald.BinaryArray` interface with your own metadata representations and supply them to the API. |
| 31 | + |
| 32 | +For NetCDF metadata files, you can use the pre-made NetCDF implementation in the `binary-array-ld-netcdf` module. |
| 33 | +To use this module, add the following dependency to your Maven project: |
| 34 | + |
| 35 | +```xml |
| 36 | +<dependency> |
| 37 | + <groupId>net.binary-array-ld</groupId> |
| 38 | + <artifactId>binary-array-ld-netcdf</artifactId> |
| 39 | + <version>${bald.version}</version> |
| 40 | +</dependency> |
| 41 | +``` |
| 42 | + |
| 43 | +#### Example |
| 44 | +Kotlin: |
| 45 | +```kotlin |
| 46 | +val ba = NetCdfBinaryArray.create("/path/to/input.nc", "http://test.binary-array-ld.net/example") |
| 47 | +val model = ModelBinaryArrayConverter.convert(ba) |
| 48 | +File("/path/to/output.ttl").outputStream.use { output -> |
| 49 | + model.write(output, "ttl") |
| 50 | +} |
| 51 | +``` |
| 52 | +Java: |
| 53 | +``` |
| 54 | +BinaryArray ba = NetCdfBinaryArray.create(inputLoc, "http://test.binary-array-ld.net/example"); |
| 55 | +Model model = ModelBinaryArrayConverter.convert(ba); |
| 56 | +
|
| 57 | +try (OutputStream output = new FileOutputStream(outputLoc)) { |
| 58 | + model.write(output, format); |
| 59 | +} |
| 60 | +``` |
| 61 | + |
| 62 | +### Command Line Interface |
| 63 | +( TODO ) |
| 64 | + |
| 65 | + |
| 66 | + |
0 commit comments