Datalink vocabulary

Norman Gray norman at astro.gla.ac.uk
Tue Sep 23 12:01:57 CEST 2014


Pat, hello.

On 2014 Sep 23, at 00:47, Patrick Dowler <patrick.dowler at nrc-cnrc.gc.ca> wrote:

> 
> I am changing the DataLink document so that
> 
>   http://www.ivoa.net/rdf/datalink/core#image
> 
> (with the "core" part) is the fully qualified value.
> 
> When I looked back at the bit where we say people can use the fragment without the "url" as a short form, we currently give an example like #image is equivalent to the above... but now I'm not sure I like the fragment (#) symbol in the short form and I'm sure someone else didn't like it either but can't find a statement to that effect.

My recollection was that Markus (I think) particularly liked it, as it looked a bit like a 'hashtag', which gave the right impression.

I imagine that most of the time, people will simply use the core vocabulary, prefixed by a hash, and not have to worry about the details.  The next level of sophistication would be using a full URI.

I suggest that the 'semantics' term (of 3.2.6) should be defined as follows:

  * The 'semantics' term is interpreted as a URI.
  * If the term is a relative URI, then it is resolved against the base URI <http://www.ivoa.net/rdf/datalink/core#> using the standard algorithm of RFC3986 Sect. 5.2.

Examples:

  * #image
    (the simplest and most common case): this is resolved to produce <http://www.ivoa.net/rdf/datalink/core#image>

  * http://example.org
    This is an absolute URI, so is used as-is

  * extension#picture
    (an IVOA standardised 'extension' namespace): resolved to produce <http://www.ivoa.net/rdf/datalink/extension#picture>

These are all pretty much as one might expect, once one recalls that the relative URI resolution algorithm doesn't just concatenate the base and relative URIs; in particular, the base URI's fragment never makes it into the result..  The mention of RFC 3986 will deal with any edge cases, but the resulting spec should be fairly intuitive.

So, specifically:

> Will this cause some people/clients to generate the fully qualified term with ##?

With this algorithm, that would be an error.

> Would removing the # from the short form give people the impression that the semantics field could contain any old word or string?

Yes: I think it would.  A '#' might suggest to some people they can invent hashtags, but the text might clarify that that's not an option.  In any case, the presence of the punctuation will give the hint this isn't arbitrary text.

> Is the short form really a good idea here? Should the short form include the #?

I think the short form is useful because it makes the most common case look simple, without cutting out the more sophisticated cases.

As illustration of the above points, see below.  This shows a very simple Turtle file, and its conversion to n-triples.  The point here is not the Turtle, but that I trust this library's URI resolution algorithm -- look at the first column of the 'rapper' output below.

% cat resolving.ttl 
@base <http://www.ivoa.net/rdf/datalink/core#blah>.

@prefix foo: <http://example.org/vocab#>.

# The 'normal' case: just using '#foo' from the Datalink vocabulary
<#image> a foo:Thing.

# Using another non-core Datalink term
<extension#pretty-picture> a foo:Thing.

# Using a completely separate URI
<http://something.else.org/my#x> a foo:Thing.

# Probably an error in our case, but for the sake of illustration, a fragmentless URI
<extension2> a foo:Thing.

# We're not talking about defining prefixes in the Datalink syntax
# (but just for Turtle completeness...)
foo:bill a foo:Thing.

% rapper -iturtle -ontriples resolving.ttl 
rapper: Parsing URI file:///private/tmp/resolving.ttl with parser turtle
rapper: Serializing with serializer ntriples
<http://www.ivoa.net/rdf/datalink/core#image> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/vocab#Thing> .
<http://www.ivoa.net/rdf/datalink/extension#pretty-picture> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/vocab#Thing> .
<http://something.else.org/my#x> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/vocab#Thing> .
<http://www.ivoa.net/rdf/datalink/extension2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/vocab#Thing> .
<http://example.org/vocab#bill> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/vocab#Thing> .
rapper: Parsing returned 5 triples
% 








All the best,

Norman


-- 
Norman Gray  :  http://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK



More information about the dal mailing list