Re: 2001-09-07#5 Literals (use cases/test inputs, please?)

Dan Connolly wrote:

> Brian McBride wrote:
> 
>>Dan Connolly wrote:
>>[...]
>>
>>
>>>What are these use cases?
>>>
>>We had 3.  Martyn had one where xml:lang was not used.
>>
> 
> ??? I wonder how that's relevant...


I think it supports your point of view.


> 
> 
>> Jan had one where it
>>was.
>>
> 
> Jan? Got any example files? What software are you using?
> 
> 
>> Eric had one where it was - though he still owes us a write up of that one.
>>
> 
> That's the one I keep hearing about. I phoned him about it,
> and he said they ended up using properties to represent
> language, not xml:lang.


Ahh.  I wondered about that.  I believe he reported that M&S's treatment of 
xml:lang was fine for their needs.  Did I misunderstand?

[...]


> 
> As far as I know, none of the RDF query systems
> allows me to say "show me the english labels
> from the RDFS schema".


Would be trivial in prolog.

I just had a look at RDQL and that does not, but its hardly surprising folks 
don't implement this feature of M&S when its presence in the spec keeps getting 
attacked.

Surely it can't be that hard to implement;  I did a little hacking on Jena. 
Jena's basic query mechanism uses a selector object:

    iter = model.listStatements(selector)

will return all statements selected by the selector.

There is a dumb selector which matches on the fields of statement, with null 
matching anything.

   iter = model.listStatements(new SelectorImpl(null, RDFS.label, null))

will select all the statements with an RDFS.label property.  I've added a new 
class AnyLiteral which matches any literal with a given language property.  Thus

   iter = model.listStatments(
           new SelectorImpl(
             null,
             RDFS.label,
             model.createAnyLiteral("fr")));

will select all statements with RDFS.label as the property and has a value which
is a literal with a language tag matching "fr".

I haven't tested it thoroughly, but it seems to work.  It does select all the 
french language labels from schema. Ya wanna the code?

This is actually quite a nice model.  Instead of using null to match 'any', 
maybe I should extend what I have done with literals and have AnyResource and 
AnyProperty classes.  They could implement regular expression matching on the 
URI, or match on namespace or whatever.   Hmmm, this trick could be used to 
implement aboutEachPrefix.

Brian

Received on Sunday, 21 October 2001 03:54:26 UTC