From: Seaborne, A. <and...@hp...> - 2007-01-24 15:18:58
|
-------- Original Message -------- > From: Christian Weiske <mailto:cw...@cw...> > Date: 23 January 2007 15:41 >=20 > Andy, >=20 >=20 > > The ordering of unlike things is partially defined in SPARQL. I'm = not > > sure what your DB schema is but if the type of the node (URI, bnode, > > datatype of literal) is some carefully choosen integer then > >=20 > > ORDER BY ?emp > > is (nearly) > > ORDER BY emp.type, emp.lexicialform. >=20 > I doubt that I can change the schema since many other parts of rdfapi > use it.=20 That makes it tricky - isn't there a singel abstraction layer that = handles all RDF->DB mapping? If so, maybe adding a field to help SPARQL is an option. >=20 >=20 > DB schema: >=20 > Field Type > ----------------------- > modelID bigint > subject varchar(255) > predicate varchar(255) > object text > l_language varchar(255) > l_datatype varchar(255) > subject_is varchar(1) > object_is varchar(1) >=20 >=20 > subject, predicate and object values are stored in the corresponding > fields. subject_is and object_is determine the overall type of the > data: literal, resource, blank node.=20 > l_datatype is the real data type of the object, e.g. > "http://www.w3.org/2001/XMLSchema#integer". >=20 >=20 > By the way, how does jena do it (assuming you are coming from there)? Only sort-of coming from there. I was recalling what 3Store did as = well. The new Jena DB layer has a schema (actually, choice of schemas) = specifically for SPARQL so we can store the sort type code. ARQ currently does it all client-side because the objective is to be = correct, corner cases of XSD datatypes and all. Andy >=20 > -- > Regards/Mit freundlichen Gr=FC=DFen > Christian Weiske |