Re: BaseDecl and PrefixDecl?

Thompson, Bryan B. wrote:
> Hello,
> I am trying to figure out what semantic constraints are present on the
> QuotedURI(Ref) for the BaseDecl and PrefixDecl productions.
> Are the QuotedURIRefs for BaseDecl and/or PrefixDecl _required_ to be
> absolute URIs?  May they be relative URIs?  Opaque?

Standard relative URI resolution applies.

> Are there any constraints on the kind of URI that may be used for a
> BaseDecl?  E.g., a URN?

URIs.  Standard rules, including the RDF rule for qname-like-thing to URI by 

> Should the BaseDecl be used to resolve a relative URI in a PrefixDecl?

Yes.  BASE must be first.  There was some text about this but it seems to have 
gone away.  Strange.

> The spec says that a PrefixDecl may be re-bound.  However, I can not
> think of any use case for this.  Since prefixes may only be bound at
> the top of the query, and since a PrefixDecl may not use a QNAME, it
> seems likely that re-defining a prefix will always indicate a user
> error.

Possibly an error - possibly filling in a template.  It was a WG decision from a 
while ago.  Whatever Turtle or N3 does.

> Is there any default namespace if none has been defined?  If not, is
> it an error to write ":foo" if the default namespace has not been
> bound?

There isn't a notion of default namespace - just the namespace with prefix "" 
which is spoken of as the default namespace but technically it isn't.

":foo" is legal only if "PREFIX : <...>" has been used.  It does not default.

Common usages in N3/Turtle include:

@prefix : <> .
@prefix : <#> .

but they are less useful in s SPARQL query unless you use BASE as well (or 
external equivalent).

Hmm - there is a bug in the grammar at the moment in that <> is not allowed - it 
should be.  RFC 3896, sec 4.2 has the rules.  I would prefer not to reproduce 
3896 in this doc and assume there is an external URI parser/checker/resolver. 
A comment in the grammar should suffice.

> Thanks,
> -bryan


Received on Thursday, 17 March 2005 12:58:54 UTC