Re: [Sparql4j-devel] Integration of external RDF APIs via Factory
Status: Pre-Alpha
Brought to you by:
jsaarela
|
From: Samppa S. <sam...@pr...> - 2005-12-29 07:47:20
|
In addition to getObject returning RDFNodes via a configurable factory
we could provide pseudo columns to access properties of nodes (type,
datatype, lang) e.g.
ResultsSet rs = executeQuery("select * where {?s ?p ?o}");
while (rs.next()) {
String label = rs.getString("o");
int type = rs.getInt("o$type");
switch (type) {
case RESOURCE: ...
case BLANK_NODE: ...
case PLAIN_LITERAL:
String lang = rs.getString("o$lang");
...
case TYPED_LITERAL:
String datatype = rs.getString("o$datatype");
...
}
}
Should XMLLiteral be handled as a separate type or as a typed literal
with datatype rdf:XMLLiteral?
Br,
Samppa
> Hello.
>
> Concerning SELECT results access it would be possible to plug RDF apis
> into the driver via a factory interface.
>
> We could provide a neutral SPARQL4J dependent minimal RDF API and in
> addition to this the possibility to plug external APIs into the driver.
>
> RDF nodes (or any other objects returned by the factory) could be
> accessed via the umtyped accessors of the JDBC result set.
>
> e.g.
>
> interface NodeFactory{
>
> public Object createLiteral(String lex, String lang, String datatype);
>
> public Object createResource(String uri);
>
> public Object createResource(String ns, String local);
>
> public Object createBlankNode(String internalID);
>
> }
>
> The name of the implementation class could be given to the Driver via
> the property map.
>
> Br,
> Timo.
>
--
Samppa Saarela <samppa.saarela at profium.com> Profium, Lars Sonckin kaari 12, 02600 Espoo, Finland Tel. +358 (0)9 855 98 000 Fax. +358 (0)9 855 98 002 Mob. +358 (0)41 515 1412 Internet: http://www.profium.com
|