File tree Expand file tree Collapse file tree 3 files changed +52
-0
lines changed Expand file tree Collapse file tree 3 files changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns =" http://maven.apache.org/POM/4.0.0"
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
+ <parent >
6
+ <artifactId >binary-array-ld</artifactId >
7
+ <groupId >net.binary-array-ld</groupId >
8
+ <version >1.0.0-SNAPSHOT</version >
9
+ </parent >
10
+ <modelVersion >4.0.0</modelVersion >
11
+
12
+ <artifactId >binary-array-ld-demo</artifactId >
13
+ <version >1.0.0-SNAPSHOT</version >
14
+
15
+ <name >Binary Array Linked Data - Demos</name >
16
+ <description >Examples of Binary Array to Linked Data API usage.</description >
17
+
18
+ <dependencies >
19
+ <dependency >
20
+ <groupId >net.binary-array-ld</groupId >
21
+ <artifactId >binary-array-ld-netcdf</artifactId >
22
+ <version >${project.parent.version} </version >
23
+ </dependency >
24
+ </dependencies >
25
+ </project >
Original file line number Diff line number Diff line change
1
+ package net .bald ;
2
+
3
+ import net .bald .model .ModelBinaryArrayConverter ;
4
+ import net .bald .netcdf .NetCdfBinaryArray ;
5
+ import org .apache .jena .rdf .model .Model ;
6
+
7
+ import java .io .FileOutputStream ;
8
+ import java .io .OutputStream ;
9
+
10
+ /**
11
+ * Demonstration of how to call the API in Java code.
12
+ */
13
+ public class NetCdfConvertJava {
14
+ public static void convert (String inputLoc , String outputLoc , String format ) throws Exception {
15
+ BinaryArray ba = NetCdfBinaryArray .create (inputLoc , "http://test.binary-array-ld.net/example" );
16
+ Model model = ModelBinaryArrayConverter .convert (ba );
17
+
18
+ try (OutputStream output = new FileOutputStream (outputLoc )) {
19
+ model .write (output , format );
20
+ }
21
+ }
22
+
23
+ public static void convert () throws Exception {
24
+ convert ("/path/to/input.nc" , "/path/to/input.ttl" , "ttl" );
25
+ }
26
+ }
Original file line number Diff line number Diff line change 27
27
<module >binary-array-ld-cli</module >
28
28
<module >binary-array-ld-netcdf</module >
29
29
<module >binary-array-ld-test</module >
30
+ <module >binary-array-ld-demo</module >
30
31
</modules >
31
32
32
33
<dependencies >
You can’t perform that action at this time.
0 commit comments