binary-array-ld / bald

Python library for validating and managing binary array linked data files, e.g. HDF, netCDF.
BSD 3-Clause "New" or "Revised" License
10 stars 12 forks source link

Prefix Definition #73

Open marqh opened 6 years ago

marqh commented 6 years ago

Should a prefix definition include the double underscore character, so that cat prefix alias results in a URI?

Or

Should the prefix separator be part of the standard, and not be included in the prefix definition

marqh commented 6 years ago

for example: https://github.com/binary-array-ld/bald/blob/master/lib/bald/tests/integration/CDL/array_reference.cdl#L13

    prefix_list:bald__ = "http://binary-array-ld.net/latest/" ;
    prefix_list:rdf__ = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" ;

should the double underscore __ always be implied? Such that

    prefix_list:bald = "http://binary-array-ld.net/latest/" ;
    prefix_list:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" ;
marqh commented 6 years ago

For comparison, the terse triple language (ttl) includes the prefix separator (':') in the prefix definition: https://github.com/binary-array-ld/bald/blob/master/lib/bald/tests/integration/TTL/array_reference.ttl#L1

@prefix bald: <http://binary-array-ld.net/latest/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

I suspect it was this pattern that we initially adopted.

jyucsiro commented 6 years ago

The other pattern relevant here for the alternative approach is taken from JSON-LD - see https://json-ld.org/spec/latest/json-ld/

Example: { "@context": { "foaf": "http://xmlns.com/foaf/0.1/", "xsd": "http://www.w3.org/2001/XMLSchema#", "name": "foaf:name", "foaf:age": { "@id": "foaf:age", "@type": "xsd:integer" }, "http://xmlns.com/foaf/0.1/homepage": { "@type": "@id" } }, ... }

jyucsiro commented 6 years ago

The current proposal is to provide prefixes in a variable such as "bald_prefixes". In this case the parser knows where to get the prefixes from so not having the double underscore in a prefix declaration is not a problem.

Pros might be:

Cons:

The double underscore pattern - pros:

Cons