Skip to content

Commit 5f4595d

Browse files
Merge branch 'master' of github.com:binary-array-ld/net.binary_array_ld.bald
2 parents 5d2f9b4 + a8dc12d commit 5f4595d

File tree

6 files changed

+22
-6
lines changed

6 files changed

+22
-6
lines changed

binary-array-ld-cli/src/test/kotlin/net/bald/BinaryArrayConvertCliTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,9 @@ class BinaryArrayConvertCliTest {
496496
statement(BALD.contains, createResource("http://test.binary-array-ld.net/example/")) {
497497
statement(RDF.type, BALD.Container)
498498
statement(BALD.contains, createResource("http://test.binary-array-ld.net/example/var0"), sortAnon = ::sortRefs) {
499+
statement(createProperty("${TestVocab.prefix}name"), createStringLiteral("var0"))
500+
statement(TestVocab.references, createResource("http://test.binary-array-ld.net/example/var1"))
501+
statement(TestVocab.references, createResource("http://test.binary-array-ld.net/example/var2"))
499502
statement(RDF.type, BALD.Array)
500503
statement(BALD.references) {
501504
statement(RDF.type, BALD.Reference)

binary-array-ld-netcdf/src/main/kotlin/net/bald/netcdf/NetCdfAttribute.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class NetCdfAttribute(
1212
private val attr: Attribute
1313
): net.bald.Attribute {
1414
private val name: String get() = attr.shortName
15-
private val prop: Property get() = parent.parseProperty(name)
15+
val prop: Property get() = parent.parseProperty(name)
1616

1717
override val uri: String get() = prop.uri
1818

binary-array-ld-netcdf/src/main/kotlin/net/bald/netcdf/NetCdfVar.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class NetCdfVar(
6969
private fun attributeRefs(): Sequence<NetCdfVar> {
7070
return v.attributes().let(::source)
7171
.attributes()
72+
.filter { attr -> attr.prop.let(parent.alias::isReferenceProperty) }
7273
.mapNotNull(NetCdfAttribute::rawValues)
7374
.flatten()
7475
.mapNotNull(parent::parseReferences)

binary-array-ld-netcdf/src/test/kotlin/net/bald/netcdf/NetCdfBinaryArrayTest.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,10 @@ class NetCdfBinaryArrayTest {
370370

371371
@Test
372372
fun vars_withReferenceAttributes_returnsReferences() {
373-
val ba = fromCdl("/netcdf/ref-attr.cdl", "http://test.binary-array-ld.net/ref-attr.nc")
373+
val alias = javaClass.getResourceAsStream("/turtle/var-alias.ttl").use { input ->
374+
ModelFactory.createDefaultModel().read(input, null, "ttl")
375+
}.let(ModelAliasDefinition::create)
376+
val ba = fromCdl("/netcdf/ref-attr.cdl", "http://test.binary-array-ld.net/ref-attr.nc", alias = alias)
374377
ContainerVerifier(ba.root).vars {
375378
variable("http://test.binary-array-ld.net/ref-attr.nc/var0") {
376379
dimensions(10, 90, 15)

binary-array-ld-test/src/main/resources/netcdf/ref-attr.cdl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ netcdf attributes {
66
d3 = 60 ;
77
variables:
88
int var0(d0, d1, d2) ;
9-
var0:bald__references = "var1 var2" ;
9+
var0:test__references = "var1 var2" ;
10+
var0:test__name = "var0" ;
1011
int var1(d1, d2, d3) ;
1112
var1:test__references = "var2";
1213
int var2(d2) ;

docs/alias.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,23 @@ as described in the [draft specification](http://docs.opengeospatial.org/DRAFTS/
66
## CLI
77

88
You can provide aliases as a set of RDF files.
9-
Use the `--alias` or `-a` option to specify the locations of alias files
10-
as a comma-delimited list.
11-
Note that these files must have a suitable extension in order to be parsed correctly.
9+
Use the `--alias` or `-a` option to specify the locations of alias files as a comma-delimited list.
10+
These can be the paths of files on the local file system, or the URLs of remote resources.
11+
12+
Note that the alias paths must have a suitable extension in order to be parsed correctly.
1213

1314
#### Example
1415
```
1516
java -jar bald-cli.jar --alias /path/to/alias.ttl /path/to/netcdf.nc /path/to/graph.ttl
1617
```
1718

19+
### Note
20+
21+
If your alias files are remote resources and you are using a proxy server,
22+
you must provide the proxy host and port with the `-Dhttp.proxyHost` and `-Dhttp.proxyPort`
23+
JVM arguments.
24+
See [here](https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html) for official documentation.
25+
1826
## Library
1927

2028
You can provide aliases as an Apache Jena [model](https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Model.html).

0 commit comments

Comments
 (0)