datatyping and query in RDF

hi,

Someone pointed out Dan Connolly's post about querying and datatypes to
me [1]. I think the case he's refering to is where there is no
intervening node representing the value of the datatype, but literals
can have datatypes imposed by range contraints, i.e. TDL 'global idiom'.

SquishQL in Inkling uses

(1) the triplesmatching-type api call
(2) the triples generated from a parser

to make its queries. It is built on top of the triples-matching
style API and will probably do whatever that does, or fit
rounds it...however:

In general, I'd do a query over typed nodes like this

select ?x ?y ?z
where
(?x <dc:Title> ?y)
(?z <age> ?y)
(?z <rdf:type> <foaf:Person>)

(say) although usually this will be enough:

select ?x ?y ?z
where
(?x <dc:Title> ?y)
(?z <age> ?y)

In my experience, usually you don't care what the type of a node is;
sometimes you do, and then you can add the extra constraint.

This doesn't work in TDL 'global idiom' when the datatyping is only
mentioned in rdfs:range. If it was in the database somewhere you could
have

select ?x ?y ?z
where
(?x <dc:Title> ?y)
(?z <age> ?y)

and the constraint on ?y from the range would be implicit and would
happen somewhere in the application code.

In that case I'd be against this idom, because normally I don't rely on
having the schema (or schema-like constraints) available when you make
a query, and because I prefer to make explicit queries.

Also I think that I would probably put the emphasis the opposite
way to the way Dan C suggests in the 'duh' argument - that is, in the
absence of typing info I'd make a match. Maybe that would be wrong.

The TDL 'local idiom' looks alright to me.
I guess if there are many possible lexical representations of a given
literal, then that might make querying more fiddly. At the moment
tests like ?x > 5 are done by casting to Java datatypes, as Andy does
with RDQL as well, so matching different lexical representations is
avoided.

I hope this makes sense: the more I read the datatypes info from
rdf-core, the more confusing I find it, though Brian's summary was
helpful [2]. The names of the different proposals seemed inconsistent
and confusing to me coming to the discussion rather late.

Libby

[1] http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2002Jan/0358.html
[2] http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2002Jan/0357.html

Received on Tuesday, 29 January 2002 14:46:45 UTC